skwalker112
09-22-2006, 09:28 AM
I have to write this program by *2 a.m. tonight and i need help writing this program below. I will work with whoever can give me help all night if that is what it takes
I'm trying to write a small code that will ask the user to choose between Orange county or Seminole county sales tax calculation.
- The user will also have the option to quit the program. (You can use *, 2, and * respectively).
- If the incorrect choice is typed, display an error message and prompt the user to re-enter a choice.
- If the user selects one of the two counties, the program should prompt the user to enter the price of the item.
- The program must then calculate the sales tax according to the following:
- Orange county tax is 6.5%.
- Seminole county tax is 7.0%.
- Finally, the program must output the price, tax, and total amount.
- The process must continue until the user enters the option to quit the program.
Here is a bit of my code but i don't know what to do next:
am i off to the right start or what?
CODE:
using namespace std;
int main()
{
bool done;
int num*;
int num2;
int userChoice;
bool finished;
do
{
cout << "Enter <*> if you want to start over ";
cin >> userChoice;
if (userChoice == *)
{
finished = true;
}
else
{
finished = false;
}
}
done = false;
cout << " Enter Orange county or Seminole county ";
while (done == false)
{
cin >> num*;
cin >> num2;
done = false;
cout << " Incorrect. Please try again. ";
}
}
while (finished == false);
return 0;
I'm trying to write a small code that will ask the user to choose between Orange county or Seminole county sales tax calculation.
- The user will also have the option to quit the program. (You can use *, 2, and * respectively).
- If the incorrect choice is typed, display an error message and prompt the user to re-enter a choice.
- If the user selects one of the two counties, the program should prompt the user to enter the price of the item.
- The program must then calculate the sales tax according to the following:
- Orange county tax is 6.5%.
- Seminole county tax is 7.0%.
- Finally, the program must output the price, tax, and total amount.
- The process must continue until the user enters the option to quit the program.
Here is a bit of my code but i don't know what to do next:
am i off to the right start or what?
CODE:
using namespace std;
int main()
{
bool done;
int num*;
int num2;
int userChoice;
bool finished;
do
{
cout << "Enter <*> if you want to start over ";
cin >> userChoice;
if (userChoice == *)
{
finished = true;
}
else
{
finished = false;
}
}
done = false;
cout << " Enter Orange county or Seminole county ";
while (done == false)
{
cin >> num*;
cin >> num2;
done = false;
cout << " Incorrect. Please try again. ";
}
}
while (finished == false);
return 0;