0% found this document useful (0 votes)
6 views29 pages

AZRA - PROJECT PROBLEMS

The document outlines a series of programming tasks for students to complete using Python, focusing on various practical problems such as data logging, parcel delivery validation, school trip cost calculations, computer assembly estimates, bus punctuality statistics, student marks recording, baguette ordering, car insurance pricing, and car buying services. Each task requires the development of a program that includes data validation, appropriate prompts, and clear output messages. The document emphasizes the importance of meaningful variable names and thorough testing of each task.

Uploaded by

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

AZRA - PROJECT PROBLEMS

The document outlines a series of programming tasks for students to complete using Python, focusing on various practical problems such as data logging, parcel delivery validation, school trip cost calculations, computer assembly estimates, bus punctuality statistics, student marks recording, baguette ordering, car insurance pricing, and car buying services. Each task requires the development of a program that includes data validation, appropriate prompts, and clear output messages. The document emphasizes the importance of meaningful variable names and thorough testing of each task.

Uploaded by

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

PRACTICAL PROBLEMS

AZRA PARY, 11A


PROBLEMS FOR PROJECT
Choose any one problem and write the program using Python language.

Q1) Write and test a program to complete the three tasks.


TASK 1
A data logger records the temperature on the roof of a school
twice a day, at midday and midnight. Input and store the
temperatures recorded for a month. You must store the
temperatures in two one dimensional lists, one for the midday
temperatures and one for the midnight temperatures. All the
temperatures must be validated on entry and any invalid
temperatures rejected. You must decide your own validation
rules. You may assume that there are 30 days in a month.

TASK 2
Calculate the average temperature for midday and the average
temperature for midnight. Output these averages with a suitable
message for each one.
TASK 3
Select the day with the highest midday temperature and the day
with the lowest midnight temperature. Then output each of these
temperatures, the corresponding day and a suitable message.
Your program must include appropriate prompts for the entry of
data. Error messages and other outputs need to be set out clearly
and understandably. All variables, constants and other identifiers
must have meaningful names. Each task must be fully tested.

You will need to complete these three tasks. Each task must be
fully tested.

TASK 1 – Check the size and weight of a single parcel


Each parcel must obey the following rules to be accepted for
delivery:
• each dimension must be no more than 80 cm
• the sum of the three dimensions must be no more than 200 cm
• the weight of the parcel must be between one and ten
kilograms inclusive
Input and store the weight and dimensions for one parcel. All the
dimensions and the weight must be validated on entry and an
unsuitable parcel rejected.
Output if the parcel is accepted or rejected. If rejected, output all
the reasons why the parcel was rejected.

TASK 2 – Check a customer’s consignment of parcels


Input and store the number of parcels in the consignment.
Calculate the number of parcels accepted and the total weight of
the parcels accepted. For each parcel that was rejected, output all
the reasons why that parcel was rejected.
Output the number of parcels accepted and the total weight of
parcels accepted.
Output the number of parcels rejected.
TASK 3 – Calculate the price for a customer’s consignment of
parcels
Extend TASK 2 to also calculate the price for each parcel, using
the following rules:
• 1 kg to 5 kg inclusive costs $10
• Each 100 grams over 5 kg, up to 10 kg, costs an extra $0.10
Your output should also include the price for each parcel
accepted and the total price of the consignment.
Q4)
A teacher is planning a school trip to a theme park at the end of
term. You have been asked to write a program to work out the
cost per student, to record those who are going and whether they
have paid. The maximum number of students who can go on the
trip is 45.

Write and test a program for the teacher.

• Your program must include appropriate prompts for the entry


of data.
• Error messages and other output need to be set out clearly.
• All variables, constants and other identifiers must have
meaningful names.

You will need to complete these three tasks. Each task must be
fully tested.

TASK 1 – Work out the cost.


The cost of the trip for each student is a share of the cost of a
coach plus the cost of entry to the
theme park. The total cost of the coach will be $550. The entry
cost to the park is $30 for each
student. The theme park gives one free ticket for every ten that
are bought, which must be taken into consideration. Set up a
program that:
• stores the cost of the coach
• stores the cost of an entry ticket
• inputs the estimated number of students taking part, this must
be validated on entry and an unsuitable entry rejected
• calculates and outputs the recommended cost per student to
ensure the trip does not make a loss.

TASK 2 – Record the students who are going and whether they
have paid.
Input and store the names of the students who have asked to go
on the trip up to the maximum number allowed. Input and store
whether each student has paid. Enable printouts to be produced
to show students who have not paid and those who have paid.
TASK 3 – Work out final costs.
Not all students will end up going on the trip, for example they
might not have paid. Modify the program so that it gives overall
totals for the costs charged and the amount of money collected.
Output whether the school trip has made a profit or loss, or has
broken even, and the amount of the final balance.
Q5)
A computer shop will build a computer from components to
meet a customer’s requirements. For each request for a computer
to be built, an estimate of the cost is produced. The component
stock level is checked; if all the components are in stock, a firm
order to build the computer can be placed.
A program is required to work out the cost of the computer,
update the stock levels and provide a daily summary of orders
for the shop owner.
Write and test a program or programs for the computer shop
owner.
• Your program or programs must include appropriate prompts
for the entry of data.
• Error messages and other output need to be set out clearly and
understandably.
• All variables, constants and other identifiers must have
meaningful names.

You will need to complete these three tasks. Each task must be
fully tested.

TASK 1 – Produce an estimate.

Write a program for TASK 1 to calculate the cost of building a


computer using these components
The customer makes a choice for each component and an
estimate is produced. The estimate must show a unique estimate
number, the components chosen and the price of each
component. The estimate must also show the total cost of the
computer, which is calculated as the sum of the cost of the
components chosen plus 20%.

TASK 2 – Place an order.


Using your estimate from TASK 1, check if the components
required are in stock. If all the components are in stock then
update the stock levels. Add the unique estimate number to the
list of order numbers. Add the customer’s details and today’s
date to the estimate details to finalize the order. Print two copies
of the order, one for the customer and one for the shop.
TASK 3 – Summaries the day’s orders.
Extend TASK 2 to provide an end of day summary showing the
number of orders made, the total number of each component
sold and the value of the orders.

Q6)
The local high school uses buses to transport students to school.
There are six bus routes labeled A to F. You have conducted a
survey to analyses the punctuality statistics of these buses over
afour-week period. The data from the survey are shown in the
table:

Positive numbers represent minutes early, negative numbers


represent minutes late and 0 represents the bus having been on
time.
Write and test a program or programs for the local high school.
• Your program or programs must include appropriate prompts
for the entry of data; data must be validated on entry.
• Error messages and other output need to be set out clearly and
understandably.
• All variables, constants and other identifiers must have
meaningful names.
You will need to complete these three tasks. Each task must be
fully tested.

Task 1 – Setting up the data storage.


Using arrays set up a system to enable data for each bus route to
be entered covering each day of a four-week period. It must be
possible to enter the data supplied or your own set of data,
usingsuitable prompts as necessary.

Task 2 – Working out the statistics.


Extend your program so that the following statistics for the four-
week period may be calculated and output:
• the number of late arrivals for each bus route
• the average number of minutes late for each bus route
• the bus route with the highest number of days on which it was
late
• the average number of minutes late for each bus route, using
only data from days on which it was late
All the results should be displayed with appropriate annotation.
Task 3 – Checking specific days.
Extend the program as follows:
• Allow the user to input a specific day, for example Fri3, to be
used for analysis of data.
• Find and display how many buses were late on this particular
day.
• For each late bus, display the route label and how late the bus
was on this particular day.
Q7)
A teacher needs a program to record marks for a class of 30
students who have sat three computer science tests.
Write and test a program for the teacher.
appropriate prompts for the
entry of data.

and understandably.
meaningful names.
You will need to complete these three tasks. Each task must be
fully tested.
TASK 1 – Set up lists
Set-up one dimensional lists to store:

o Test 1 is out of 20 marks


o Test 2 is out of 25 marks
o Test 3 is out of 35 marks
ent
Input and store the names for 30 students. You may assume that
the students’ names are unique.
Input and store the students’ marks for Test 1, Test 2 and Test 3.
All the marks must be validated on entry and any invalid marks
rejected.
TASK 2 – Calculate
Calculate the total score for each student and store in the array.
Calculate the average total score for the whole class.
Output each student’s name followed by their total score.
Output the average total score for the class.
TASK 3 – Select
Select the student with the highest total score and output their
name and total score.
Q8)
A baguette ordering service allows customers to order filled
baguettes. There are two sizes of baguette: 30 cm and 15 cm.
Baguettes are available as white, brown or seeded bread.
Baguettes have one filling and can have up to three salad items
added.
Filling and salad choices are:
Customers choose their baguette options. They then confirm
their order, alter their choices or choose not to proceed.
Each day the ordering service calculates the number of each:
• size of baguette sold
• type of bread (white, brown or seeded) sold
• filling sold.
Write and test a program or programs for the baguette ordering
service.
• Your program or programs must include appropriate prompts
for the entry of data; data must be validated on entry.
• Error messages and other output need to be set out clearly and
understandably.
• All variables, constants and other identifiers must have
meaningful names.
You will need to complete these three tasks. Each task must be
fully tested.
Task 1 – Ordering.
Customers are given choices on size, type of bread, filling and
salad items as shown. Only valid
choices can be accepted. The customer is asked to confirm their
order, alter their choices or choose not to proceed. If the
customer confirms their order they are given a unique order
number. Display the baguette ordered and the order number.
Task 2 – Recording the choices.
Extend TASK 1 to record totals for the size, types of bread and
fillings sold that day and calculate the total number of baguettes
sold that day.
Task 3 – Finding the most and least popular baguette fillings.
Using your results from TASK 2, display the most popular and
least popular fillings as a percentage of the total number of
baguettes sold that day.
Q9)
A car insurance system allows customers to check how much it
would cost to buy insurance for a car for twelve months. The
starting price of the car insurance is $500. The actual price a
customer pays for the car insurance changes depending upon
this information:
• engine size of car
• value of car
• where car is kept overnight
• number of kilometers (km) driven a year
• age of driver
• years insured without an insurance claim
The actual price is calculated by:
• finding the total of the percentage changes for the customer
using Table 1
• applying this total percentage change to the starting price of
the car insurance
• applying the years without claim discount percentage for the
customer using Table 2.
Write and test a program or programs to calculate the price for a
customer to insure a car.
• Your program or programs must include appropriate prompts
for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and
understandably.
• All variables, constants and other identifiers must have
meaningful names.
You will need to complete these three tasks. Each task must be
fully tested.
Task 1 – Calculate the price to insure a car.
Write a program to obtain the required information from a
customer and calculate the price to insure the car.
Display the price to insure the car. Display the total percentage
change calculated from Table 1, and the years without claim
discount percentage from Table 2 separately.
Task 2 – New customer discount.
Extend Task 1 to include an additional discount of 10% off the
price to any new customer who is aged between 26 and 70
inclusive, who also has 2 or more years without a claim. Display
the amount of money this would save and the new price.

Task 3 – Adding an extra driver.


Customers can add one extra driver. The age of the extra driver
may increase the price. The new price is calculated by applying
the percentage price change for the age of the extra driver from
Table 1 to the price.
Extend Task 2 to calculate and display the new price including
an extra driver if required.

Q10) A car buying service helps customers calculate the price of


buying a new car from Snazzy Autos. There are three models of
car available: hatchback, saloon and estate. A car can be bought
with optional extras.

Snazzy Autos customers buying a new car can trade in an old


car. Offers from Rs 10000 to Rs 1.00 lakh can be made for an
old car. If an old car is not traded in, then a discount of 5% is
taken off the price of the new car and any optional extras. In
addition, repeat customers are offered a discount of 10% off any
optional extras and 10% off the price of the new car before
trade-in.
Customers can either pay for the new car in full or make
monthly payments over several years.
Write and test a program or programs for the car buying service.
• Your program or programs must include appropriate
prompts for the entry of data; data must be validated on
entry.
• Error messages and other output need to be set out clearly
and understandably.
• All variables, constants and other identifiers must have
meaningful names.
You will need to complete these three tasks. Each task must be
fully tested.
Task 1 – Calculate the price
Customers choose the model of car and select any optional
extras required. Only valid choices can be accepted for the
model and the extras. The customer is asked if they are an
existing customer and if they have an old car to trade in. If the
customer trades in an old car the amount offered by Snazzy
Autos is entered. The price of the new car including model and
extras is displayed. Any discount or trade-in amounts are
displayed and the total price to pay is calculated and displayed.
Task 2 – Calculate the payment(s)
Extend Task 1 to display these payment methods:
• full amount paid now customer receives cash back of 1%
on the total price
• equal monthly payments are made over four years with no
extra charge
• the total price is increased by 5%; equal monthly
payments are made over seven years.
For each payment method display: the total amount to pay, the
amount of each payment, the number of payments and cash back
where appropriate.
Task 3 – New full amount payment offers
Extend Task 2 to offer customers who decide to pay the full
amount now either the 1% cash back or the chosen optional
extras free. Customers are shown the offer that is the best value
first and the other as an alternative. Details of each offer must be
displayed in full.

You might also like