0% found this document useful (0 votes)
145 views4 pages

#Include #Include Using Namespace Char Char Char Char Char Char Int Float Float Int

This C++ program allows a user to input customer information like name, address, and phone number. It then displays a product catalog that the user can select items from by entering a product code and quantity. The program calculates subtotals and totals for the order and allows the user to confirm or cancel the order. It provides a simulated shopping cart, checkout, and purchase confirmation experience in a simple text-based interface.

Uploaded by

nica rose
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views4 pages

#Include #Include Using Namespace Char Char Char Char Char Char Int Float Float Int

This C++ program allows a user to input customer information like name, address, and phone number. It then displays a product catalog that the user can select items from by entering a product code and quantity. The program calculates subtotals and totals for the order and allows the user to confirm or cancel the order. It provides a simulated shopping cart, checkout, and purchase confirmation experience in a simple text-based interface.

Uploaded by

nica rose
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

#include <iostream>

#include <conio.h>
using namespace std;

char Fname[100]={};
char Lname [100]={};
char mobile [100]={};
char state[100]={};
char town[100]={};
char brgy [100]={};
int pc, n, pr;
float a=0,b=0,c=0,d=0;
float pra, prb, prc, prd;

int main ()
{
//LALAGYAN NG MATINONG FRONT PAGE!!!

cout<<"\t8888 888 8888"<<"\t888888\t"<<"8888


\t"<<"888888\t"<<"8888888\t"<<"8888 8888"<<"\t888888\t"<<"88"<<endl;
cout<<"\t8888 888 8888"<<"\t88 \t"<<"8888 \t"<<"88 \t"<<"88
88\t"<<"88888 88888"<<"\t88 \t"<<"88"<<endl;
cout<<"\t8888 888 8888"<<"\t888888\t"<<"8888 \t"<<"88 \t"<<"88
88\t"<<"88888 88888"<<"\t888888\t"<<"88"<<endl;
cout<<"\t8888 888 8888"<<"\t88 \t"<<"8888 \t"<<"88 \t"<<"88
88\t"<<"888 888 888"<<"\t88 \t"<<endl;
cout<<"\t 8888 88888
"<<"\t888888\t"<<"8888888\t"<<"888888\t"<<"8888888\t"<<"888 888
888"<<"\t888888\t"<<"88"<<endl;
getch ();
A:
system ("cls");
cout<<"\n-------------------------------------------------------------
";
cout<<"\n\t\t\tCostumer Information: ";
cout<<"\n-------------------------------------------------------------
";

//Costumer Details

cout<<"\n\nFirst name: ";


cin>>Fname;
cout<<"Last name: ";
cin>>Lname;
cout<<"Mobile Phone number: ";
cin>>mobile;
cout<<"State/Region: ";
cin>>state;
cout<<"Town/City: ";
cin>>town;
cout<<"Barangay: ";
cin>>brgy;

cout<<"\n\nPress any key to continue.";


getch ();

system ("cls");
cout<<"\n-------------------------------------------------------------
";
cout<<"\n\t\t\tBILLING ADRESS: ";
cout<<"\n-------------------------------------------------------------
";
cout<<"\n\n"<<Lname<<", "<<Fname;
cout<<"\n"<<brgy<<", "<<town<<", "<<state;
cout<<"\n"<<mobile;

cout<<"\n\n\nEdit?";
cout<<"\n [1] YES";
cout<<"\n [2] NO.Proceed to catalog";
cout<<"\n [3] EXIT";
int x;
cout<<endl;
cin>>x;

if (x==1)
{
system ("cls");
goto A;
}
else if (x==2)//catalog
{
B:
system ("cls");
cout<<"----------------------------------------------------------
-----------"<<endl;
cout<<" CATALOG
"<<endl<<endl;
cout<<"----------------------------------------------------------
-----------"<<endl;
cout<<"\tPRODUCT CODE: PRODUCT PRICE"<<endl;
cout<<"\t0 yyy Php 19.00"<<endl;
cout<<"\t1 www Php 10.00"<<endl;
cout<<"\t2 yyy Php 15.00"<<endl;
cout<<"\t3 zzz Php 20.00"<<endl;
cout<<"----------------------------------------------------------
-----------"<<endl;

cout<<"\n\n\tEnter product code: ";


cin>>pc;

if (pc == 0 || pc == 1 || pc ==2 || pc == 3)
{
cout<<"\tQuantity: ";
cin>>n;
C:
switch (pc)
{
case 0:
a = (a+1)*n;
pra = a*19;
break;
case 1:
b = (b+1)*n;
prb = b*20;
break;

case 2:
c = (c+1) *n;
prc = c*15;
break;

case 3:
d = (d+1) *n;
prd = d *10;
break;

default:
cout<<"You have entered an invalid code.\n";
cout<<"Try again?";
cout<<"\n[1] YES";
cout<<"\n[2] TERMINATE TRANSACTION.\n";
int q;
cin>>q;

if (q==1)
{
system ("cls");
goto B;
}
else
{
system ("cls");
cout<<"Thank you for visiting our shop!";
getch ();
return 0;
}
}
}
}
D:
cout<<"\n\n\t*****Item succesfully added to you
bag!******";
cout<<"\n\nContinue shopping?";
cout<<"\n\n[1] YES";
cout<<"\n[2] TERMINATE TRANSACTION.";
cout<<"\n[3] CHECKOUT\n";

int w;
cin>>w;
if (w==1)
{
system ("cls");
goto B;
}

else if (w==2)
{
system ("cls");
cout<<"Thank you for visiting our shop!";
getch ();
return 0;
}
else
{
goto CHECKOUT;
}

CHECKOUT:
system ("cls");
cout<<"----------------------------------------------
---------------";
cout<<"\t\t\t\t\nPURCHASED ITEMS: ";
cout<<"\n--------------------------------------------
-----------------";
cout<<"\n\nItem:\t\t\t Quantity:\t\t\t Price:";
if (a!=0)
{
cout<<"\nyyy\t\t\t"<<a<<"\t\t\t\t\t"<<pra;
}
if (b!=0)
{
cout<<"\nwww\t\t\t"<<b<<"\t\t\t\t\t"<<prb;
}
if (c!=0)
{
cout<<"\nyyy\t\t\t"<<c<<"\t\t\t\t\t"<<prc;
}
if (d!=0)
{
cout<<"\nzzz\t\t\t"<<d<<"\t\t\t\t\t"<<prd;
}

float sub=pra+prb+prc+prd;
cout<<"\n\n\tSUBTOTAL: \t"<<sub;
cout<<"\tShipping cost: \t Php 50.00";
cout<<"\n--------------------------------------------
-----------------";
cout<<"\n\t\t\t\nTOTAL AMOUNT: \t"<<"Php "<<sub+50;
cout<<"\n--------------------------------------------
-----------------";

cout<<"\n\n [1] CONTINUE";


cout<<"\n\n [2] CANCEL ORDER\n";

int e;
cin>>e;

if (e==1)
{
goto E;
}
else
{
system ("cls");
cout<<"Thank you for visiting our shop!";
getch ();
return 0;
}
E:
system ("cls");
cout<<"----------------------------------------------
---------------";
cout<<"\n\t\t\tUSER'S SHIPPING ADDRESS: ";
cout<<"\n--------------------------------------------
-----------------";
cout<<"\n\n"<<Lname<<", "<<Fname;
cout<<"\n"<<brgy<<", "<<town<<", "<<state;
cout<<"\n"<<mobile;

cout<<"\n\nNOTE: WE ONLY ACCEPT CASH ON DELIVERY AS


MODE OF PAYMENT.";

cout<<"\n\n [1] CONFIRM ORDER";


cout<<"\n[2] CANCEL ORDER\n";

int r;
cin>>r;

if (r==1)
{
system ("cls");
cout<<"\n--------------------------------------
-----------------------";
cout<<"\n\t\tYour order will be delivered
within 3-5 working days.";
cout<<"\t\t\nThank you for shopping!";
cout<<"\n--------------------------------------
-----------------------";
getch ();
return 0;
}
else
{
system ("cls");
cout<<"\n--------------------------------------
-----------------------";
cout<<"\t\t\t\t\n\nThank you for visiting our
shop!";
cout<<"\n--------------------------------------
-----------------------";
getch ();
}

getch ();
return 0;
}

You might also like