2 Replies - 5441 Views - Last Post: 21 September 2006 - 01:08 PM Rate Topic: *---- 1 Votes

#1 csstarter9  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 18-September 06

Sales Tax Program - Sequential Logic

Posted 21 September 2006 - 07:11 AM

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 1, 2, and 3 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?
using namespace std;
int main()
{
bool done;
int num1;
int num2;
int userChoice;
bool finished;
do
{
cout << "Enter <1> if you want to start over ";
cin >> userChoice;
if (userChoice == 1)
{
finished = true;
}
else
{
finished = false;
}
}
done = false;
cout << " Enter Orange county or Seminole county ";
while (done == false)
{
cin >> num1;
cin >> num2;

done = false;
cout << " Incorrect. Please try again. ";
}

}
while (finished == false); 
return 0;

This post has been edited by csstarter9: 21 September 2006 - 01:11 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Sales Tax Program - Sequential Logic

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 247
  • View blog
  • Posts: 13,505
  • Joined: 12-July 02

Re: Sales Tax Program - Sequential Logic

Posted 21 September 2006 - 07:17 AM

I hate to mention it, but with the exception of asking about the counties, this is your previous program about asking the user for integers, and multiplying them together. Have you tried modifying the program?

You'll need variables to store the values for the tax rates, and a variable to store the user input for the county, and a variable to store the user input for the price.
Was This Post Helpful? 0
  • +
  • -

#3 csstarter9  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 18-September 06

Re: Sales Tax Program - Sequential Logic

Posted 21 September 2006 - 01:08 PM

View PostAmadeus, on 21 Sep, 2006 - 07:17 AM, said:

I hate to mention it, but with the exception of asking about the counties, this is your previous program about asking the user for integers, and multiplying them together. Have you tried modifying the program?

You'll need variables to store the values for the tax rates, and a variable to store the user input for the county, and a variable to store the user input for the price.


Yeah i know i was trying to see if i was off to the right start or not
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1