Write a program that asks the user to enter the number of employee's and depending on...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that asks the user to enter the number of employee's and depending on this number he will be asked to enter information of each employee (check sample runs). For each employee the program must ask the user to enter the employee salary and marital status. The marital status is 'M' for married and 'S' for single. After all information are entered, the program should display the following: • The number of married employee's and the average of their salaries The number of single employee's and the average of their salaries Note that: the number of employees should be positive, if the user enters an invalid value (zero or negative), he will be asked repeatedly to enter a positive number until he enters a valid one. Sample Run 1 Enter the number of employees: 6 Enter salary and status for employee 1: 1000 M Enter salary and status for employee 2: 1500 M Enter salary and status for employee 3: 1200 S Enter salary and status for employee 4: 1500 M Enter salary and status for employee 5: 3000 M Enter salary and status for employee 6: 800 5 4 married, average=1750 2 single, average=1000 Sample Run 2 Enter the number of employees: 0 Enter the number of employees: -5 Enter the number of employees: 4 Enter salary and status for employee 1: 1700 S Enter salary and status for employee 2: 2400 S Enter salary and status for employee 3: 1900 S Enter salary and status for employee 4: 1200 S ===== O married, average=0 4 single, average=1800 Write a program that asks the user to enter the number of employee's and depending on this number he will be asked to enter information of each employee (check sample runs). For each employee the program must ask the user to enter the employee salary and marital status. The marital status is 'M' for married and 'S' for single. After all information are entered, the program should display the following: • The number of married employee's and the average of their salaries The number of single employee's and the average of their salaries Note that: the number of employees should be positive, if the user enters an invalid value (zero or negative), he will be asked repeatedly to enter a positive number until he enters a valid one. Sample Run 1 Enter the number of employees: 6 Enter salary and status for employee 1: 1000 M Enter salary and status for employee 2: 1500 M Enter salary and status for employee 3: 1200 S Enter salary and status for employee 4: 1500 M Enter salary and status for employee 5: 3000 M Enter salary and status for employee 6: 800 5 4 married, average=1750 2 single, average=1000 Sample Run 2 Enter the number of employees: 0 Enter the number of employees: -5 Enter the number of employees: 4 Enter salary and status for employee 1: 1700 S Enter salary and status for employee 2: 2400 S Enter salary and status for employee 3: 1900 S Enter salary and status for employee 4: 1200 S ===== O married, average=0 4 single, average=1800
Expert Answer:
Answer rating: 100% (QA)
Answer Total answers posted by the expert is 1948 import ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
1. What are some of the potential benefits of a more formalized approach to forecasting? 2. Prepare a weekly forecast for the next four weeks for each product. Briefly explain why you chose the...
-
Dashboard Technologies Ltd. issued bonds with a face value of $70 million that mature in 15 years. The bonds carry a 5.0% interest rate and are sold at 106.00 to yield 4.45%. The bonds pay interest...
-
A functional structure is best suited when a single department has a: dominant interest. surplus of resources. project sponsor. dominant role
-
John, age 52, is overweight, smokes, and had a mild heart attack five years ago. Ignoring the advice of his physician, he refuses to exercise, lose weight, and quit smoking. John owns a $25,000...
-
Imagine you are the owner of an upscale clothing store, like Barneys in Manhattan, which was driven out of business by a 7-percent pilferage rate. What creative solutions could you identify to reduce...
-
Francine Steele and Shaun Dunn formed a partnership on 1 July 2025. Some of Steeles business assets and liabilities were assumed by the partnership, and these are listed below at both carrying...
-
Yemi??s Drug Store has four employees who are paid on an hourly basis plus time-and a- half for all hours worked in excess of 40 a week. Payroll data for the week ended February 15, 2012, are shown...
-
(a) The Treasury desk of a global bank incorporated in UK wants to invest GBP 200 million on 1st January, 2019 for a period of 6 months and has the following options: (1) The Equity Trading desk in...
-
Turner Excavation maintains a checking account and has decided to open a petty cash fund. The following petty cash fund transactions occurred during July: July 2 Established a petty cash fund by...
-
Analyze the American Red Crosss budgeting and financial management and its financial analysis practices. Analyze the current profit or loss and long-term fiscal strength of the nonprofit, in light of...
-
The Slidell Auto Supply Company entered into the following transactions during the month of July: Required: Using the basic accounting equation that we introduced in this chapter, record the...
-
Briefly discuss the controls over inventory.
-
What are the three categories of operating cash inflows under the direct method?
-
Briefly explain what is meant by share percentage using recycling as an example.
-
When is a capital expenditure proposal acceptable to a business?
-
At age 60, a man established a trust fund of R20 000 which will pay his family a regular amount at the end of each month for 12 years after his death. If he dies at age 65, what monthly sum will the...
-
What types of questions can be answered by analyzing financial statements?
-
Write a user-defined function that calculates the maximum (or minimum) of a quadratic equation of the form: f(x) = ax2 + bx + c Name the function [x, y, w] = maxormin (a, b, c). The input arguments...
-
In polar coordinates a two-dimensional vector is given by its radius and angle (r, e). Write a user-defined MATLAB function that adds two vectors that are given in polar coordinates. For the function...
-
Use MATLAB to calculate the following integrals: (a) (b) cos(x)e dx
-
Using an economic balance sheet, which of the Laws current financial assets is most concerning from an asset allocation perspective? A. Equities B. Real estate C. Fixed income Raye uses a costbenefit...
-
Using the economic balance sheet approach, the Laws economic net worth is closest to: A. $925,000. B. $1,425,000. C. $1,675,000. Raye uses a costbenefit approach to rebalancing and recommends that...
-
Raye believes the previous advisers specification for debt is incorrect given that, for purposes of asset allocation, asset classes should be: A. diversifying. B. mutually exclusive. C. relatively...
Study smarter with the SolutionInn App