Source Code
#include<iostream>
using namespace std;
int main(){
string username,password,us,ps,q1,q2;
cout<<"Welcome to our App"<<endl;
cout<<"Please create an account"<<endl;
cout<<"Choose user name"<<endl;
cin>>username;
cout<<"Choose Password"<<endl;
cin>>password;
cout<<"**********"<<endl;
cout<<"Your Account is created"<<endl;
cout<<"please enter your information"<<endl;
cout<<"Enter user name"<<endl;
cin>>us;
cout<<"Enter Password"<<endl;
cin>>ps;
while (username!=us||password!=ps)
{
/* code */
cout<<"You enter wrong information!!!!!!!"<<endl;
cout<<"Please Enter Correct information"<<endl;
cout<<"Enter correct user name"<<endl;
cin>>username;
cout<<"Enter correct Password"<<endl;
cin>>password;
}
cout<<"Welcome to App"<<endl;
double balance=5.00;
cout<<"Would You add money to your balance(yes/no)"<<endl;
cin>>q1;
if (q1=="yes")
{
/* code */
cout<<"Enter how much money do you want to add"<<endl;
double add;
cin>>add;
cout<<"Your current balance is"<<" "<<balance+add<<" $"<<endl;
}
else{
cout<<"Alright!"<<endl;
}
cout<<"Would you like to eat burger today(yes/no)"<<endl;
cin>>q2;
if (q2=="yes")
{
/* code */
cout<<"Please select the burger what you want"<<endl;
string burger_types[]={"beef burger","Wild Salmon Burger","Veggie Burger"};
double price[]={5.00,4.00,3,00};
cout<<"1."<<burger_types[0]<<"--"<<price[0]<<" dollars"<<endl;
cout<<"2."<<burger_types[1]<<"--"<<price[1]<<" dollars"<<endl;
cout<<"3."<<burger_types[2]<<"--"<<price[2]<<" dollars"<<endl;
cout<<"Enter your choice"<<endl;
int q3;
cin>>q3;
switch (q3)
{
case 1:
cout<<"You ordered "<<burger_types[0];
cout<<"\nYour order total is: "<<price[0]<<" dollars"<<endl;
cout<<"\nYour remaining balance is :"<<balance-price[0]<<" dollars"<<endl;
break;
case 2:
cout<<"You ordered "<<burger_types[1];
cout<<"\nYour order total is: "<<price[1]<<" dollars"<<endl;
cout<<"\nYour remaining balance is: "<<balance-price[1]<<" dollars"<<endl;
break;
case 3:
cout<<"You ordered "<<burger_types[2];
cout<<"\nYour order total is: "<<price[2]<<" dollars"<<endl;
cout<<"\nYour remaining balance is: "<<balance-price[2]<<" dollars"<<endl;
break;
default :
cout<"Invalid input Please select correct";
break;
}
}
else{
cout<<"Have a nice day"<<endl;
}
return 0;
}
0 Comments