Question IT 483 C# - Lab Exercise 02 Due: In Lab Main topics: Boolean expressions If statements If-else statements While loops Exercise This lab is designed to give you more practice using if-else statements, nested if statements, and an introduction to the while loop Getting Started To start this exercise, you should 1. Open Visual Studio and start a new C# project IT 483 C# - Lab Exercise 02 Due: In Lab Main topics: Boolean expressions If statements If-else statements While loops Exercise This lab is designed to give you more practice using if-else statements, nested if statements, and an introduction to the while loop Getting Started To start this exercise, you should 1. Open Visual Studio and start a new C# project named Lab02 Problem Description For this lab you are to write as complete C# program to run a simple cash register for a eye glass store. A customer can buy either a pair of single prescription glasses (at a cost of $40.00), or a pair of non-prescription sunglasses (at a cost of $25.00). On each pair of single prescription glasses the customer must choose either an anti-glare coating (at a cost of $12.50) or a brown tint coating (at a cost of $9.99) Requirements At each point where the user is being presented with an option You must display a simple menu with menu options and then repeatedly get the user's menu option until a "valid" option is entered The valid menu option is then used to guide the program's logic from that point. Sample Run What kind of glasses would you like: 1 -> prescription, 2 -> non-prescription: 0 1 prescription, 2 -> non-prescription : 3 1 - prescription, 2 -> non-prescript ion: 1 What kind of coating would you like: 1 -> anti-glare, 2 -> brown tint 1 -anti-glare, 2 -> brown tint: 3 1-anti-glare, 2 -> brown tint: 1 0 Your total cost is $52.5 Once you have written your program: 1. Make sure that your programs compile and run without errors or warnings 2. Run your program enough times to check all the choices for correctness

EZLUCO The Asker · Computer Science

Transcribed Image Text: IT 483 C# - Lab Exercise 02 Due: In Lab Main topics: Boolean expressions If statements If-else statements While loops Exercise This lab is designed to give you more practice using if-else statements, nested if statements, and an introduction to the while loop Getting Started To start this exercise, you should 1. Open Visual Studio and start a new C# project named Lab02 Problem Description For this lab you are to write as complete C# program to run a simple cash register for a eye glass store. A customer can buy either a pair of single prescription glasses (at a cost of $40.00), or a pair of non-prescription sunglasses (at a cost of $25.00). On each pair of single prescription glasses the customer must choose either an anti-glare coating (at a cost of $12.50) or a brown tint coating (at a cost of $9.99) Requirements At each point where the user is being presented with an option You must display a simple menu with menu options and then repeatedly get the user's menu option until a "valid" option is entered The valid menu option is then used to guide the program's logic from that point. Sample Run What kind of glasses would you like: 1 -> prescription, 2 -> non-prescription: 0 1 prescription, 2 -> non-prescription : 3 1 - prescription, 2 -> non-prescript ion: 1 What kind of coating would you like: 1 -> anti-glare, 2 -> brown tint 1 -anti-glare, 2 -> brown tint: 3 1-anti-glare, 2 -> brown tint: 1 0 Your total cost is $52.5 Once you have written your program: 1. Make sure that your programs compile and run without errors or warnings 2. Run your program enough times to check all the choices for correctness
More
Transcribed Image Text: IT 483 C# - Lab Exercise 02 Due: In Lab Main topics: Boolean expressions If statements If-else statements While loops Exercise This lab is designed to give you more practice using if-else statements, nested if statements, and an introduction to the while loop Getting Started To start this exercise, you should 1. Open Visual Studio and start a new C# project named Lab02 Problem Description For this lab you are to write as complete C# program to run a simple cash register for a eye glass store. A customer can buy either a pair of single prescription glasses (at a cost of $40.00), or a pair of non-prescription sunglasses (at a cost of $25.00). On each pair of single prescription glasses the customer must choose either an anti-glare coating (at a cost of $12.50) or a brown tint coating (at a cost of $9.99) Requirements At each point where the user is being presented with an option You must display a simple menu with menu options and then repeatedly get the user's menu option until a "valid" option is entered The valid menu option is then used to guide the program's logic from that point. Sample Run What kind of glasses would you like: 1 -> prescription, 2 -> non-prescription: 0 1 prescription, 2 -> non-prescription : 3 1 - prescription, 2 -> non-prescript ion: 1 What kind of coating would you like: 1 -> anti-glare, 2 -> brown tint 1 -anti-glare, 2 -> brown tint: 3 1-anti-glare, 2 -> brown tint: 1 0 Your total cost is $52.5 Once you have written your program: 1. Make sure that your programs compile and run without errors or warnings 2. Run your program enough times to check all the choices for correctness
Community Answer
AD8Q1G

Code: #include<iostream>  // header files using namespace std; int main(){  // main function     int choice1,choice2,num,ch1,ch2; // variables to store choice      while(1){ // to display menu again and again         float cost=0; // to store total cost         cout<<endl;         cout<<"------Welcome to EYE GLASS store------"<<endl;         cout<<endl;         cout<<"1.Prescription glass  price=$40"<<endl;         cout<<"2.Non-Prescription sunglass price=$25"<<endl;         cout<<"enter your choice:"<<endl;         cin>>choice1;  // to take user choice         cout<<"No of pieces:"<<endl;         cin>>ch1;  // to take no of pieces         if(choice1==1){  // if choice 1             cost=cost+(ch1*40);                 cout<<"1.Anti-glare coating price=$12.50"<<endl;                 cout<<"2.Brown tint coating price=$9.99"<<endl;                 cout<<"enter your choice:"<<endl;                 cin>>choice2;  // asking for type of glasses                 if(choice2==1){ // if 1                     cost=cost+12.50;                     cout<<"total cost:"<<cost<<endl;                 }                 if(choice2==2){ // if 2      &#160 ... See the full answer