Вы находитесь на странице: 1из 8

3.

0 PSEUDOCODE
Start
int num_hours ,customers;
int x;
float charge_min = 2.00,rate = 1.50 , charge_max = 10.00, price
float calculate_charge
Display ***~WELCOME TO AEON CAR PARK~***
Display " Want your car safe? it's right here !! "
Display " *** Please make sure you lock your car after you left it ***"
Display " Please enter the number of hours : "
Input num_hours
if(num_hours<=2)
calculate_charge = charge_min;
else
if ((num_hours>2) && (num_hours<=24))
calculate_charge = charge_min +(num_hours-2)*rate
else
calculate_charge = charge_min+(num_hours-2)*rate+10;
Display Please select your car type"
Display " 1 = MPV "
Display " 2 = Sedan "
Display " 3 = Others";
Input integer x
switch(x)
case 1:
Display "MPV "
price=calculate_charge*2
Print "price of ticket =" price "MYR"
break
case 2:
Display "Sedan"
price=calculate_charge*4;
Print " price of ticket =" price " MYR "
break
case 3:
Print " Sir, You car type cannot park here. Sorry sir "
break
Display " ***THANK YOU***
End

4.0 FLOW CHART


Start

float charge_min = 2.00, rate = 1.50, charge_max = 10.00, price, calculate_charge

Display **WELCOME TO AEON CAR PARK***


Want your car safe? Its right here !!
**Please make sure you lock your car after
you left it**
Please enter number of hours

Input int num_hours

Yes

if
num_hours<=2

calculate_charge=charge_min

Yes

No

if
num_hours>2 && <=24

calculate_charge=charge_min
+ (num_hours-2)* rate

No

Calculate_charge= charge_min+(num_hours-2)*rate

Display Please select your car type


1=MPV
2=Sedan
3=Others

Switch (x)

Input int x

Yes

Case 1:
x=1

price=calculate_charge*2

Yes

No

Case 2:
x=2

price=calculate_charge*4

No

Case 3:
x=3

Print Price of ticket =priceMYR

Display Sir, your car type cannot park here.


Sorry sir

Break

End

BNJ20802
COMPUTER PROGRAMMING OF C++
PROJECT REPORT
NO.
1.

MATRIC NO.
AN150130

3.

NAME
ISAZA MOHD AMIRUL HAFIZIE BIN MOHD
ISA
MUHAMMAD DINIE ZIKRY BIN
MOHAMAD GHAZALI
LUQMAN HAKIM BIN ABDUL RAHIM

4.

KASHFUL AZHIM BIN MAZLAN

AN150201

5.

MUHAMMAD FAIZ BIN OSMAN

AN150012

2.

AN150151
AN150312

LECTURER : MR. OMAR ABU HASSAN


SECTION : 1
1.0 INTRODUCTION
C++ is an object oriented programming (OOP) language, developed by
Bjarne Stroustrup, and is an extension of C language. It is therefore possible to
code C++ in a "C style" or "object-oriented style." In certain scenarios, it can be
coded in either way and is thus an effective example of a hybrid language. C++ is
a general purpose object oriented programming language. It is considered to be an
intermediate level language, as it encapsulates both high and low level language
features. Initially, the language was called 'C with classes as it had all properties

of C language with an additional concept of 'classes. However, it was renamed to


C++ in 1983.
The main highlight of C++ is a collection of pre-defined classes, which are
data types that can be instantiated multiple times. The language also facilitates
declaration of user defined classes. Classes can further accommodate member
functions to implement specific functionality. Multiple objects of a particular class
can be defined to implement the functions within the class. Objects can be defined
as instances created at run time. These classes can also be inherited by other new
classes which take in the public and protected functionalities by default. C++
includes several operators such as comparison, arithmetic, bit manipulation,
logical operators etc. One of the most attractive features of C++ is that it enables
the overloading of certain operators such as addition. A few of the essential
concepts within C++ programming language include polymorphism, virtual and
friend functions, templates, namespaces and pointers.

1
2.0 PROBLEM STATEMENT
A parking lot also known as a car lot, is a cleared area that is intended for
parking vehicles. Usually, the term refers to a dedicated area that has been
provided with a durable or semi-durable surface. In most countries where cars are
the dominant mode of transportation, parking lots are a feature of every city and
suburban area. Shopping malls, sports stadiums, and similar venues often feature
parking lots of immense area.
The parking lot usually owned by private company or local authorities. The
problem with these companies is, they tend to charge the vehicle according to
what they like. It is difficult for the vehicle user to estimate the parking rates that
they need to pay.

So, our solution to solve this problem is to develop a program that will calculate
the rate that the vehicle user need to pay according to vehicle types and its parking
hours. We hope by using this program, it will reduce the problem of parking rates
in private parking lot.

2
5.0 PROGRAM EXPLANATION
This program will enables the user to know exactly the price of their parking fee
before entering the Aeon Parking Lot. By using the if-else statement, the program can
determine the time or how long did the driver wants to park their vehicle. Thus, the
program will calculate the fee required using the process as in the pseudocode on how
much did they need to pay for a parking area. Other than that, the case statement can
be used to identify the types of the vehicle and whether it is allowable at the Aeon
Parking lot.

The program asks the user to enter the number of hours require. If the driver enter
less or equal to two hours, the program will directly calculate the minimum charge,
else it will calculate the the minimum charge including the rate for parking more than
two hours. Next, it will asks the user to enter their type of vehicles. It will display the
sort of vehicle 1 = mpv 2= sedan and 3= others. If the user enter number 1, it will
calculate the charge needed and print it. So does with the sedan. If user choose
number 3, the program will display " Sir, You car type cannot park here. Sorry sir ".

7
CONTENT

NO.

TITLE

PAGE

1.

Introduction

2.

Problem Statement

3.

Pseudo code

4.

Flow Chart

4-6

5.

Problem Explanation

Вам также может понравиться