Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is instructuon. I made my own coding, but it is not working. I don\'t know

ID: 3801663 • Letter: T

Question

This is instructuon.

I made my own coding, but it is not working. I don't know how to code about this one... please help me.

Fuzzy Dice

Chapters 4,5:   Loops, Conditional Statements

Write a program that will allow the user to buy Fuzzy Dice, Mardi Gras beads and/or Bobble Heads from your store and display the total due.  

Follow the sample code and place your name as the owner of DecoCar.

Using a menu, your program should ask the user what item he/she wants to purchase. If the user indicates an item that your store does not sell, an error message should display telling the user that you do not sell that item.  

If the user indicates fuzzy dice, Mardi Gras beads, or bobble heads, ask the user how many of the item he/she wants to buy. Make sure that the input is a positive number before proceeding.  

Calculate and display the subtotal to the user. The prices for the items are as follow:

Fuzzy Dice are $6.25 each.

Mardi Gras beads are $2.25 per pack, unless the user enters the coupon code “beads1”. If the user enters the correct code, beads are $1.50 per pack.

Bobble heads: 1-5: $16.99 each      6-10:$14.99 each     11 or more: $12.99 each

This process of allowing the user to select an item and your program displaying the subtotal should continue until the user selects to exit when prompted for the item he/she wants to purchase. Your program should then display the total amount due

.

hielcome to DecoC P Severn, owner Our inventory: 1. Fuzzy Dice Mardi Gras Beads 3. Bobble Heads R. Exit Please make a selection 1 How many Fuzzy Dice would you like to buy? 2 The subtotal for the fuzzy dice: $12.50 our inventory 1. Fuzzy Dice 2. Mardi Gras Beads 3. Bobble Heads Exit lease make a selection: 2 How many sets of Mardi Gras beads would you like to buy? 3 Please type in a coupon code or NONE NONE The subtotal for the beads(s): $6.75 Our inventory: 1. Fuzzy Dice 2. Mardi Gras Beads 3. Bobble Heads Exit lease make a selection: 3 How many bobble heads would you like to buy? 3 The subtotal for the bobble heads (s) $50.97 our inventory: 1- Fuzzy Dice 2. Mardi Gras Beads 3. Bobble Heads 4. Exit lease make a selection 4 Thank you for ordering from Decocar Your total is: $70.22 Press any key to continue

Explanation / Answer

#include <iostream>
using namespace std;

int main() {
int opt,num;
float f=6.25,b1=16.99,b2=14.99,b3=12.99,m=2.25,total=0;
   cout<<" Welcome to DecoCar ";
   cout<<" P Severn, Owner ";
   cout<<"Our inventory: 1. Fuzzy Dice 2. Mardi Gras Beads 3. Bobble Heads 4. Exit ";
   cout<<"Please make a selection: ";
   cin>>opt;
if (opt ==1){
while(1){
cout<<"How many Fuzzy Dice would you like to buy?";
   cin>>num;
   if(num>0)
   break;
}
cout<<"The subtotal for Fuzzy Dice is: $"<<num*f;
total = total+num*f;
}
else if (opt==2){
while(1){
cout<<"How many sets of Mardi Grass Beads would you like to buy?";
   cin>>num;
   if(num>0)
   break;
}
cout<<"Please type in a coupon code or NONE";
  
}
   case 2:break;
   case 3:break;
   case 4:break;
   default:
   }
   return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote