Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PROCESS
total=total + student;
Gtotal= Gtotal + calcPayment(code, unicode, student);
OUTPUT: Day
University
Number Of Person
Payment
Total number of registered people
Grandtotal
Display welcome
using namespace std;
#include<iostream>
void dispWelcome();
void inputData(char &code,char &unicode,int &student);
float calcPayment(char code,char unicode,int student);
void displayReceipt(char code,char unicode,int student,float payment);
int main()
{
char code,unicode;
string Weekday,Weekend;
float payment, Gtotal;
int student, total=0;
char answer='Y';
while(toupper(answer)!='N')
{
dispWelcome();
inputData(code,unicode,student);
payment=calcPayment(code,unicode,student);
displayReceipt(code,unicode,student,payment);
total=total + student;
Gtotal= Gtotal + calcPayment(code, unicode, student);
cout<<endl;
cout<<"\nTotal number of registered people is "<<total<<endl;
cout<<"\nGrand total payment RM "<<Gtotal;
return 0;
}
void dispWelcome()
{
cout<<"\n Welcome to SPSS Workshop Payment System";
cout<<"\n______________________________________________";
}
void inputData(char &code,char &unicode,int &student)
{
cout<<"\n Enter The Day Code (D=Weekday or E=Weekend): ";
cin>>code;
cout<<"\n Enter The University Code (U=UiTM or O=Other Universities): ";
cin>>unicode;
if(code=='D')
day="Weekday";
else
day="Weekend";
if(unicode=='U')
university="UiTM";
else
university="Other university";