C++ Pseudocode

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

TABLE OF CONTENT

No Content Page Number

1 ACKNOWLEDGEMENT 1

2 PROJECT SUMMARY 2

3 PSEUDOCODE 3 – 13

4 FLOWCHART 14 - 29

5 LIST OF CODES 30 - 45

6 DETAILS OF INPUT AND OUTPUT 46

7 SCREEN LAYOUT 47 - 53

8 REFERENCES 54
1. ACKNOWLEDGEMENT

We would like to express our special thanks to Sir Zaaba for giving us the opportunity
to work together as a team which has help us tremendously in giving us a depth
understanding of the topic we have learnt in class. We would also like to acknowledge
the hard work and dedication our team member has given to make this project happen.
Lastly, we would like to give thanks to Allah for making this happen.

1
2. PROJECT SUMMARY

SUMMARY

C++ programming comes in handy particularly in decision making. Therefore,


our group has developed “LET’S GO TO EXTREME ADVENTURE” program
which applies selection and repetition. Extreme activities were designed for UiTM
Tapah students who wants to join the activities that we suggest based on the top rating
from the visitors of this activities. We designed this program for the UiTM Tapah
students so they can easily involve with our project. At the same time, those students
can fill up their free time with beneficial things and bridging friendship among
themselves.

Firstly, the system required the user’s name, ID students, part and faculty. As
the system processes the input, it will then display the state that we suggest to carry
out the extreme activities. The user can choose which state that they want to go. Then,
the program will display the list of extreme activities that available in that state. The
user can choose which activities that they interested, suitable budget and time.

PROBLEM

We designed this “LET’S GO TO EXTREME ADVENTURE” program


especially for UiTM Tapah students so they can easily join these activities.
Nowadays, there were lots of website on internet that provide many choices of
extreme activities in Malaysia. Despite that, there were certain websites are fake. The
creator of the fake websites did that such of things because they want to gain a lot of
money easily and their victim of this case will be those people who lack of knowledge
about IT and current issues. By launching this program, we can help the students to
find their extreme activities that their wish to join and provide a affordable cost for
them. Thus, this program can prevent the students from being a victim of the fake
website.

2
3. PSEUDOCODE

Start

Input

Input state
Data type : int
Variable Name : state

Input langkawi
Data type : int
Variable Name : langkawi

Input selangor
Data type : int
Variable Name : selangor

Input perak
Data type : int
Variable Name : perak

Input terengganu
Data type : int
Variable Name : terengganu

Input food
Data type : int
Variable Name : food

Input answer
Data type : int
Variable Name : answer

Input again
Data type : int
Variable Name : again

Input respond
Data type : char
Variable Name : respon

Input name
Data type : char

3
Variable Name : name

Input student’s ID
Data type : char
Variable Name : studentid

Input phone number


Dataa type : char
Variable Name : phone

Input price
Data type : float
Variable Name : price

Input price of food


Data type : float
Variable Name : pricefood

Input total price


Data type : float
Variable Name : totalprice

Input price for each person


Data type : float
Variable Name : eachprice

PROCESS

SET state, langkawi, selangor, perak, terengganu, food, answer, again to int
SET respond, name, studentid to char
SET price, pricefood, totalprice, eachprice to float

CALL greeting ()
Display "THIS ACTIVITIES MUST HAVE 5 PERSON IN EACH GROUP"
Display "Do you have 5 person in a group?"
Input respond

While answer not equal to 0


Display “HI! WE NEED YOUR DATA”
CALL data()

While again not equal to 0


CALL state ()

4
if state equal to 1 then
CALL chooseLangkawi()
CALL langkawi1(langkawi)

if state equal to 2 then


CALL chooseSelangor()
CALL selangor1(selangor)

if state equal to 3 then


CALL choosePerak()
CALL perak1(perak)

if state equal to 4 then


CALL chooseTerengganu()
CALL terangganu1(terengganu)
End if

If again not equal to 0 then


repeat

If again equal to 0 then


exit the program

Calculate
totalprice + = price

Calculate
eachprice = totalprice/5

Endwhile
Endwhile

Output

Display the reset


“____________________________”
“^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^”
“```````LET’S GO ADVENTURE`````”

“NUMBER : “
“STUDENT NAME : “
“STUDENT ID: ”
“TOTAL PRICE : RM “
“PRICE FOR EACH PERSON : RM”

5
“````````````````````````````````````````` “
“ You have successfully bought your ticket :)”
“THANK YOU & HAVE A NICE DAY”
“^^^^^^^^^^^^^^^^^^^^^^^^”
“_____________________________”
End

6
PSEUDOCODE (FUNCTION)
Module greeting()
START
Display“ _________________________________”
Display newline
Display “| |”
Display newline
Display “| Welcome to Our Worl |”
Display newline
Display “|______________________ ________|”
Display newline
RETURN

Module data()
START
Display “*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*”
Display “Enter information of students:”

SET i=0
FOR i < 5
Display “GROUP MEMBERS : “
Display “ENTER NAME”
Display “ENTER STUDENT’S ID”
Display “CONTACT INFORMATION:”
Display “PLEASE ENTER NAME : “
Display “PHONE NUMBER”
Display “*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*”
RETURN

Module state()
START
Display “* * * * * * * * * * * * * * * * * * * * * * * * * * *“
Display newline
Display ”* * * * * * (1) LANGKAWI * * * * * *”
Display newline
Display ”* * * * * * (2) SELANGOR * * * * * *”
Display newline
Display ”* * * * * * (3) PERAK * * * * * *”
Display newline
Display ”* * * * * * (4) TERENGGANU * * * * * *”
Display newline
Display ”* * * * * * * * * * * * * * * * * * * * * * * * * * *”
RETURN

7
Module chooseLangkawi()
START
Display “_____________________________________________________”
Display newline
Display “~~~~~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~~~~”
Display newline
Display “ (1) JET SKI AT DAYANG BUNTING (8 ISLANDS)”
Display newline
Display “ (2) TANDEM SKYDIVING”
Display newline
Display “_____________________________________________________”
Display newline
Display “WHICH ONE YOU CHOOSE? : "
Read langkawi
RETURN

Module chooseSelangor()
START
Display “_____________________________________________________”
Display newline
Display “~~~~~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~~~~”
Display newline
Display “ (1) BROGA HILLS”
Display newline
Display “ (2) SKYTEX ADVENTURE”
Display newline
Display “_____________________________________________________”
Display newline
Display “WHICH ONE YOU CHOOSE? : "
Read selangor
RETURN

Module choosePerak()
START
Display “_____________________________________________________”
Display newline
Display “~~~~~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~~~~”
Display newline
Display “ (1) GUA TEMPURUNG ”
Display newline
Display “ (2) X-PARK IPOH”
Display newline
Display “_____________________________________________________”
Display newline

8
Display “WHICH ONE YOU CHOOSE? : "
Read perak
RETURN

Module chooseTerengganu()
START
Display “_____________________________________________________”
Display newline
Display “~~~~~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~~~~”
Display newline
Display “ (1) DIVING PULAU PERHENTIAN”
Display newline
Display “ (2) HIKING BUKIT KELUANG”
Display newline
Display “_____________________________________________________”
Display newline
Display “WHICH ONE YOU CHOOSE? : "
Read terengganu

RETURN

9
Module langkawi1(langkawi)
START
if langkawi equal to 1 then
price=1000
Display “JET SKI AT DAYANG BUNTING (8 ISLANDS)”
Display newline
Display “DATE : 22/12/2018”
Display newline
Display “PRICE : RM”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood = 400
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Breakfast & Lunch package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if

else if langkawi equal 2 then


price= 1200
Display “TANDEM SKYDIVING”
Display newline
Display “DATE : 23/12/2018”
Display newline
Display “PRICE : RM”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood = 100
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Lunch package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if
Else
Display “INVALID NUMBER”
End if
RETURN

10
Module selangor1(selangor)
START

if selangor equal 1 then


price = 250
Display “HIKING BROGA HILLS”
Display newline
Display “DATE : 8/12/2018”
Display newline
Display ” PRICE : RM”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood = 60
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Dessert & Breakfast package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if

else if selangor equal 2 then


price = 400
Display “SKYTEX ADVENTURE”
Display newline
Display “DATE : 9/12/2018”
Display newline
Display “PRICE : RM”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood = 80
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Dessert & Lunch package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if
else
Display “INVALID NUMBER”
End if
RETURN

11
Module perak1(perak)
START
if perak equal 1 then
price = 250
Display “GUA TEMPURUNG”
Display newline
Display “DATE : 1/12/2018”
Display newline
Display “PRICE : RM ”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood = 80
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Dessert & Lunch package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if
else if perak equal 2 then
price = 450
Display “X-PARK IPOH”
Display newline
Display “DATE : 8.11.2018”
Display newline
Display “PRICE : RM ”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood = 80
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Dessert & Lunch package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if

else
Display “INVALID NUMBER”
End if
RETURN

12
Module terengganu1(terengganu)
START
if terengganu equal 1 then
price = 950
Display “DIVING PULAU PERHENTIAN”
Display newline
Display “DATE : 15/12/2018”
Display newline
Display “PRICE : RM ”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood = 150
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Dessert & Lunch package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if
else if terengganu equal 2 then
price = 250
Display “HIKING BUKIT KELUANG”
Display newline
Display “DATE : 16/12/2018”
Display newline
Display “PRICE : RM ”
Display “Would you like to add a food package that we provide?”
Display “IF YES, ENTER [1] . IF NO, ENTER [2] :”
Read food

If food equal to 1 then


pricefood =100
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
Display “ Dessert & Breakfast package”
Display “ RM”
Display “! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !”
End if

else
Display “INVALID NUMBER”
End if
RETURN

13
4. FLOWCHART

Start

greeting()

data()

STATE()

T
State
chooseLangkawi()
==1

langkawi1()
F

T State
chooseSelangor()
==2

selangor1()
F

T State
choosePerak()
==3

perak1()
F

T
State
chooseTerengganu()
==4

terengganu1()
C B
14
C B

Display “Do you want to add


anything else?"

again==0

F
T

totalprice +=price

eachprice = totalprice/5

print()

end

15
Module greeting()

Display “ _________________________________”

Display newline

Display “| |”

Display newline

Display “| Welcome to Our World |”

Display newline

Display “|________________________________|”

Return

16
Module STATE ()

Display “* * * * * * * * * * * * * * * * * * * * * * * * * * *“

Display newline

Display ”* * * * * * (1) LANGKAWI * * * * * *”

Display newline

Display ”* * * * * * (2) SELANGOR * * * * * *”

Display newline

Display ”* * * * * * (3) PERAK * * * * * *”

Display newline

Display ”* * * * * * (4) TERENGGANU * * * * * *”

Display newline

Display ”* * * * * * * * * * * * * * * * * * * * * * * * * * *”

Display newline

Display “ PLEASE ENTER NUMBER YOU CHOOSE : ”

Read state

Return

17
Module chooseLangkawi ()

Display“______________________________________________”

Display newline

Display “~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~”

Display newline

Display “ (1) JET SKI AT DAYANG BUNTING (8 ISLANDS)”

Display newline

Display “ (2) TANDEM SKYDIVING”

Display newline

Display “______________________________________________”

Display newline

Display “WHICH ONE YOU CHOOSE? : "

Read langkawi

Return

18
Module chooseSelangor ()
s

Display“______________________________________________”

Display newline

Display “~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~”

Display newline

Display “ (1) BROGA HILLS”

Display newline

Display “ (2) SKYTEX ADVENTURE”

Display newline

Display “______________________________________________”

Display newline

Display “WHICH ONE YOU CHOOSE? : "

Read selangor

Return

19
Module choosePerak ()

Display“______________________________________________”

Display newline

Display “~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~”

Display newline

Display “ (1) GUA TEMPURUNG ”

Display newline

Display “ (2) X-PARK IPOH”

Display newline

Display “______________________________________________”

Display newline

Display “WHICH ONE YOU CHOOSE? : "

Read perak

Return

20
Module chooseTerengganu ()

Display“______________________________________________”

Display newline

Display “~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~”

Display newline

Display “ (1) DIVING PULAU PERHENTIAN”

Display newline

Display “ (2) HIKING BUKIT KELUANG”

Display newline

Display “______________________________________________”

Display newline

Display “WHICH ONE YOU CHOOSE? : "

Read terengganu

Return

21
Module langkawi1 (int langkawi)

Read langkawi
Display

T “*****JET SKI AT DAYANG


BUNTING (8 ISLANDS)
F *****”

langkawi Display newline


price= 1000
==1
Display

“DATE : 22/12/2018”

Display newline

Display “PRICE : RM”, price

T
Display”Would you like to add a food
Food==1 package that we provide”

Display “ Breakfast & Lunch


package”
pricefood=300
display newline

display” RM ",pricefood

return

A
22
A

Display

“*****TANDEM SKYDIVIN
T *****”
langkawi
price= 1200 Display newline
==2
Display

“DATE : 23/12/2018”

Display newline

Display “PRICE : RM”, price

T
Display”Would you like to add a food
Food==1
package that we provide”

Display “ Lunch package”


pricefood=300
display newline

display” RM ",pricefood

return

Display
“INVALID
INPUT”

23
Module return
selangor1 (int selangor)
s

Read selangor
Display

“*****BROGA HILLS*****”

Display newline
selangor
price= 250 Display
==1
“DATE : 8/12/2018”

Display newline

Display “PRICE : RM”, price

T
Display”Would you like to add a
Food==1
food package that we provide”

Display “ Dessert & Breakfast


pricefood=300 package”

display newline

display” RM ",pricefood

return

24

A
A

Display

“*****SKYTEX
ADVENTURE*****”
T
selangor
price= 50 Display newline
==2
Display

“DATE : 9/12/2018”

Display newline

Display “PRICE : RM”, price

T
F Food==1 Display”Would you like to add a
food package that we provide”

Display “ Dessert & Lunch


package”
pricefood=400
display newline

display” RM ",pricefood

return

Display
“INVALID 25
INPUT”
Module perak1 (int perak)

Read perak Display


price=250
“*****GUA
TEMPURUNG*****”

Display newline

Display

“DATE : 1/12/2018”

Display newline
T
Display “PRICE : RM”, price

perak
==1
Display”Would you like to add a
food package that we provide”

F
Food==1 return

pricefood=80

Display “Dessert & Lunch package”


display newline

display” RM ",pricefood

A
26
A

F Display

“*****X-PARK IPOH*****”

perak Display newline


price= 450
==2 Display

“DATE : 8/12/2018”

Display newline

Display “PRICE : RM”, price

Display”Would you like to add a


food package that we provide”

Food==1 return

pricefood=80
F

Display
“INVALID
INPUT” Display “Dessert & Lunch package”
display newline

display” RM ",pricefood

27
Module terengganu1 (int terangganu)

Read terangganu

Display

terangganu “*****DIVING PULAU


==1 price= 950 PERHENTIAN*****”

Display newline

Display

“DATE : 15/12/2018”

Display newline

Display “PRICE : RM”, price

Display”Would you like to add a


food package that we provide”

F
Food==1 return

pricefood=150

Display “ Dessert & Lunch


package”

A display newline

display” RM ",pricefood 28
A

Display
terangganu
==2 price= 250 “*****HIKING BUKIT
KELUANG*****”

Display newline

Display

“DATE : 16/12/2018”

Display newline

Display “PRICE : RM”, price

Display”Would you like to add a


food package that we provide”

Food==1
return

T
F

pricefood=100
Display
“INVALID
INPUT”

Display”Dessert & Lunch package”

display newline

display” RM ",pricefood 29
5. LIST OF CODES
#include <iostream>

#include <iomanip>

#include <math.h>

/* ctime example */

#include <stdio.h> /* printf */

#include <time.h> /* time_t, time, ctime */

using namespace std;

int part, state, langkawi, selangor, perak, terengganu, price,answer,food,pricefood,again;


//global declare

char respond, name [30], falculty [6], studentid[20], phone[15]; // global declare

float totalprice = 0, eachprice=0; //initialize

void greeting (); //function prototype

void STATE (); //function prototype

void chooselangkawi (); //function prototype

void chooseselangor (); //function prototype

void chooseperak (); //function prototype

void chooseterengganu (); //function prototype

int langkawi1 (int); //function prototype

int selangor1 (int); //function prototype

int perak1 (int); //function prototype

int terengganu1 (int); //function prototype

void data (); //function prototype

void print (); //function prototype

struct student

char name[50];

30
int people, studentid; } s[5];

//funtion definiton

void greeting () //function no parameter and no return value

cout<<endl;

cout<<" ________________________________ "<<endl;

cout<<" | | "<<endl;

cout<<" | Welcome to Our World | "<<endl;

cout<<" |________________________________| "<<endl;

cout<<endl;

//funtion definiton

void STATE () //function no parameter and no return value

cout<<"\n WHERE YOU WANT TO GO? \n"

<<"\n *************************** \n"

<<"\n ****** (1) LANGKAWI ****** \n"

<<"\n ****** (2) SELANGOR ****** \n"

<<"\n ****** (3) PERAK ****** \n"

<<"\n ****** (4) TERENGGANU * * * * * * \n"

<<"\n **** *********************** \n";

cout<<endl;

cout<<"\n PLEASE ENTER NUMBER YOU CHOOSE : ";

cin>>state;

//funtion definiton

31
void chooseLangkawi ()

cout<<"\n_________________________________________________________"<<endl;

cout<<"~~~~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~ ~~~~"<<endl;

cout<<" (1) JET SKI AT DAYANG BUNTING (8 ISLANDS) "<<endl

cout<<" (2) TANDEM SKYDIVING "<<endl;

cout<<"
___________________________________________________________"<<endl;

cout<<"\n WHICH ONE YOU CHOOSE? : ";

cin>>langkawi;

//funtion definiton

void chooseSelangor () //function no parameter and no return value

cout<<"\n________________________________________________________"<<endl;

cout<<"~~~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~~~~"<<endl;

cout<<" (1) BROGA HILLS "<<endl;

cout<<" (2) SKYTEX ADVENTURE "<<endl;

cout<<"_________________________________________________________"<<endl;

cout<<"\n WHICH ONE YOU CHOOSE? : ";

cin>>selangor;

//funtion definiton

void choosePerak () //function no parameter and no return value

cout<<"\n_________________________________________________________"<<endl;

cout<<"~~~~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~~~~"<<endl;

32
cout<<" (1) GUA TEMPURUNG "<<endl;

cout<<" (2) X-PARK IPOH "<<endl;

cout<<"_____________________________________________________"<<endl;

cout<<"\n WHICH ONE YOU CHOOSE? : ";

cin>>perak;

//funtion definiton

void chooseTerengganu () //function no parameter and no return value

cout<<"\n_____________________________________________________"<<endl;

cout<<~~~~~~~~~~~~~~~~~~ADVENTURE~~~~~~~~~~~~~~~~~~~~~~"<<endl;

cout<<" (1) DIVING PULAU PERHENTIAN "<<endl;

cout<<" (2) HIKING BUKIT KELUANG "<<endl;

cout<<"_______________________________________________________"<<endl;

cout<<"\n WHICH ONE YOU CHOOSE? : ";

cin>>terengganu;

//funtion definiton

int langkawi1 (int langkawi) //function with parameter but no return value

if (langkawi==1)

{ price = 1000 ;

cout<<" *****JET SKI AT DAYANG BUNTING (8ISLANDS)*****"<<endl;

cout<<" DATE : 22/12/2018 “ <<endl;

cout<<" PRICE : RM " <<price<<endl;

cout<<” ”endl;

cout<<" Would you like to add a food package that we provide? "<<endl;

33
cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if (food==1)

cout<<endl;

pricefood=400;

cout<<” ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Breakfast & Lunch package" <<endl;

cout<<" RM "<<pricefood <<endl;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl; }

else if (langkawi==2)

{ price = 1200 ;

cout<<" *****TANDEM SKYDIVING*****"<<endl;

cout<<" DATE : 23/12/2018 "<<endl;

cout<<" PRICE : RM " <<price<<endl ;

cout<<endl;

cout<<" Would you like to add a food package that we provide?"<<endl;

cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if(food==1)

cout<<endl;

34
pricefood=100;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Lunch package"<<endl;

cout<<" RM "<<pricefood<<endl;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl; }

else

cout<<" INVALID VALUE"<<endl;

//funtion definiton

int selangor1 (int selangor) //function with parameter but no return value

if (selangor==1)

{ price = 250 ;

cout<<" *****BROGA HILLS*****"<<endl;

cout<<" DATE : 8/12/2018 "<<endl;

cout<<" PRICE : RM "<<price<<endl;

cout<<endl;

cout<<" Would you like to add a food package that we provide?"<<endl;

cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if (food==1)

35
pricefood=50;

cout<<endl;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Dessert & Breakfast package"<<endl;

cout<<" RM "<<pricefood<<endl;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl; }

else if (selangor==2)

{ price = 400;

cout<<" *****SKYTEX ADVENTURE*****"<<endl;

cout<<" DATE : 9/12/2018 "<<endl;

cout<<" PRICE : RM " <<price<<endl ;

cout<<endl;

cout<<" Would you like to add a food package that we provide?"<<endl;


cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if(food==1)

cout<<endl;

pricefood=80;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Dessert & Lunch package"<<endl;

cout<<" RM "<<pricefood<<endl;

36
cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl;}

else

cout<<" INVALID VALUE"<<endl;

//funtion definiton

int perak1 (int perak) //function with parameter but no return value

if (perak==1)

{ price = 250 ;

cout<<" *****GUA TEMPURUNG*****"<<endl;

cout<<" DATE : 1/12/2018 "<<endl;

cout<<" PRICE : RM "<<price<<endl;

cout<<endl;

cout<<" Would you like to add a food package that we provide?"<<endl;

cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if(food==1)

cout<<endl;

pricefood=80;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Dessert & Lunch package "<<endl;

cout<<" RM "<<pricefood<<endl;

37
cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl; }

else if (perak==2)

{ price = 450 ;

cout<<" *****X-PARK IPOH*****"<<endl;

cout<<" DATE : 8.11.2018 "<<endl;

cout<<" PRICE : RM " <<price<<endl ;

cout<<endl;

cout<<" Would you like to add a food package that we provide?"<<endl;

cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if (food==1)

cout<<endl;

pricefood=80;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Dessert & Lunch package "<<endl;

cout<<" RM "<<pricefood<<endl;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl; }

else

cout<<"INVALID VALUE"<<endl;

38
//funtion definiton

int terengganu1 (int terengganu) //function with parameter but no return value

if (terengganu==1)

{ price = 950;

cout<<" *****DIVING PULAU PERHENTIAN*****"<<endl;

cout<<" DATE : 15/12/2018 "<<endl;

cout<<" PRICE : RM "<<price<<endl;

cout<<endl;

cout<<" Would you like to add a food package that we provide?"<<endl;

cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if (food==1)

cout<<endl;

pricefood=150;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Dessert & Lunch package"<<endl;

cout<<" RM "<<pricefood<<endl;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl; }

else if (terengganu==2)

{ price = 250;

39
cout<<" *****HIKING BUKIT KELUANG*****"<<endl;

cout<<" DATE : 16/12/2018 "<<endl;

cout<<" PRICE : RM " <<price<<endl ;

cout<<endl;

cout<<" Would you like to add a food package that we provide?"<<endl;

cout<<" IF YES, ENTER [1] . IF NO, ENTER [2] : ";

cin>>food;

cout<<endl;

if (food==1)

cout<<endl;

pricefood=100;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<" Dessert & Breakfast package "<<endl;

cout<<" RM "<<pricefood<<endl;

cout<<" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !"<<endl;

cout<<endl; }

else

cout<<" INVALID VALUE"<<endl;

//funtion definiton

void data () //function no parameter and no return value

cout<<"-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-"<<endl;

40
cout<<endl;

cout << "Enter information of students: " << endl;

// storing information

for(int i = 0; i < 5; ++i)

s[i].people = i+1;

// cout << "How many people in your group"<< endl;

//cin>> s[i].people;

cout << "Group member :" << s[i].people << "," << endl;

cout << "Enter name: ";

cin >> s[i].name;

cout << "Enter studentid: ";

cin >> s[i].studentid;

cout<<"-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-"<<endl;

cout << endl; }

cout<<"Contact information : "<<endl;

cout<<"PLEASE ENTER NAME : "<<endl;

cin>>name;

cout<<"\n PHONE NUMBER : "<<endl;

cin>>phone;

//funtion definiton

void print () //function no parameter and no return value

41
{

cout<<"_____________________________________________________________"<<endl;

cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;

cout<<"``````````````````````````````LET'S GO ADVENTURE`````````````````````’’’```" <<endl;

cout<<" "<<endl;

time_t rawtime;

time (&rawtime);

printf (" \t\t\t\t\t %s", ctime (&rawtime));

cout<<" "<<endl;

for(int i = 0; i < 5; ++i)

cout <<" \t\t\t**NUMBER\t\t : " << i+1 << endl;

cout <<" \t\t\tSTUDENT NAME\t\t : " << s[i].name << endl;

cout <<" \t\t\tSTUDENT ID\t\t : " << s[i].studentid << endl;

cout<<endl;

cout<<" \t\t\tCONTACT INFORMATION\t : " <<endl;

cout<<" \tNAME\t\t\t : "<<name<<endl;

cout<<" \tPHONE NUMBER\t\t : "<<0<<phone<<endl;

cout<<" \t\tTOTAL PRICE\t\t : RM"<<totalprice<<endl;

cout<<" \t\tPRICE FOR EACH PERSON\t : "<<eachprice<<endl;

cout<<" ````````````````````````````````````````````````````````````````````````` "<<endl;

cout<<" \t\t\tYou have successfully bought your ticket :) "<<endl;

cout<<" \t\t\tTHANK YOU & HAVE A NICE DAY "<<endl;

cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "<<endl;

cout<<" "<<endl;

42
cout<<"\t\t***FOR REFERENCE YOU CAN CONTACT 017-9485876***\t "<<endl;
cout<<"_________________________________________________________"<<endl;

int main ()

int answer=1; //initialize

int again=1; //initialize

cout<<endl;

greeting (); //function call

cout<<endl;

cout<<"THIS ACTIVITIES MUST HAVE 5 PERSON IN EACH GROUP"<<endl;

cout<<endl;

cout<<"Do you have 5 person in a group?"<<endl;

cout<<"ENTER [1] for YES or [0] for NO"<<endl;

cin>>answer;

while (answer !=0)

cout<<endl;

cout<<"HI! WE NEED YOUR DATA"<<endl;

cout<<endl;

data (); //function call

cout<<endl;

while (again !=0)

43
{

STATE (); //function call

if (state==1)

chooseLangkawi (); //function call

cout<<endl;

langkawi1 (langkawi); //function call

if (state==2)

chooseSelangor (); //function call

cout<<endl;

selangor1 (selangor); //function call

if (state==3)

choosePerak (); //function call

cout<<endl;

perak1 (perak); //function call

44
}

if (state==4)

chooseTerengganu (); //function call

cout<<endl;

terengganu1 (terengganu); //function call

cout<<endl;

cout<<endl;

cout<<"\n Do you want to add anything else?"

<<"\n ENTER [1] IF YES, ENTER [0] IF NO : ";

cin >> again;

cout<<endl;

totalprice += price+pricefood;

eachprice= totalprice/5;

break;

print (); //function call

return 0;

45
6. DETAILS OF INPUT AND OUTPUT

Input Output

answer Display all

name, studentid, phone number, Display data

Input choice of state (1,2,3,4) Display activities state

Input choice of activities (1,2) Display price and date

food Display food and price

again Display all state

46
7. SCREEN LAYOUT

47
48
49
50
51
52
53
8. REFERENCES

http://www.cplusplus.com/doc/tutorial/

54

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy