Page 1 of 1

Question 1 [15] At Mthatha Airport to rent a car, it costs R4.50 per kilometre for each of the first 200 kilometres and

Posted: Tue Jul 12, 2022 8:03 am
by answerhappygod
Question 1 15 At Mthatha Airport To Rent A Car It Costs R4 50 Per Kilometre For Each Of The First 200 Kilometres And 1
Question 1 15 At Mthatha Airport To Rent A Car It Costs R4 50 Per Kilometre For Each Of The First 200 Kilometres And 1 (99.72 KiB) Viewed 142 times
Please help with above two codes in c++ Urgently needed Thank you.
Question 1 [15] At Mthatha Airport to rent a car, it costs R4.50 per kilometre for each of the first 200 kilometres and R2.50 per kilometre for each kilometre over 200. Now, write a function called carrentalCost that takes the number of kilometres travelled as a parameter and returns the rental cost. Next, write the main program that uses the function carrentalCost. The program should read the number of kilometres from the keyboard and print out the car rental cost. The program should then read another number of kilometres from the keyboard and print the cost. The program should continue to read the number of kilometres from the keyboard, printing the cost until the number of kilometres entered is 0, then the program should stop. [15] Question 2 [25] Write a single program to do all of the following: First your program should declare an array of integers using an initializer list. Next, the program should sort the array into decreasing order. Then the program should print out the elements of the sorted list. Finally, the program should search the array to see whether integer 30 is present. [25]