new program, would like a little help or a direction to go

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 2321 Views - Last Post: 26 April 2001 - 08:23 PM Rate Topic: -----

#1 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

new program, would like a little help or a direction to go

Posted 23 April 2001 - 01:10 PM

k, you may be able to help to nighthawk, i hope our disagreements in the other sections of the site can stay out of C++, because i know you must be a #### good programmer to be getting your degree in computer science and i wont take that away from you, now my question:

my new program has to print a series of numbers out it binary form. it cant use cout's or cin's. it also has to print them out in a certain way, the way he gave us. it cant be cheap either and just assign the numbers to an array. anyways i have some ideas, but here is the binary order:

Back to messagelist
Printer friendly version á



Subject: ábinary number program
Posted by: supersloth on April 22, 2001 at 11:39:20 AM á
k, i have a to work on a new program that creates a binary number system using no cins in the program ata ll, i know its going to be based on a set of 8 columns and use some for loops. but i'm trying to get started. the columns should look like this:

0 0 0 0 1 0 0 0
0 0 0 1 1 0 0 0
0 0 1 0 1 0 1 0
0 0 1 1 1 0 0 1
0 1 0 0 1 0 1 0
0 1 0 1 1 0 1 0
0 1 1 0 1 0 1 0
0 1 1 1 1 0 1 1
1 0 0 0 1 0 0 0
1 0 0 1 0 1 0 0
1 0 1 0 1 0 1 0
1 0 1 1 0 0 0 1
1 1 0 0 1 0 0 1
1 1 0 1 0 0 0 1
1 1 1 0 1 0 1 1
1 1 1 1 1 0 0 1

i have an idea, but i don't know wher to take it.

w=(a||b)&&(c||d)
x=(!a||!b||!c)
y=(w&&x||a)
z=(a||b||c||d)

any help would be much appreciated.


he just added in that the computer generates the zeros and ones, just like true and false, yea that is it.

(Edited by supersloth at 3:16 pm on April 23, 2001)


Is This A Good Question/Topic? 0
  • +

Replies To: new program, would like a little help or a direction to go

#2 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 04:36 PM

void first_series()
{int a,b,c,d,i,w,x,y,z;a=1;b=1;c=1;d=1;
for (i=0;i=1;i++)
{for (i=0;i=1;i++)
{for (i=0;i=1;i++)
{for (i=0;i=1;i++)
outfile.open("outprogram5", ios::out);
w=(a||b)&&(c||d);
x=(!a-b || !b || !c);
y=(w && x || a);
z=(a||b||c||d);
cout << a<<b<<c<<d<<w<<x<<y<<z <<'
';
outfile << a<<b<<c<<d<<w<<x<<y<<z <<'
';
}}}

outfile.close();
}


thats what i have now, dont know what next.

Was This Post Helpful? 0
  • +
  • -

#3 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 06:00 PM

top
Was This Post Helpful? 0
  • +
  • -

#4 runtime error  Icon User is offline

  • Lucky.Code
  • member icon

Reputation: 3
  • View blog
  • Posts: 629
  • Joined: 19-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 06:24 PM

first off your for loops are all wrong. use a b c d inside the for loops. I can't tell you much more than that because hanosh will hunt me down like a dog. He made me promise i wouldn't help any body too much. He is getting very suspicious about the program i made that outputs to a word file.

Oh by the way he is out to stop all help that will come your way. he said he told the guys at prog heaven not to help you too much and now he wants to tell the d.i.c gang not to help.

Good luck with the program.

Was This Post Helpful? 0
  • +
  • -

#5 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 07:17 PM

does he have the address to this site or not, i want want to know that way i know if i can talk about him or not. &**^&^*(*&^&$$@#%**(%&^#%$$&^^(*&*(&&^$^%%*&(&*&$^%$^
Was This Post Helpful? 0
  • +
  • -

#6 LeprechauN  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 2
  • View blog
  • Posts: 857
  • Joined: 12-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 07:30 PM

you forgot to carry the one
Was This Post Helpful? 0
  • +
  • -

#7 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 07:38 PM

thanx
Was This Post Helpful? 0
  • +
  • -

#8 runtime error  Icon User is offline

  • Lucky.Code
  • member icon

Reputation: 3
  • View blog
  • Posts: 629
  • Joined: 19-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 09:14 PM

i don't know whether he has the address.
Was This Post Helpful? 0
  • +
  • -

#9 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 09:21 PM

DAMNIT!!!
Was This Post Helpful? 0
  • +
  • -

#10 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: new program, would like a little help or a direction to go

Posted 24 April 2001 - 09:35 PM

[EDITED BY SKYHAWK, THAT COULD HAVE BEEN INTERPRETED BADLY] and i wont have to worry about him. #### him. trying to control our site. i forgot to ask runtime, did you get your final today?
Was This Post Helpful? 0
  • +
  • -

#11 nighthawk  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 1,269
  • Joined: 11-April 01

Re: new program, would like a little help or a direction to go

Posted 25 April 2001 - 10:14 AM

hey supersloth, consider all disagreements put aside, i can help you but i need a clarification of the assignment that you're supposed to be doing....i get the part about what the columns should look like, but my question is, do you know the numbers that generate the binary number, i could figure it out if i had to, but there seems to be something missing from your explanation that is making me not fully understand it. with a little clarification, i could help you.
Was This Post Helpful? 0
  • +
  • -

#12 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: new program, would like a little help or a direction to go

Posted 25 April 2001 - 02:31 PM

k, i have new code this may help out:


void first_series()
{
int a,b,c,d,w,x,y,z;
cout << "First Series of Bytes
";
outfile << "First Series of Bytes
";
for (a=0;a<=1;a++)
{
for (b=0;b<=1;b++)
{
for (c=0;c<=1;c++)
{
for (d=0;d<=1;d++)
{

outfile.open("outprogram5", ios::out);
w=(!a||!d)||(b&&c);<<--this is correct
x=b;<<---my problem is here, i need to make a
y=c;<<---an equation like for w, so that the
z=d;[b]<<---looks like it should

cout <<" "<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<w<<" "<<x<<" "<<y<<" "<<z <<endl;
outfile <<" "<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<w<<" "<<x<<" "<<y<<" "<<z <<endl;
}
}
}
}

}//end of function

Was This Post Helpful? 0
  • +
  • -

#13 nighthawk  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 1,269
  • Joined: 11-April 01

Re: new program, would like a little help or a direction to go

Posted 26 April 2001 - 12:24 PM

ok sloth, check your hotmail account, i sent you a thing that should help you with the assignment :)
Was This Post Helpful? 0
  • +
  • -

#14 Sunlight  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-April 01

Re: new program, would like a little help or a direction to go

Posted 26 April 2001 - 05:55 PM

A little difficult to illustrate without Karnaugh maps, but we'll try straightforward Boolean algebra.

Start with z, the easiest:

z =
(!a && !b && ác && ád) ||
(!a && áb && ác && ád) ||
( a && !b && ác && ád) ||
( a && áb && !c && !d) ||
( a && áb && !c && ád) ||
( a && áb && ác && !d) ||
( a && áb && ác && ád);

Next, notice we have

(!a && !b && ác && ád)||(!a && áb && ác && ád)

which is eqivalent to á (!a && ác && ád). Performing similar reductions:

( a && !b && ác && ád)||( a && áb && ác && ád) = (a && c && ád)
( a && áb && !c && !d)||( a && áb && !c && ád) = (a && b && !c)
( a && áb && ác && !d)||( a && áb && ác && ád) = (a && b && ác)

, we have:

z = (!a && c && d) || (a && c && d) || (a && b && !c) || (a && b && c);

Reducing again:
(!a && c && ád) || (a && c && d) = (c && d)
( a && b && !c) || (a && b && c) = (a && b)

So:

z = (c && d) || (a && b);

since no further reduction can occur.

Armed with this technique, you should be able to do the others...

Was This Post Helpful? 0
  • +
  • -

#15 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: new program, would like a little help or a direction to go

Posted 26 April 2001 - 06:44 PM

thanx both of you went above and beyond the call of duty
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2