Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5K views

Cashier Program C++

This C++ program is a simple cashier machine program that calculates the total price of items purchased, allows the customer to make a payment, and calculates the balance. It displays the current date and time using built-in functions, prompts the user to input the price of each item, calculates a running total, displays the total price and prompts for payment, then displays the balance and thanks the customer. It offers the option to serve another customer or end the program.

Uploaded by

gewleon
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5K views

Cashier Program C++

This C++ program is a simple cashier machine program that calculates the total price of items purchased, allows the customer to make a payment, and calculates the balance. It displays the current date and time using built-in functions, prompts the user to input the price of each item, calculates a running total, displays the total price and prompts for payment, then displays the balance and thanks the customer. It offers the option to serve another customer or end the program.

Uploaded by

gewleon
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<iostream.

h>
#include<time.h>
//simple chasier mechine program
main()
{
cout<<"press(0) to calculate total price\n";
q:
float price,total,payment,balance,quantity;
char date [9];
char time [9];
_strdate(date);
_strtime(time);
cout<<"The current date is "<<date<<endl;
cout<<"The current time is "<<time<<endl;
cout<<"\t .................................\n";
cout<<".........................................................\n";
cout<<":\t\tWelcome to Super Market\t\t\t:\n";
cout<<".........................................................\n";
cout<<"\t .................................\n";
quantity=0;
total =0;
do{
quantity=quantity+1;
cout<<"\t\tPrice for"<<quantity<<"item is : RM";
cin>>price;
total = total+price;}
while(price!=0);
cout<<"\t\tTotal Price\n"<<"\t_________________________________________\n";
cout<<"\t\t\tRM"<<total<<endl;
cout<<"\t_________________________________________"<<endl;
cout<<"\t\tCustomer payment RM";
cin>>payment;
balance=payment-total;
cout<<"\t\tBalance = RM"<<balance<<endl;
cout<<"\t\t\t~THANK YOU~"<<endl;
char y;
cout<<"Would you like to serve for the next customer?(y/n)";
cin>>y;
if (y == 'y'||y=='1')
{cout<<"*************************************************************\n"
;
cout<<"*************************************************************\n";
cout<<""<<endl;
goto q;}
else
{cout<<"\t\t**********************\n";
cout<<"\t\t* well done ^_^ *\n";
cout<<"\t\t*take a good rest ya~*\n";
cout<<"\t\t**********************"<<endl;
return 0;}
}

You might also like