Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Write C+ program using only codeblocks 9.Write a program to request two times given in 24-hour clock format and find the time (in hours and

Write C+ program using only codeblocks
image text in transcribed
9.Write a program to request two times given in 24-hour clock format and find the time (in hours and minutes) that has elapsed between the first time and the second time. You may assume that the second time is later than the first time. Each time is represented by two numbers: e.g. 16 45 means the time 16:45, that is 4:45 p.m. For example, if the two given times are 16 45 and 23 25 your answer should be 6 hours 40 minutes. Modify the program so that it works as follows: if the second time is sooner than the first time, take it to mean a time for the next day. For example, given the times 20:30 and 6:15, take this to mean 8.30 p.m. to 6.15 a.m. of the next day. Your answer should be 9 hours 45 minutes. 11. A bank pays interest based on the amount of money deposited. If the amount is less than $5,000, the interest is 4% per annum. If the amount is $5,000 or more but less than $10,000, the interest is 5% per annum. If the amount is $10,000 or more but less than $20,000, the interest is 6% per annum. If the amount is $20,000 or more, the interest is 7% per annum. Write a program to request the amount deposited and print the interest earned for one year Write a program to prompt for the name of an item, its previous price and its current price. Print the percentage increase or decrease in the price. For example, if the previous price is $80 and the current price is $100, you should print increase of 25%; if the previous price is $100 and the current price is S80, you should print decrease of 20%. A country charges income tax as follows based on one's gross salary. No tax is charged on the first 20% of salary. The remaining 80% is called laxable income. Tax is paid as follows: 12. 13, 10% on the first $15,000 of taxable income; 20% on the next $20,000 of taxable income; 25% on all taxable income in excess of $35,000; Write a program to read a value for a person's salary and print the amount of tax to be paid. Also print the average tax rate, that is, the percentage of salary that is paid in tax. For example, on a salary of $20,000, a person pays $1700 in tax. The average tax rate is 1700/20000*100 = 8.5%. 14. A dentist charges as follows: General checkups cost $75. If no work needs to be done, there is no further charge. Otherwise, the charge is $75 per hour for the labour plus the cost of materials, with a minimum charge of S120. If any work is done, there is no charge for a general checkup. Write a program to read values for hours worked and the cost of materials (either of which could be 0) and print the charge for the treatment. Write a program which will allocate and compound discounts to a product based on the product's code, calculate the new price of product, and print the product's code and new price. 15. Product Code Discount Under 3000 Under 2000 Under 1000 5% 3% 2% 16. Write an algorithm to calculate the cost of importing a car. First a tax of 2% of the original cost of the car is added to the cost of the car to give a landing cost. Then, if the car is 5 years or less a transportation tax of 15% of the original cost of the car is charged. If the car is older than 5 years, the transportation tax is 20%. The final cost of importing the car is calculated by adding the transportation tax to the landing cost

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students explore these related Databases questions