Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
HalumResto
//g++ 7.4.0 ////////////////////////////////////////////////////////////////////////////// //HalumResto:Upgraded Stream9 //this code is created by Rezaul Hoque on August 03,2022; //contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; ////////////////////////////////////////////////////////////////////////////// #include <fstream> #include <iostream> #include <iomanip> #include <string> #include <strstream> //stream manipulator std::ostream& l(std::ostream& os) { return (os<<"\n"); } namespace Pat { void fill(char c) { std::cout.width(40); std::cout.fill(c); std::cout<<l; } void left(int n,char c){ std::cout.setf(std::ios::left); std::cout.fill(c); std::cout.width(n); } void right(int n,char c){ std::cout.setf(std::ios::right); std::cout.fill(c); std::cout.width(n); } } namespace Carte{ void lunch() { int a=10,b=10,c=10,d=40; Pat::fill('*'); Pat::left(25,' '); std::cout<<"\tMenu"<<"Price"<<l; Pat::left(25,'.'); std::cout<<"\tRice(1½ plates)"<<"Tk"<<a*1.5<<l; Pat::left(25,'.'); std::cout<<"\tLentil Soup(1 cup)"<<"Tk"<<c*1<<l; Pat::left(25,'.'); std::cout<<"\tMalabar Spinach(1 plate)"<<"Tk"<<b*1<<l; Pat::left(25,'.'); std::cout<<"\tRita fish(1 plate)"<<"Tk"<<d*1<<l; Pat::right(25,' '); std::cout<<"\tTotal "<<"Tk"<<(a*1.5+b*1+c*1+d*1)<<l; Pat::fill('*'); } void dinner() { int a=10,b=20,c=40; Pat::fill('*'); Pat::left(25,' '); std::cout<<"\tMenu"<<"Price"<<l; Pat::left(25,'.'); std::cout<<"\tNaan(2 pieces)"<<"TK "<<a*2<<l; Pat::left(25,'.'); std::cout<<"\tLabra(1 plate)"<<"TK "<<b*1<<l; Pat::left(25,'.'); std::cout<<"\tDal Makhani(1 plate)"<<"TK "<<c*1<<l; Pat::left(25,' '); std::cout<<"\tTotal "<<"TK "<<(a*2+b*1+c*1)<<l; Pat::fill('*'); } void breakfast() { int a=5,b=50,c=15; Pat::fill('*'); Pat::left(25,' '); std::cout<<"\tMenu"<<"Price"<<l; Pat::left(25,'.'); std::cout<<"\tRoti(3 pieces)"<<"TK "<<a*3<<l; Pat::left(25,'.'); std::cout<<"\tChicken soup(1 cup)"<<"TK "<<b*1<<l; Pat::left(25,'.'); std::cout<<"\tMalai Tea(1 cup)"<<"TK "<<c*1<<l; Pat::right(25,' '); std::cout<<"\tTotal "<<" TK "<<(a*3+b*1+c*1)<<l; Pat::fill('*'); } void Menu(int dineTime,int loc ){ static std::stringbuf buf; static std::ostream o(&buf); o<<" Welcome to ***Halum Resto***"<<l; if(loc==1) o<<"Please note,TK 10 transport charge will be added for food delivery in Mirpur."<<l; else if(loc==2) o<<"Please note,TK 50 transport charge will be added for food delivery in Uttara."<<l; else if(loc==3) o<<"Please note,TK 50 transport charge will be added for food delivery in Banani and Gulshan."<<l; else if(loc==4) o<<"Please note,TK 100 transport charge will be added for food delivery in Puran Dhaka."<<l; else o<<"Sorry,our service is not available there at the moment."<<l; std::cout<<buf.str()<<l; if(dineTime==1) Carte::breakfast(); else if(dineTime==2) Carte::lunch(); else if(dineTime==3) Carte::dinner(); else std::cout<<"Sorry,no other menu available! "<<l; } } int main() { Pat::fill('&'); Carte::Menu( 3,4); Pat::fill('&'); return 0; }
run
|
edit
|
history
|
help
0
kickstartd
UsingAlgorithm
g++ -Wall *.cpp -o aco; ./aco.
string match
parallel_for_each
Eratosfen final
cppPyAbs
segmented sieve
11
good triplet