Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Finals (Main Menu)

C++ Code
#include <iostream>
#include<windows.h> // header file for gotoxy
#include<time.h> //timer
using namespace std;

//*****************global variable
int pm1=0, pm2=0, hh=0, plbk=0, ck=0;
float sum1, sum2, total=0;
//***************** gotoxy
COORD coord= {0,0}; // this is global variable
void gotoxy(int x,int y)
{
coord.X=x;
coord.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
//****************** timer
void delay(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock());
}

//*****************wall design 1 (background)


char corner1 = 178;
void design1()
{
for(int xx=0;xx<100;xx++) {
for(int yy=0;yy<30;yy++) {
gotoxy(xx,yy);cout<<corner1;
delay(0);}}
}

//**************wall design 2 (ihaw sarap deals)


char corner2 = 219;
void design2()
{
for(int xx=2;xx<98;xx++) {
for(int yy=2;yy<7;yy++) {
gotoxy(xx,yy);cout<<corner2;
}

delay(0);}
}
//**************wall design 3 (pm)
char corner3 = 219;
void design3()
{
for(int xx=2;xx<30;xx++) {
for(int yy=8;yy<25;yy++) {
gotoxy(xx,yy);cout<<corner3;
}
delay(0);}
}
//**************wall design 4 (others)
char corner4 = 219;
void design4()
{
for(int xx=35;xx<63;xx++) {
for(int yy=8;yy<25;yy++) {
gotoxy(xx,yy);cout<<corner4;
}
delay(0);}
}
//**************wall design 5 (orders)
char corner5 = 219;
void design5()
{
for(int xx=68;xx<96;xx++) {
for(int yy=8;yy<25;yy++) {
gotoxy(xx,yy);cout<<corner5;
}
delay(0);}
}
//==========================design6
char corner6 = 219;
void design6()
{
for(int xx=5;xx<90;xx++) {
for(int yy=3;yy<10;yy++) {
gotoxy(xx,yy);cout<<corner6;
}
delay(0);}
}

//*****************main menu
int main()
{
int mnum;
design1();
design2();
design3();
design4();
design5();

system("color E");

do {
gotoxy(40,2);cout<<"<<<IHAW SARAP DEALS>>>";//DESIGN2
gotoxy(40,3);cout<<"1. Chicken Inasal";
gotoxy(40,4);cout<<"2. Others";
gotoxy(40,5);cout<<"3. DONE!";
gotoxy(40,6);cout<<"Enter a Number: [ ]";
gotoxy(57,6);cin>>mnum;

//system("cls")
switch(mnum)
{
//==============design3
case (1):
gotoxy(6,9);cout<<"[CHICKEN INASAL]";
gotoxy(6,11);cout<<"*Number of Order*";
gotoxy(3,13);cout<<"PM1 Chicken Inasal-P130.00";
gotoxy(3,14);cout<<"+1 Rice:[ ]";
gotoxy(3,16);cout<<"PM2 Chicken Inasal-P160.00";
gotoxy(3,17);cout<<"+Unli Rice:[ ]";
gotoxy(12,14);cin>>pm1;
gotoxy(15,17);cin>>pm2;
gotoxy(76,9);cout<<"**Your Orders**";
gotoxy(69,11);cout<<"Chicken Inasal";
gotoxy(69,12);cout<<"CHCKN INSL +1R: ";
gotoxy(69,13);cout<<"CHKN INSL UL: ";
gotoxy(90,12);cout<<"["<<pm1<<"]";
gotoxy(90,13);cout<<"["<<pm2<<"]";
sum1 =(pm1*130)+(pm2*160);
gotoxy(90,14);cout<<"[P"<<sum1<<"]";
break;

case (2):
//=======================================design4
gotoxy(43,9);cout<<"[Others]";
gotoxy(39,11);cout<<"*Number of Orders*";
gotoxy(37,13);cout<<"Halo-halo-P40.00:[ ]";
gotoxy(37,15);cout<<"Palabok-P130.00:[ ]";
gotoxy(37,17);cout<<"Coke-P25.00:[ ]";
gotoxy(55,13);cin>>hh;
gotoxy(54,15);cin>>plbk;
gotoxy(50,17);cin>>ck;
gotoxy(76,9);cout<<"**Your Orders**";
gotoxy(69,16);cout<<"Halo-Halo: ";
gotoxy(69,17);cout<<"Palabok: ";
gotoxy(69,18);cout<<"COKE: ";
gotoxy(90,16);cout<<"["<<hh<<"]";
gotoxy(90,17);cout<<"["<<plbk<<"]";
gotoxy(90,18);cout<<"["<<ck<<"]";
sum2 =(hh*40)+(plbk*130)+(ck*25);
gotoxy(90,19);cout<<"[P"<<sum2<<"]";
break;

case(3):
design1();
design6();
gotoxy(35,5);cout<<"Thank you and Come again!";
exit(1);
system("cls");

}
total =(sum1+sum2);
gotoxy(69,22);cout<<"Total:[P ] ";
gotoxy(78,22);cout<<total;
} while (1);
system("cls");
return 0;
}
Computer
Programming 1
Finals (Main Menu)
(C++ codes and Screenshots)

MEJES, LESTER F.
BIT CET II
January 19, 2022
Computer
Programming 1
Finals – Main Menu
(C++ codes and Screenshots)

YOPYOP, ANNA MADEL


BIT CET II
January 19, 2022
Computer
Programming
1
Finals (Main Menu)
(C++ codes and Screenshots)

DAYANGHIRANG, HERMAN L.
BIT CET II
January 19, 2022

You might also like