Answered step by step
Verified Expert Solution
Question
1 Approved Answer
written C++ preferably IV. Answer each question in a separate file using your compiler. Then submit the cpp file only. Do NOT submit any other
written C++ preferably
IV. Answer each question in a separate file using your compiler. Then submit the cpp file only. Do NOT submit any other files. You should also check your cpp file before submitting it using a text editor such as Notepad++. 1) Write a program that computes the earnings per shift for a security guard. A security guard charges $15 per hour before midnight and $20 after midnight. The program reads the starting time in hours and minutes and the ending time in hours and minutes. All times are between 6:00 pm, and 5:59 am, using a 12-hour clock. For example, you should consider hour 8 as 8 pm and hour 2 as 2am. I The program should check the validity of the inputs as follows. 1) Hours are from 0-11 (0 for midnight). 2) Minutes are from 0-59. 3) The start time must be before midnight. 4) The end time must be after the start time. The program should display specific warnings regarding the above when the user submits invalid input; the program should prompt the user to re-enter the times again. The program should output the total hours worked and the total earnings per shift. Example: >7h Om to 2h Om You have worked 7 hours in this shift, earning $115. 2) Write a program that calculates sin(x) using the Taylor series approximation *5 x3 sin_approx = x- + 3! + . 5! 7! A sufficient number of series terms are used such that: abs(sin_approx - sin(x)) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started