Input Process Output
Name
Pizza Type
Pizza Size
Senior (Y/N)
1. Ask the user to enter customer name (System.out)
2. Read customer name
3. Ask the user to enter pizza type
4. Read pizza type
5. Ask the user to enter pizza size
6. Read pizza size
7. Ask the user if Senior Y or N
8. Read senior
9. Compute for the total Price
10. Display the Total Price
Total Price
pType==‘A’
typePrice=300
pType==‘B’
typePrice=250
A
if(pType==‘A’)
typePrice=300;
if(pType==‘B’)
typePrice=250;
pType==‘C’
typePrice=175
pSize==1
sizePrice=50
B
if(pType==‘C’)
typePrice=175;
if(pSize==1)
sizePrice=50;
pSize==2
sizePrice=175
pSize==3
sizePrice=250
C
if(pSize==2)
sizePrice=175;
if(pSize==3)
sizePrice=250;
totalAmount = typePrice + sizePrice
senior==‘Y’
||
senior==‘y’
seniorDisc = totalAmount * .20
seniorDisc = 0;
totalAmount = totalAmount - seniorDisc
Print totalAmount
totalAmount=typePrice + sizePrice;
If(senior==‘Y’ || senior==‘y’)
seniorDisc=totalAmount *.20;
else
seniorDisc=0;
seniorDisc=0;
totalAmount=totalAmount-seniorDisc
System.out.println(“Total Amount: “ +
totalAmount);
Data Type Variable Name
String name
char pType
double typePrice
int pSize
double sizePrice
double seniorDisc
char Senior
double totalAmount
Input Process Output
Transaction type (P/S)
Transaction Amount
Location (E/C/M)
Transaction Amount
Commission
Total Amount
Purchase (P) Sale (S)
Commodity Exchange (E) 6.3% 5%
Mercantile Exchange (M) 5.7% 4.2%
New York Cotton Exchange (C) 4.3% 3.7%
Purchase (P) Sale (S)
Commodity Exchange (E) 6.3% 5%
Mercantile Exchange (M) 5.7% 4.2%
New York Cotton
Exchange (C)
4.3% 3.7%
transType==‘P’
location
E M C default
commission=transAmount * .063
commission=transAmount * .057
commission=transAmount * .043
commission=0
A
Commodity Exchange (E) 6.3% 5%
Mercantile Exchange (M) 5.7% 4.2%
New York Cotton Exchange (C) 4.3% 3.7%
transType==‘S’
location
E M C default
commission=transAmount * .05
commission=transAmount * .042
commission=transAmount * .037
commission=0
A
Print “Invalid
Transaction Type”
Data Type Variable Name
double transAmount
double commission
char transType
char location
double totalAmount

Review for Lab 6 and 7Review for Lab 6 and 7.pptx