29 428
Assignments Done
97,9%
Successfully Done
In September 2015
Your physics homework can be a real challenge, and the due date can be really close - feel free to use our assistance and get the desired result.
Be sure that math assignments completed by our experts will be error-free and done according to your instructions specified in the submitted order form.

# Answer on C++ Question for Vineeth Abraham Shaji

Question #4232
Write aprogram in c++ to print hotel bill.The input will be given by the hotel staffs.They will be given option to choose the menu and price will be shown automaticall.The hotel bill will show the item's name,Its quantity and its price along with hotels name and also that days date.
Plz use only the following function as we learned till there..the functions are if else,all loops and also switch statement.the exit function can also be used and all other basic functions can be used...

// Hotel bill.cpp : Defines the entry point for the console application.
//

#include &quot;stdafx.h&quot;
#include &quot;iostream&quot;
#include &quot;conio.h&quot;
#include&lt;time.h&gt;

using namespace std;

int count=-1;
struct Dish{
char* name;
int quantity;
double price;
};
Dish dishes[1000];
void Close(){
exit(0);
}

do{
& cout &lt;&lt;&quot;Select the item:\n&quot;;
& cout&lt;&lt;&quot;1 - Pesto pizza& & 8.5$\n&quot;; & cout&lt;&lt;&quot;2 - CLASSIC BRUSCHETTA 9.5$\n&quot;;
& cout&lt;&lt;&quot;3 - PEPPER KANGARO& 19.5$\n&quot;; & cout&lt;&lt;&quot;4 - THE ROCKS CAESAR& & 15$\n&quot;;
& cout&lt;&lt;&quot;5 - SALT WATER CROCODILE& 19.5$\n&quot;; & cout&lt;&lt;&quot;6 - CRISPY BACON& & 16.5$\n&quot;;
& cout&lt;&lt;&quot;7 - TANDOORI CHICKEN& 17.5$\n&quot;; & cout&lt;&lt;&quot;8 - Smoked Salami 16.5$\n&quot;;
& cout&lt;&lt;&quot;9 - POTATO WEDGES& 8.5$\n&quot;; & cout&lt;&lt;&quot;10 - Exit from menu\n&quot;; & cin&gt;&gt;menuitem; & count++; switch(menuitem){ & case 1: & dishes[1].name =&quot;Pesto pizza&quot;; & dishes[1].price =8.5; & dishes[1].quantity ++; & includemenu[count]=1; & & break; & case 2: & dishes[2].name =&quot;CLASSIC BRUSCHETTA&quot;; & dishes[2].price =9.5; & dishes[2].quantity ++; & includemenu[count]=2; & break; & case 3: & dishes[3].name =&quot;PEPPER KANGARO&quot;; & dishes[3].price =19.5; & dishes[3].quantity ++; & includemenu[count]=3; & break; & case 4: & dishes[4].name =&quot;THE ROCKS CAESAR&quot;; & dishes[4].price =15; & dishes[4].quantity ++; & includemenu[count]=4; & break; & case 5: & dishes[5].name =&quot;SALT WATER CROCODILE&quot;; & dishes[5].price =19.5; & dishes[5].quantity ++; & includemenu[count]=5; & break; & case 6: & dishes[6].name =&quot;CRISPY BACON&quot;; & dishes[6].price =19.5; & dishes[6].quantity ++; & includemenu[count]=6; & break; & case 7: & dishes[7].name =&quot;TANDOORI CHICKEN&quot;; & dishes[7].price =19.5; & dishes[7].quantity ++; & includemenu[count]=7; & break; & case 8: & dishes[8].name =&quot;Smoked Salami&quot;; & dishes[8].price =19.5; & dishes[8].quantity ++; & includemenu[count]=8; & break; & case 9: & dishes[9].name =&quot;POTATO WEDGES&quot;; & dishes[9].price =19.5; & dishes[9].quantity ++; & includemenu[count]=9; & break; } } while(menuitem!=10); } void showhotelbill(){ char date[9]; _strdate(date); cout&lt;&lt;&quot;Item&#039;s name Quantity & Price Hotel Name & Date\n&quot;; for(int i=0;i&lt;count;i++ ){ cout&lt;&lt;dishes[includemenu[i]].name&lt;&lt;&quot; quot;&lt;&lt;dishes[includemenu[i]].quantity&lt;&lt;&quot; quot;&lt;&lt;dishes[includemenu[i]].price&lt;&lt;&quot;$ Hotel name & quot;&lt;&lt;&quot; & quot;&lt;&lt;date&lt;&lt;&quot;\n&quot;;
}
}

int _tmain(int argc, _TCHAR* argv[])
{
int k=0;
do{
& cout &lt;&lt;&quot;Select a option:\n&quot;;
& cout&lt;&lt;&quot;2- Print hotel bill\n&quot;;
& cout&lt;&lt;&quot;3- Exit\n&quot;;
& cin&gt;&gt;k;
& switch(k){
& case 1:
& & break;
& case 2:
& showhotelbill();
& break;
& case 3:
& Close();
& break;
& }
}
while(k!=3);
getch();
return 0;
}