1.1.1 Calculating a price with tax
Write a program that ask the user to enter a price without tax, a tax rate and a number of items
bought, then calculate and display the tax amount of the purchase.
1.1.2 Swap two variables
Write three programs realizing an exchange of values between two variables entered by the user:
1. Using multiple assignment (Python’s own version).
2. Without use of multiple assignment (Version usable with other languages).
3. Using the + and - operators (this implies that variables are both numbers).
1.1.3 Swap of three variables
Write a program realizing the circular permutation of three variables x, y and z whose values are
entered by the user. This means that at the end of the program, x contains the initial value of y, y
contains the initial value of z and z the initial value of x.
1.1.4 Time conversion (1)
Write a program requiring a time in seconds to the user, and converts it to hours, minutes,
seconds. For example, 12334 seconds become 3 hours, 25 minutes and 34 seconds.
1.1.5 Time conversion (2)
Write a program requiring time in hours, minutes and seconds to the user and converts in
seconds. For example 3 hours, 25 minutes and 34 seconds will become 12,334 seconds.
1.2 STRUCTURES AND CONDITIONAL ITERATIVE (1)
1.2.1 Calculation of a discount
A merchant gives a 5% discount for every purchase of an amount between 100 and 500 € and 8%
thereafter. Write a program to calculate the amount of the discount on a given purchase.
1.2.2 Whether three integers are sorted
Write a program that ask for three integers x, y, z to the user, indicating whether these numbers
are in ascending order (x <= y <= z).