csc126 Report
csc126 Report
COMPLETE PROGRAM
#include <iostream>
float discount(int,float);
int main()
{
int quantity, price;
float totalprice;
string name, address, phoneNum, payType;
cout << "WELCOME TO KYOBROTHERS FOOD DELIVERY .CO" << endl; //introduction
cout<< endl << "PLEASE ENTER YOUR DETAILS" << endl; //user put their information
cout<< endl<< "NAME : ";
cout << endl << "PLEASE CHOOSE THE RESTAURANT" << endl; //user choose their restaurant
cout << endl << "1 - WCD";
cout << endl << "SET A = DOUBLE CHEESE BURGER + COKE" << endl;
cout << "SET B = DOUBLE CHEESE BURGER + FRIES + COKE" << endl;
cout << "SET C = DOUBLE CHEESE BURGER + FRIES + COKE + SUNDAE RAINBOW" << endl;
{
cout << "DOUBLE CHEESE BURGER + COKE - RM 8" << endl;
price = 8;
cout << "DOUBLE CHEESE BURGER + FRIES + COKE - RM 10" << endl;
price = 10;
cout << "DOUBLE CHEESE BURGER + FRIES + COKE + SUNDAE RAINBOW - RM 12" << endl;
price = 12;
totalprice = totalprice + price;
else
{
cout << "PLEASE CHOOSE CORRECT MENU" << endl;
}
}
cout << "SET B = 2PCS FRIED CHICKEN + RICE + PEPSI" << endl;
cout << "SET C = 3PCS FRIED CHICKEN + RICE + PEPSI" << endl;
cout << "2PCS FRIED CHICKEN + RICE + PEPSI - RM 9" << endl;
price = 9;
{
cout << "3PCS FRIED CHICKEN + RICE + PEPSI - RM 13" << endl;
price = 13;
totalprice = totalprice + price;
else
{
cout << "PLEASE CHOOSE CORRECT MENU" << endl;
}
}
{
cout << "ICE AMERICANO - RM 6" << endl; //pricelist
price = 6;
totalprice = totalprice + price;
}
else if (menu == 'B' || menu == 'b')
else
{
cout << "PLEASE CHOOSE CORRECT MENU" << endl;
}
else
goto ORDER;
cout << endl << "ENTER THE PROMO CODE IF YOU HAVE : "; //user can input the promo code if they have
cout << endl << "CHOOSE YOUR PAYMENT TYPE : COD / ONLINE BANKING / E-WALLET / CREDIT CARD / KYOPAY " << endl; //payment
type
cin >> payType;
cout << endl << "THANK YOU FOR USING OUR SERVICE!";
return 0;
if (promo == '1')
{
}
else
return totalprice;
}
PSUEDOCODE
Start
int quantity, price
float totalprice
string name, address, phoneNum, payType
char restaurant, menu, repeat=’Y’, promo
display "WELCOME TO KYOBROTHERS FOOD DELIVERY .CO"
display "PLEASE ENTER YOUR DETAILS"
display "NAME : "
read name
display "ADDRESS(please use ' _ ' as spacebar): "
read address
cout << "PHONE NUMBER: "
read phoneNum
display "PLEASE CHOOSE THE RESTAURANT"
display "1 - WCD"
display "2 - LFC"
display "3 - SUNBUCKS"
display "------------------"
read restaurant
display "------------------"
while(repeat == 'Y'|| repeat == 'y')
if (restaurant == '1')
display "WCD"
display "------------------------------"
display "PLEASE CHOOSE YOUR MENU"
display "SET A = DOUBLE CHEESE BURGER + COKE"
display "SET B = DOUBLE CHEESE BURGER + FRIES + COKE"
display "SET C = DOUBLE CHEESE BURGER + FRIES + COKE + SUNDAE RAINBOW"
display "------------------------------"
read menu
display "------------------------------"
if (menu == 'A' || menu == 'a')
display "DOUBLE CHEESE BURGER + COKE - RM 8"
price = 8
totalprice = totalprice + price
display "------------------------------"
else if (menu == 'B' || menu == 'b')
display "DOUBLE CHEESE BURGER + FRIES + COKE - RM 10"
price = 10
totalprice = totalprice + price
display "------------------------------"
else if (menu == 'C' || menu == 'c')
display "DOUBLE CHEESE BURGER + FRIES + COKE + SUNDAE RAINBOW - RM 12"
price = 12
totalprice = totalprice + price
display "------------------------------"
else
display "PLEASE CHOOSE CORRECT MENU"
read menu
else if (restaurant == '2')
display "LFC"
display "------------------------------"
display "PLEASE CHOOSE YOUR MENU"
display "SET A = 2PCS FRIED CHICKEN + PEPSI"
display "SET B = 2PCS FRIED CHICKEN + RICE + PEPSI"
display "SET C = 3PCS FRIED CHICKEN + RICE + PEPSI"
display "------------------------------"
read menu
display "------------------------------"
if (menu == 'A' || menu == 'a')
display "2PCS FRIED CHICKEN + PEPSI - RM 7"
price = 7
totalprice = totalprice + price
display "------------------------------"
else if (menu == 'B' || menu == 'b')
display "2PCS FRIED CHICKEN + RICE + PEPSI - RM 9"
price = 9
totalprice = totalprice + price
display "------------------------------"
End
Function:
FLOWCHART
FUNCTION
SAMPLE OUTPUT
CSC126 - FUNDAMENTALS OF ALGORITHMS & COMPUTER PROBLEM SOLVING
ASSESSMENT #4: GROUP PROJECT EVALUATION FORM
A diff icult and ineff icient solution. A logical solution, easy to f ollow
Solution is eff icient and easy to Solution is eff icient, easy to
but not the most eff icient.
follow (i.e. no conf using tricks). understand and maintain.
Does not included selection
control structure, repetition Partially included selection
Include d selection control Included selection control
Eff iciency No Submission control structure, f unction and control structure, repetition 2
structure, repetition control structure, repetition control
array. control structure, f unction and
structure, f unction and array. structure, f unction and array.
array.
The code w as lenghty
Fits a reasonable length of code. Fits a reasonable length of code.
The code w as lenghty.