A bicycle shop, called Gal Bicycle Rentals, rents bieyeles by the day at different irates throughout the year according to the season (See Table The shop gives a 25% discount if the rental period s greater than 7 days Renters must also pay OMR20 returnable deposit for each bicycle rented. Write a program to input the season and the number of days of rental, and then calculate die total charge thal includes the deposit and print a bill for each bicycle rental order (See Figure 1). Your program should validate the input data and give appropriate messages for invalid data (See Fagures 1(b) and 1(e)) Only the dewenbod four scason values are accepted, and the munber of days should be a positive nimber, Your program should print the eurrent date as the date of the onler in the generated bill (Tip: use the appropriate funetion from the datetime module of the python standard libeary).

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter2: Problem Solving Using C++using
Section2.5: Variables And Declaration Statements
Problem 10E
icon
Related questions
icon
Concept explainers
Question
7:46 O
* A 51%
The purpose of this assignment is to practice the use of Python input/output, modules and selection features to develop a
solution to the given problem. Your solution will consist of two parts: (i) your name, university id, section mumber and your
program design (written as comments at the beginning of your program by defining the purpose, input output data and the
algorithm), (ii) The corresponding Python program.
Problem Definition
A bicyele shop, called Gal Bicycle Rentals, rents bicyeles by the day at different rates throughout the year according to the
season (See Table 1). The shop gives a 25% discount if the rental period is greater than 7 days. Renters must also pay
OMR20 returnable deposit for each bicycle rented.
Write a program to input the season and the number of days of rental, and then calculate the total charge that includes the
deposit and print a bill for each bicycle rental order (Sec Figure 1).
Your program should validate the input data and give appropriate messages for invalid data (See Figures 1b) and I(c))
Only the deserbod four season values are accepted, and the number of days should be a positive number, Your program
should print the current date as the date of the onder in the generated bill (Tip: use the appropriate function from the
datetime module of the python standard library).
Your program should
a) Use meaningTul vanable names, and meaningful comments to deseribe the solution
b) Use an appropriate message and a suitable format to display the result (see Figure 1)
e) Display the floating-point numbers up to 3 decimal places
d) Name the file containing your Python source code HW2XANXX.py:where your ovwn student ID should replace
the string "xxxxx" For example a student with ID 75600 should submit a file called HW2 75600.py, Upload your
Python program to Moodle.
Table 1: Daily Rental rates
Season
Charge (OMR)
2750
2.000
Autumn (September to November)
Winter (December to February)
Spring (March to May)
Summer (June to August)
3.500
3.000
le t dal iyle etal
(Our priies tese osesan)
cour
Cange oy
ap er to Moveer)
Sebrery)
Aut detee ve
EMinter Dereer te w
ring (rgh e
Smer
2.00
seson (tes, ter riG !
Please son (ed .uleedapri ter
2easnterthe her of eys
o te allect yr iie
)
enter the er or d
del Birl Rental 1
sevcle t
stal
Grder ate 2
order dat
7-09-28
teer Cest co)
sable bepesir (
Nuete orDys
Cy for your
Figure 1(a) valid data (resting for 12 days in winter)
Figure Ih) valid datafnenting for S davs i smer)
II
Transcribed Image Text:7:46 O * A 51% The purpose of this assignment is to practice the use of Python input/output, modules and selection features to develop a solution to the given problem. Your solution will consist of two parts: (i) your name, university id, section mumber and your program design (written as comments at the beginning of your program by defining the purpose, input output data and the algorithm), (ii) The corresponding Python program. Problem Definition A bicyele shop, called Gal Bicycle Rentals, rents bicyeles by the day at different rates throughout the year according to the season (See Table 1). The shop gives a 25% discount if the rental period is greater than 7 days. Renters must also pay OMR20 returnable deposit for each bicycle rented. Write a program to input the season and the number of days of rental, and then calculate the total charge that includes the deposit and print a bill for each bicycle rental order (Sec Figure 1). Your program should validate the input data and give appropriate messages for invalid data (See Figures 1b) and I(c)) Only the deserbod four season values are accepted, and the number of days should be a positive number, Your program should print the current date as the date of the onder in the generated bill (Tip: use the appropriate function from the datetime module of the python standard library). Your program should a) Use meaningTul vanable names, and meaningful comments to deseribe the solution b) Use an appropriate message and a suitable format to display the result (see Figure 1) e) Display the floating-point numbers up to 3 decimal places d) Name the file containing your Python source code HW2XANXX.py:where your ovwn student ID should replace the string "xxxxx" For example a student with ID 75600 should submit a file called HW2 75600.py, Upload your Python program to Moodle. Table 1: Daily Rental rates Season Charge (OMR) 2750 2.000 Autumn (September to November) Winter (December to February) Spring (March to May) Summer (June to August) 3.500 3.000 le t dal iyle etal (Our priies tese osesan) cour Cange oy ap er to Moveer) Sebrery) Aut detee ve EMinter Dereer te w ring (rgh e Smer 2.00 seson (tes, ter riG ! Please son (ed .uleedapri ter 2easnterthe her of eys o te allect yr iie ) enter the er or d del Birl Rental 1 sevcle t stal Grder ate 2 order dat 7-09-28 teer Cest co) sable bepesir ( Nuete orDys Cy for your Figure 1(a) valid data (resting for 12 days in winter) Figure Ih) valid datafnenting for S davs i smer) II
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning