954,487 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Urgent Help

my program runns but it isnt coming out right, i need to have on the left side my input*.01*cash and on the right side the chas sequencing 1-20
the problem is the cash numbers are counting more than once before going on to the next number for example:
1
1
1
1
2
2
2
and on the left my input that had been multiple following across down keeps having the letter "e" after each time it shows a number... this is what i am told to do...Produce a tow-column table with column headings showing P% of the amounts $1,$2,3$,...,20$. P is to be the input.

Please help me get this right i am new and horrible to this, please help, (been trying for 2 hours now)
i have my crappy working source code that outputes the wrong things
#include
#include


int main()
{
double percentage,num2;


cout<<"Please insert percentage: ";
cin>>percentage;
num2=percentage*.01;

for(double cash=1;cash<=20;cash=cash+1)
{
num2=num2*cash;
cout<

caseg
Newbie Poster
13 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

did you really write that program? or did you just copy it from somebody else? Look closely and you will see that it is printing the same thing over, and over and over one each iteration. But of course you already know that if you had written it youself :rolleyes:

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Why are you doing cout so many times inside the loop? You're going to get like 400 printouts...

winbatch
Posting Pro in Training
466 posts since Feb 2005
Reputation Points: 68
Solved Threads: 18
 
did you really write that program? or did you just copy it from somebody else? Look closely and you will see that it is printing the same thing over, and over and over one each iteration. But of course you already know that if you had written it youself :rolleyes:

yeah i had wrote it myself, just because i am kinda a rooky at this doesn't mean you can dis my work... ='(

caseg
Newbie Poster
13 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

yea u only need 1 cout statement since its a loop and all the other couts are the same thing

tyczj
Junior Poster in Training
91 posts since Mar 2005
Reputation Points: 10
Solved Threads: 1
 
yeah i had wrote it myself,


Good -- just checking because the question you asked makes one believe otherwise. just because i am kinda a rooky
We've all been there, done that. dis my work... ='(

I have no idea what that means. :eek:

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
I have no idea what that means. :eek:

caseg is probably from the UK, because "diss" is Brit-slang for "disrespect". :)

Bench
Posting Pro
577 posts since Feb 2006
Reputation Points: 307
Solved Threads: 63
 
caseg is probably from the UK, because "diss" is Brit-slang for "disrespect". :)

It also is bad english for...making fun of... :rolleyes:

Whodey
Newbie Poster
10 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
 
return(0);

for starters....that should be
return 0;
it doesnt really dont need the ( )


also
#include
#include


u dont need the .h after them i belive on some compilers

and if ur compile wont compile it use

char response;
std::cin >> response;
return 0;


cuz i got to use that in Dev to see the prgrm :eek:

Whodey
Newbie Poster
10 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You