Jul 3, 2010 at 6:09am UTC
Just repeatedly ask for the amount he sold for until they input "0", at which case the program should assume that is the end of sales.
Jul 3, 2010 at 9:31am UTC
welcome Zhuge (726)
yes but i don't understand the steps
could you please tell me the steps then i can write algorathim
1- what should i do
2- ..... etc
Jul 3, 2010 at 3:50pm UTC
Firstly, 2 + 3 + 4 + 5 + 6 == 20!
Secondly, you're resetting the value of sum on every loop iteration. You should do this instead:
sum += num1;
Last edited on Jul 3, 2010 at 3:51pm UTC
Jul 3, 2010 at 4:26pm UTC
thanks it's working now
so can you help me witgh Q1??
Jul 3, 2010 at 4:28pm UTC
thanks it's working now
can you help me with Q1? could write to me the code buecause i dont know how to write for it
Jul 3, 2010 at 6:44pm UTC
Did you ask your teacher what does "solve this formula" mean? What did he tell you?
Jul 3, 2010 at 6:57pm UTC
welcome
he didn't reply :(
Jul 4, 2010 at 5:03pm UTC
Remove this -> x++;
Also turn this -> cout<<"ln(" <<x<<")=" <<s<<endl;
into -> cout<<"ln(" <<x+1<<")=" <<s<<endl;
Oh, and x should be a float.
Last edited on Jul 4, 2010 at 5:04pm UTC