help me guys please asap

ray February 3, 2009 at 18:07:26
Specs: Windows Vista
Write a program for a kid to practice simple multiplications. The program must request
two integer numbers from the user and then asks the user to enter the product of the two
numbers. The program must perform the following tasks:
1. Request two integer numbers from the user.
2. Verify if the two numbers are between 0 and 10 (not inclusive) and, if not, ask for
the two numbers again until the conditions are met.
3. Instruct the user to enter the product of the two numbers.
4. If the product entered by the user is incorrect request the product from the user
again with a message that the answer was incorrect. Keep requesting the number
until the answer is correct.
5. When the product entered by the user is correct output a message specifying so
and ask the user if he/she would like to start over.
6. If the answer to the question to start over is 1, start over, and, otherwise, end the
program.

See More: help me guys please asap

Report •


#1
February 3, 2009 at 19:27:00
This isn't homework is it? ;)

Report •

#2
February 3, 2009 at 19:41:56
honestly it is i have some of it but im stuck and its due

Report •

#3
February 3, 2009 at 20:00:01
Since you wrote it out in a manner that could be used for a basis of a program, how far can you get on the list?

Each line of your question could be used for tasks. How do you request two numbers? Don't think it matters if one or two at a time in this case.

"Best Practices", Event viewer, host file, perfmon, antivirus, anti-spyware, Live CD's, backups, are in my top 10


Report •

Related Solutions

#4
February 3, 2009 at 20:06:29
heres wat i got so far

#include <iostream>

using namespace std;

int main()
{
cout <<"Welcome Kid! \n\n";

cout <<"This program will help you study multiplication. \n\n";

int number1, number2, ans1;
int userValue, prodvalue;

do
{
cout <<"Enter two numbers between 0 and 10: ";
cin >> number1 >> number2;

if ((0 < number1 < 10) && (0 < number2 < 10))
{
correctChoice = true;
}
else
{
correctChoice = false;
cout <<"Both number should be greater than 0 and less than 10! \n\n";
}
}

system "PAUSE"
{
while (incorrectChoice == true)
{
number1 * number2 = ans1
cout <<"How much is number1 times number2?" << number1, number2 << " \n";
cin >> prodvalue;

if (prodvalue != ans1)
{
cout <<"Incorrect, please try again \n";
}
else
{
cout <<"Very good! \n\n";

{
bool done = false;

while (!done)
{
cout <<"Do you want to try another set? \n";
cout <<"Type 1 if you do or any other number if you want to quit: \n";
cin >> userValue;

if (userValue == 1)
{
cout <<"Goodbye!!! \n\n";
}
else
{
done = true
}

}

return 0;
}




Report •

#5
February 3, 2009 at 20:09:10
lol im sorry becuase i only have 55 minutes to turn this in ive been workin at it all week lol

Report •

#6
February 4, 2009 at 02:02:55
correctChoice and incorrectChoice are never declared.

Line 14: You have a do without a while.

Line 19: if ((0 < number1 < 10) && (0 < number2 < 10))
This will always return true. Also, do not use an if just to set the value of a boolean. It's easier and faster to do this:

correctChoice = number1 > 0 && number1 < 10 && number2 > 0 && number2 < 10;

Line 30: system "PAUSE"
Should be system("PAUSE"); (Or removed entirely.)

Line 34: It's variable = value, not the other way around. Also, you forgot the ';'

Line 35: cout <<"How much is number1 times number2?" << number1, number2 << " \n";
Can't have that comma between number1 and number2.

cout <<number1 << " * " << number2 << " =?\n";

The entire thing falls apart after line 38, and you don't have nearly enough closing brackets. (The latter suggests poor indentation, but I can't tell from the way you pasted it in.) I'd suggest a function or two, but I suspect you're not that far into the class. Something that might work for you would be to work from outer to inner, instead of writing from top-down. Write all of the code that doesn't go into a loop. Then, go back and fill in the missing loop code. While writing that code, skip anything that'll go in an inner loop. Once you're done with that level of code, go back and fill in the second loops. Repeat until finished.


Report •


Ask Question