1- Your program should first ask the user to enter the basic salary and the extra working hours. 2- Your program should then read the price of each extra hour and tax rate from file called salary_info.txt. 3- Your program should then calculate the gross salary using the following form s Gross price = (basic salary + number of extra working hours * extra

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
Write a C program that calculates the employee salary and print the information as
follows:
1- Your program should first ask the user to enter the basic salary and the extra
working hours.
2- Your program should then read the price of each extra hour and tax rate from a
file called salary_info.txt.
3- Your program should then calculate the gross salary using the following formula:
Gross price = (basic salary + number of extra working hours * extra
working hour cost) – (basic salary * tax rate);
4- Your program should also ask the user if he is joining any medical insurance, if
yes then you ask him how much is the insurance cost and subtract it from the
gross salary.
And print the gross salary and the details of the salary (number of extra hours and
insurance cost)
Your program should include at least two functions:
1- Function calculate_salary which takes the basic salary, number of extra
working hours, extra hours cost, and the insurance cost and returns the total
salary.
2- Function print_salary_info which takes the gross salary, number of extra
working hours, and insurance cost as parameters and prints them to the screen.
Transcribed Image Text:Write a C program that calculates the employee salary and print the information as follows: 1- Your program should first ask the user to enter the basic salary and the extra working hours. 2- Your program should then read the price of each extra hour and tax rate from a file called salary_info.txt. 3- Your program should then calculate the gross salary using the following formula: Gross price = (basic salary + number of extra working hours * extra working hour cost) – (basic salary * tax rate); 4- Your program should also ask the user if he is joining any medical insurance, if yes then you ask him how much is the insurance cost and subtract it from the gross salary. And print the gross salary and the details of the salary (number of extra hours and insurance cost) Your program should include at least two functions: 1- Function calculate_salary which takes the basic salary, number of extra working hours, extra hours cost, and the insurance cost and returns the total salary. 2- Function print_salary_info which takes the gross salary, number of extra working hours, and insurance cost as parameters and prints them to the screen.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr