help...plz

We are writing a program that will function as a point of sale system at a sports arena snack bar. The snack bar sells only six different items. They are listed along with their unit prices and sales codes:

• S - Sandwich $7.50
• C - Chips $2.00
• B - Brownie $1.75
• R - Regular drink $2.50
• L - Large drink $4.75
• X - cancel and start over
• T - total the sale

All items are subject to sales tax. 6%.

The program will start by displaying this menu.

S - Sandwich $ 7.50
C - Chips $ 2.00
B - Brownie $ 1.75
R - Regular drink $ 2.50
L - Large drink $ 4.75
X - Cancel sale and start over
T - Total the sale

The current total is: $0.00
Enter your selection (q to quit):
can somone plz show me how to write that...
closed account (z05DSL3A)
You are unlikely to get anyone to do your course work for you, if you have a specific question about a problem then post it, preferably with source code. If you show that you are trying to do the work people are more likely to help!
Here it is, anyway.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream.h>
#include <iomanip>

const float TAX=.06;

void menu();

int main()
{
  float total=0;
  bool done=false;
  char choice;
  menu();
  cout << setiosflags(ios::showpoint) << setiosflags(ios::fixed) << setprecision(2);
  while (!done) {
    cout << "Your current sub-total is: $" << total << endl;
    cout << "Enter your selection (q to quit, ? for menu): ";
    cin >> choice;
    cout << endl;
    switch (choice) {
      case '?':
        menu();
        break;
      case 'S': case 's':
        cout << "Sandwitch, $7.50" << endl << endl;
        total+=7.5;
        break;
      case 'C': case 'c':
        cout << "Chips, $2.00" << endl << endl;
        total+=2;
        break;
      case 'B': case 'b':
        cout << "Brownie, $1.75" << endl << endl;
        total+=1.75;
        break;
      case 'R': case 'r':
        cout << "Regular drink, $2.50" << endl << endl;
        total+=2.5;
        break;
      case 'L': case 'l':
        cout << "Large drink, $4.75" << endl << endl;
        total+=4.75;
        break;
      case 'X': case 'x':
        cout << "Cancel, start over." << endl << endl;
        total=0;
        break;
      case 'T': case 't':
        cout << "Sub-total: " << total << endl;
        cout << "+ Tax    : " << total*TAX << endl;
        cout << "Total    : " << total+total*TAX << endl << endl;
        break;
      case 'Q': case 'q':
        done=true;
        break;
      default:
        menu();
    }
  }
}

void menu() {
  cout << endl;
  cout << "S - Sandwich $7.50" << endl;
  cout << "C - Chips $2.00" << endl;
  cout << "B - Brownie $1.75" << endl;
  cout << "R - Regular drink $2.50" << endl;
  cout << "L - Large drink $4.75" << endl;
  cout << "X - cancel and start over" << endl;
  cout << "T - total the sale" << endl;
  cout << endl;
  cout << "All items are subject to sales tax. 6%.";
  cout << endl << endl;
}

How about you write something, then come back with a more specific question. This forum has plenty of people willing to help (myself included), but not too many willing to give handouts.
Topic archived. No new replies allowed.