1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
#include <iostream>
#include <windows.h>
#include <cstdlib>
#include <string>
#include <fstream>
using namespace std;
void welcome ()
{
cout << string(79,'=') << endl;
cout << "|" << string (77,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl;
cout << "|" << string (14,' ') << "* * * **** * ***** ****** ********* ****" << string (15,' ') << "|" << endl;
cout << "|" << string (14,' ') << "* * * * * * * * * * * * " << string (15,' ') << "|" << endl;
cout << "|" << string (14,' ') << "* * * **** * * * * * * * ****" << string (15,' ') << "|" << endl;
cout << "|" << string (14,' ') << "* * * * * * * * * * * * " << string (15,' ') << "|" << endl;
cout << "|" << string (14,' ') << "********* **** ***** ***** ****** * * * ****" << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " ) ( ) " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " ) (_) ( (_) ) (_) ( " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " (_) # ) (_) ) # ( (_) ( # (_) " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " _#.-#(_)-#-(_)#(_)-#-(_)#-.#_ " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " .' # # # # # # # # # # # `. " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " : # # # # # # # # : " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " | `-.__ __.-' | " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " | `````-----------````` | " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " | NG'S AND AMIR | " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " | BAKERY SHOP | " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " | WE SPECIALIZE | " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " _.-| IN BAKING |-._ " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " .' '. CAKES! .' `. " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " : `-.__ __.-' : " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " `. `````-----------````` .' " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " `-.._ _..-' " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl << " `````````-----------````````` " << string (15,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl;
cout << "|" << string (77,' ') << "|" << endl;
cout << string(79,'=') << endl;
}
void cakeType ()
{
int id;
cout << "Cake ID Flavor" << endl;
cout << "0101: Chocolate" << endl;
cout << "0102: White chocolate" << endl;
cout << "0103: Vallina" << endl;
cout << "0104: Peanut butter" << endl;
cout << "0105: Coconut" << endl;
cout << "0106: Italian creme" << endl;
cout << "0107: Raspberry" << endl;
cout << "0108: Banana" << endl;
cout << "0109: Lemon" << endl;
cout << "0110: Apple" << endl;
cout << "Enter the cake id :";
cin >> id;
}
void menuExit ()
{
exit (1);
}
void summary ()
{
int ii;
string name2;
double volume2, price2;
ifstream myfile;
myfile.open ("test1.txt");
while(myfile >> ii >> name2 >> volume2 >> price2)
{
cout << ii++ << "." << name2 << "-----" << volume2 << "-----" << price2 << endl;
}
myfile.close();
}
int main ()
{
int i = 1;
char option;
string name;
const float pi = 3.141593;
const float inch = 0.25;
double price, height, diameter, radius, volume;
welcome ();
do{
cout << string(34,' ') << "Nu1.Bakery" <<string(35,' ') << endl;
cout << "1.New Order" << endl;
cout << "2.Cakes Types" << endl;
cout << "3.Order Summary" << endl;
cout << "4.Exit" << endl;
cout << "Please choose the option :";
cin >> option;
switch (option)
{
case '1':
{
cout << "Enter your name:";
getline(cin,name);
cout << "Enter the diameter:";
cin >> diameter;
cout << "Enter the height:";
cin >> height;
radius = diameter / 2;
volume = radius * height * pi * 2;
price = volume * inch;
cout << "Price is:" << price << endl;
ofstream myfile;
myfile.open("test1.txt", ofstream::out | ofstream::app);
myfile << i++ << " ";
myfile << name << " ";
myfile << volume << " ";
myfile << price << endl;
myfile.close ();
}
break;
case '2':
{
cakeType ();
}
break;
case '3':
{
summary ();
}
break;
case '4':
{
menuExit ();
}
break;
default :
cout << "invalid\n";
}
}while (option > 1 || option <4);
return 0;
}
|