Professional Documents
Culture Documents
ClassExercise 1
ClassExercise 1
ClassExercise 1
1. Jenny Nak Tapau (JNT) Enterprise is a company which helps customers deliver their food
order. They need a program to calculate the delivery charge for food pack. The charge is
based on distance in kilometer from the shop which entered by the user and number of food
pack. The delivery rate is fixed which is RM0.60 per kilometer. The charge of food pack is
RM0.50 per pack. Then the program will display the charges need to be pay by the customer.
Data set
Set-1 Set-2
Distance_km 30 40
FoodPax_No 3 5
2. Write a program that converts a given temperature from Celsius to Fahrenheit. The program
should take the temperature in Celsius as input from the user and display the equivalent
temperature in Fahrenheit as output.
Formula :
°F = (°C * 9/5) + 32
Data set
Set-1 Set-2
100 0
3. DaHantarLa (DHL) Enterprise is a company which helps customers deliver their parcels. The company
will charge for their services based on parcel weight and shipping charge. Standard charge for shipping
is RM6 per kilogram. Write a program to calculate the total amount to be charged. The program will
receive the data from the user, which is the parcel’s weight in gram. Then, the program will convert
the weight into kilograms and then calculate the amount to be charged to the customer.
Data set
Set-1 Set-2
500.5 2500