Computer Science – Term 1 (2020 -21)
Grade 10 Advanced – Checkpoint 4
PART - A
Instruction Complete all Parts (1-3).
: Complete this document and submit to your teacher through LMS.
Follow your teachers instruction for file(s) submissions.
Part 1 of 3: Fill in your student details (in English):
Student ID. /رقم ال ّطالب Enter your Student ID
ّ
Student Name /اسم الطالب Enter your Student Name
School Name اسم المدرسة/ Enter your School’s name.
Subject /الما ّدة Computer Science
Grade & Stream /صف والمسار ّ ال Choose an item. ّ ال
Class / شعبة Enter your class
CheckPoint Enter the Checkpoint number Date Enter the date.
Travel Agency
Saleh owns travel agency since the year 2018. His travel
agency provides travel and tourism-related services. Some of the
common services provided by Saleh’s agency are airlines, car
rentals, hotels, travel insurance, package tours and cruise lines.
The travel and tourism industry has been affected by the
impact of the COVID-19 outbreak. To keep the business moving, Saleh decided to give
offers to the services based on its demand .
As a Trainee Programmer complete the coding in Python for all the questions.
The table below shows the services and prices of 3 different services provided by
Saleh’s travel agency.
Service Price
Package tours 2000
Car Rentals 1000
Hotel 1500
G10 Adv – CP4 Page 1 of 5 CS -Term 1(2020-21)
1. Create a DataFrame in Python to store the data in the table given. (2
marks)
2. Display your data in the table. Your output should be like Figure 1 now. (1
mark)
Figure 1
3. Each of the services are given 25% discount for the year 2020 price. Now calculate
the discount from the price and append the new price data to the table. (8
marks)
4. Display your data in the table after discounting. Your output should be like Figure
2 now. (1
mark)
Figure 2
5. Add the column headings as “Service, Price and New Price”. (2
marks)
6. Add the row headings as “Y2020, Y2020 and Y2020”. (2 marks)
7. Display your data in the table. Your output should be like Figure 3 now. (1 mark)
G10 Adv – CP4 Page 2 of 5 CS -Term 1 (2020 - 21)
Figure 3
8. Store the data in the table in a csv file named “Your student ID.csv”.
s
(3 marks)
Part 2 of 3: Copy and paste your Python code
//print your name and student id
//Put your Python code her
import pandas as pd
travel=pd.DataFrame ([["Package tour",2000],
["car",1000],["hotel",1500]])
print(travel)
discount = travel.loc[:,1]-(travel.loc[:,1]*0.25)
travel[2]=discount
print(travel)
travel.columns="Service", "Price", "New Price"
travel.index="Y2020","Y2020","Y2020"
print(travel)
G10 Adv – CP4 Page 3 of 5 CS -Term 1 (2020 - 21)
Screenshots for the displayed outputs
Output Screenshot 1 for Q2
Output Screenshot 2 for Q4
Output Screenshot for Q7
G10 Adv – CP4 Page 4 of 5 CS -Term 1 (2020 - 21)
Part 3 of 3: Save this completed document and submit back to through LMS:
Save your file as ‘Student ID_CP4.docx’
__________________________________________________________________________________________________
Submit this document and the Python file following your teachers’ instruction.
G10 Adv – CP4 Page 5 of 5 CS -Term 1 (2020 - 21)