[go: up one dir, main page]

0% found this document useful (0 votes)
62 views71 pages

Completed Assignment Airlines

This coding assignment is for an airline booking system for All Nippon Airways (ANA). The system allows users to input their personal details, choose from 6 destination countries from Tokyo, select a class and number of passengers. Ticket prices are provided for different classes and ages. A discount is applied if a code is entered. The coding uses loops to calculate total prices for multiple destinations and passengers.

Uploaded by

yaticso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views71 pages

Completed Assignment Airlines

This coding assignment is for an airline booking system for All Nippon Airways (ANA). The system allows users to input their personal details, choose from 6 destination countries from Tokyo, select a class and number of passengers. Ticket prices are provided for different classes and ages. A discount is applied if a code is entered. The coding uses loops to calculate total prices for multiple destinations and passengers.

Uploaded by

yaticso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 71

Faculty of Computer System & Software Engineering

Programming Technique
Section 03B

Assignment 1

Student Name : NURHAYATI BINTI IBRAHIM


ID Number : CA16041
Phone Number : 018-2469033
Lecturers Name : EN. MOHD FAAIZIE BIN DARMAWAN.
CONTENT
1. INTRODUCTION
2. CODING
3. OUTPUTS
4. EVIDENCE
5. RUBRIC MARKS

2
Introduction
Students in University Malaysia Pahang who are taking Programming Technique

subject this semester are needed to complete an assignment in coding about Airlines online

booking flight. Each student were given a different type of Airline all around the world.

Students need to identify how the Airline of online system works such like its price,

destination, discount, and others and brief it in coding format.

I was given an Airline named ALL NIPPON AIRWAYS(ANA).It was found 27

December 1952,64 years ago and its slogan is 'INSPIRATION OF JAPAN'. It has a fleet

size of 219 and 89 destinations available. ANA contain 3 type of flight, which are One-

way, Return and both. But I am required to just do a simple One-Way system for a test

before proceeding. I am also given looping type FOR and DO WHILE for my coding. An

additional looping in the system is ok.

This system will asked user to input all the information below :

a) PERSONAL DETAIL OF THE PERSON

b) 6 CHOICES OF DIFFERENT COUNTRIES

From={Tokyo}

To={Delhi=1, Singapore=2, KL=3, Manila=4, Jakarta=5, Bangkok=6}

c) NUMBER OF PASSENGER

d) CLASS CHOSEN

e) DISCOUNT CODE

3
ANA is the largest airline in JAPAN. In my system, the customer need to input

their personal detail such as full name, age, classfare and their discount code if they have

it. This system already given 6 choices of destination that they have to choose. They only

can depart from Tokyo and choose the destination from that 6 choices. The user can choose

more than one country by entering the number of destination that they want (not more than

6).

This system provided 4 type of class which are Economy Premium Economy,

Business and First. The price for Economy class are more affordable to the user compared

to Premium Economy while Business class is higher price and First has the highest price.

This flight can be board by different ages of passengers from infants until adults. There is

no limited number of passengers that can board in this flight. Each age have different price.

The discount will be given 30% off for the customer that has the code word. All the price

is included with taxes.

4
CODING

5
#include <stdio.h>

int main()

int destination;

int i;

int totalprice=0;

char name[30];

int age[20];

char classfare[20];

int overallprice=0;

int passenger;

char discount[30];

int price;

int j;

//This program ask user to input the number of destinations they are going.

printf("\nFrom : Tokyo\n\nTo : \t1-Delhi(E,P,B)\n\t2-Singapore(E,P,B,F)\n\t3-KL(E,P,B)\n\t4-


Manila(E,B)\n\t5-Jakarta(E,P,B)\n\t6-Bangkok(E,P,B)\n ");

printf("\nHow many destination are you going : ");

scanf("%d" , &destination);

int to[destination];

//looping start for the number of destination they are going

for(i=0; i<destination; i++)

//user needs to input their chosen destination and number of passenger

char discount[destination][30];

6
printf("\nDESTINATION %d : " , i+1 );

scanf("%d" , &to[i]);

printf("\nHow many passenger : ");

scanf("%d" , &passenger);

char name[passenger][30];

int j=0;

do

//second looping starts with number of passenger

printf("\nNAME %d : " , j+1 );

fflush (stdin);

gets(name[j]);

printf("\nAGE %d : " , j+1 );

scanf("%d" , &age[j]);

fflush (stdin);

printf("\nCLASS %d : " , j+1 );

scanf("%c" , &classfare[j]);

if(to[i]==1)

if (classfare[j]== 'E')

if (age[j]>15)

7
{

price=14398.00;

else if (age[j]>11 && age[j] <16)

price=14398.00;

else if (age[j]>1 && age[j]<12)

price=10848.00;

else

price=1409.00;

else if (classfare[j]== 'P')

if (age[j]>15)

price=15080.00;

else if (age[j]>11 && age[j]<16)

price=15080.00;

else if (age[j]>1 && age[j]<12)

price=11361.00;

else

8
{

price=1477.00;

else

if (age[j]>15)

price=21174.00;

else if (age[j]>11 && age[j]<16)

price=21174.00;

else if (age[j]>1 && age[j]<12)

price=15932.00;

else

price=2086.00;

else if(to[i]==2)

if (classfare[j]== 'E')

9
if (age[j]>15)

price=11857.00;

else if (age[j]>11 && age[j]<16)

price=11857.00;

else if (age[j]>1 && age[j]<12)

price=8899.00;

else

price=1168.00;

else if (classfare[j]== 'P')

if (age[j]>15)

price=12799.00;

else if (age[j]>11 && age[j]<16)

price=12799.00;

else if (age[j]>1 && age[j]<12)

price=9592.00;

10
else

price=1260.00;

else if (classfare[j]== 'B')

if (age[j]>15)

price=14505.00;

else if (age[j]>11 && age[j]<16)

price=14505.00;

else if (age[j]>1 && age[j]<12)

price=10894.00;

else

price=1433.00;

else

if (age[j]>15)

price=23285.00;

else if (age[j]>11 && age[j]<16)

11
{

price=23285.00;

else if (age[j]>1 && age[j]<12)

price=23243.00;

else

price=2311.00;

else if(to[i]==3)

if (classfare[j]== 'E')

if (age[j]>15)

price=11057.00;

else if (age[j]>11 && age[j]<16)

price=11057.00;

else if (age[j]>1 && age[j]<12)

12
price=8308.00;

else

price=1088.00;

else if (classfare[j]== 'P')

if (age[j]>15)

price=12799.00;

else if (age[j]>11 && age[j]<16)

price=12799.00;

else if (age[j]>1 && age[j]<12)

price=9612.00;

else

price=1260.00;

else

if (age[j]>15)

price=14505.00;

13
}

else if (age[j]>11 && age[j]<16)

price=14505.00;

else if (age[j]>1 && age[j]<12)

price=10894.00;

else

price=1433.00;

else if(to[i]==4)

if (classfare[j]== 'E')

if (age[j]>15)

price=6444.00;

else if (age[j]>11 && age[j]<16)

price=6444.00;

else if (age[j]>1 && age[j]<12)

14
{

price=4829.00;

else

price=631.00;

else

if (age[j]>15)

price=10093.00;

else if (age[j]>11 && age[j]<16)

price=10093.00;

else if (age[j]>1 && age[j]<12)

price=7568.00;

else

price=996.00;

else if(to[i]==5)

15
{

if (classfare[j]== 'E')

if (age[j]>15)

price=12378.00;

else if (age[j]>11 && age[j]<16)

price=12378.00;

else if (age[j]>1 && age[j]<12)

price=9300.00;

else

price=1216.00;

else if (classfare[j]== 'P')

if (age[j]>15)

price=13180.00;

else if (age[j]>11 && age[j]<16)

price=13180.00;

16
}

else if (age>1 && age[j]<12)

price=9901.00;

else

price=1296.00;

else

if (age[j]>15)

price=16347.00;

else if (age[j]>11 && age[j]<16)

price=16347.00;

else if (age[j]>1 && age[j]<12)

price=12279.00;

else

price=1613.00;

17
else

if (classfare[j]== 'E')

if (age[j]>15)

price=9338.00;

else if (age[j]>11 && age[j]<16)

price=9338.00;

else if (age[j]>1 && age[j]<12)

price=7013.00;

else

price=923.00;

else if (classfare[j]== 'P')

if (age[j]>15)

price=10300.00;

else if (age[j]>11 && age[j]<16)

18
price=10300.00;

else if (age[j]>1 && age[j]<12)

price=7735.00;

else

price=1019.00;

else

if (age[j]>15)

price=12545.00;

else if (age[j]>11 && age[j]<16)

price=12545.00;

else if (age[j]>1 && age[j]<12)

price=9419.00;

else

price=1243.00;

19
totalprice=totalprice+price;

j++;

while(j<passenger);

printf("\nDiscount %d: " , i+1);

fflush (stdin);

gets(discount[i]);

if (discount=='A')

totalprice=totalprice - (totalprice*0.3);

else

totalprice=totalprice;

overallprice=overallprice+totalprice;

printf("\n***********************************************************************
*****************************\n");

if (to[i]==1)

printf("\nDestination : Delhi");

20
else if (to[i]==2)

printf("\nDestination : Singapore");

else if (to[i]==3)

printf("\nDestination : Kuala Lumpur");

else if (to[i]==4)

printf("\nDestination : Manila");

else if (to[i]==5)

printf("\nDestination : Jakarta");

else

printf("\nDestination : Bangkok");

for(j=0;j<passenger;j++)

printf("\n\nNAME : %s" , name[j]);

printf("\n\nAGE : %d" , age[j]);

21
printf("\n\nCLASS : %c" , classfare[j]);

printf("\n***********************************************************************
*****************************\n");

printf("\n***********************************************************************
*****************************\n");

printf("\nOVERALL PRICE : %d " , overallprice);

printf("\n***********************************************************************
*****************************\n");

return 0;

22
OUTPUTS

23
Destination:2

To : 1 (Delhi) Passenger : 3

To : 2 (Singapore) Passenger : 4

24
Destination : 1

To : 6 (Bangkok)

Passenger : 1

25
26
27
28
29
EVIDENCE

30
DELHI (ECONOMY)

31
32
DELHI (PREMIUM)

33
34
DELHI (BUSINESS)

35
36
SINGAPORE (ECONOMY)

37
38
SINGAPORE (PREMIUM ECONOMY)

39
40
SINGAPORE (BUSINESS)

41
42
SINGAPORE (FIRST)

43
44
KL (ECONOMY)

45
46
KL (PREMIUM ECONOMY)

47
48
KL (BUSINESS)

49
50
MANILA (ECONOMY)

51
52
MANILA (BUSINESS)

53
54
JAKARTA (ECONOMY)

55
56
JAKARTA (PREMIUM ECONOMY)

57
58
JAKARTA (BUSINESS)

59
60
BANGKOK (ECONOMY)

61
62
BANGKOK (PREMIUM ECONOMY)

63
64
BANGKOK (BUSINESS)

65
66
APPENDIX A: RUBRIC

COURSE: PROGRAMMING TECHNIQUES MARK:

CHAPTER : Introduction to Problem


Solving & Programming, I/O
Operation, Arithmetic Operation
and Control Statement
COURSE CODE:
BCI1023/BCS1023 /100
ASSESSMENT: DURATION: 4
BIL: 1
ASSIGNMENT(10%) weeks

Name NURHAYATI BINTI IBRAHIM

Matric ID CA16041

Section No. 3B

Course Outcome Notes Marks

CO2 Construct and run programs /50m


Overall program structure

- able to execute program without error /5m


(5m)

Apply appropriate Input variables and


statement relevant to the problem

- apply appropriate type of variables (5m)

- applyappropriate input statement based


on different values
(char/string/integer/float etc.) (5m)

- follow logical sequence to enter the input


data (5m)
/15m

Apply appropriate processes and related to


theproblem

- apply appropriate control statements


(20m)

- apply appropriate arithmetic expression


(5m)

67
/25m

Display of outputs 5m

- design of menu/ final output (3m)

- apply different types of output statement.


(integer/float/char/constant etc.) (2m) /5m

68
Course Outcome Total mark

CO3 Differentiate various techniques in solving a problem 50

Score gained (1 Mark gained*


Items
to 5)* Formula **

LL1.1.1Organize information using different


0.3 x ___/5 x 50 =
symbols/ pseudo code statement.

LL1.1.2 Organize information using appropriate


0.2 x ___/5 x 50 =
input/ output variables and statement.

LL1.1.3 Organize information using different


0.1 x ___/5 x 50 =
arithmetic operators and operands.

LL1.1.4 Organize information using various


0.2 x ___/5 x 50 =
types of control structure.

LL1.2.1 Able to find and refer correct


information sources related to case study 0.2 x ___/5 x 50 =
problem (Assigned airline)

* Please refer to Table 2.

**Formula to calculate mark gained

Mark gained = (weightage item/ total weightage) x (score gained/5) x total mark

69
CO3 Differentiate various techniques in solving a problem

LEVEL OF ACHIEVEMENT
CRITERIA Weightage Mark
0 1 2 3 4 5

LL1.1: Organize information


according to subject requirement.

Rarely
LL1.1.1 Organize information using Always LL1.1.1 1.5
completes Completes
different symbols/ pseudo code completes
required required works, LL1.1.2 1
statement. required
works, and and show
works, and LL1.1.3 0.5 40
LL1.1.2 Organize information using rarely show ability to
show ability
appropriate input/ output variables ability to organize LL1.1.4 - 1
to organize
and statement. organize information
information
information related to
related to
LL1.1.3 Organize information using related to subject
subject
different arithmetic operators and subject
operands.

LL1.1.4 Organize information using


various types of control structure.

LL1.2: Find or refer various


Always
information sources in completing
Rarely come come up
assignments Sometimes
up with with
come up with
enough abundant
enough related
related related and LL1.2.1 - 1 10
LL1.2.1 Able to find and refer sources in
sources in reliable
information sources related to case completing
completing sources in
study problem (Assigned airline) assignments.
assignments. completing
assignments.

Total 5 50

Table 2 CO3 score and mark gained


LL1.1: Organize information according to subject requirement.

LL1.2: Find or refer various information sources in completing assignments

70
71

You might also like