Quia



C++ If, if/else, and switch statementsWrite a program for each of the problems below:Crazy Al’s Computer Emporium is a retail seller of home computers. The sales staff at Crazy Al’s Work strictly on commission. At the end of the month, each sales person’s commission is calculated according to the following table:Sales this MonthCommission RateLess than $10,0005%$10,000-$14,99910%$15,000-$17,99912%$18,000-$21,99914%$22,000 or more16%For example, a salesperson with $16,000 in monthly sales will earn a 12% ($1,920.00). Another salesperson with $20,000 in monthly sales will earn a 14% commission ($2,800.00).Since the staff only gets paid once per month, Crazy Al’s allows each employee to take up to $1,500 per month in advance. When sales commissions are calculated, the amount of each employee’s advanced pay is subtracted from the commission. If any salesperson’s commissions are less than the amount of their advance, they must reimburse Crazy Al’s for the difference. Here are two examples: Susan and Peter have $21,400 and $12,600 in sales, respectively. Susan’s commission is $2,996 and Peter’s commission is $1,260. Both Susan and Peter took $1,500 in advance pay. At the end of the month, Susan gets a check for $1,496, but Peter must pay $240 back to Crazy Al’s. You have been asked to write a program that eases the task of calculating the end-of-month commission. Program must perform the following general steps:Ask the user for the salesperson’s monthly sales.Ask the user for the amount of advance pay the salesperson has drawn from the company.Determine the commission rateCalculate the commissionCalculate the salesperson’s pay by subtracting the advanced pay from the commission. If the amount is negative, the salesperson must reimburse the company.Roman Numeral ConverterWrite a program that asks the user to enter a number within the range of 1 through 10. Use a switch statement to display the Roman numeral version of that number. Input validation: Do not accept a number less than 1 or greater than 10.State AbbreviationsWrite a program that asks the user to enter one of the following state abbreviations: NC, SC, GA, FL, or AL. The program should then display the name of the state that corresponds with the abbreviation entered. Input Validation: Accept abbreviations with both letters in uppercase or both in lowercase. Display an error message if an abbreviation other than what is listed above is entered.Bank ChargesA bank charges $10 per month plus the following check fees for a commercial checking account:$.10 eachFor less than 20 checks$.08 eachFor 20-39 checks$.06 eachFor 40-59 checks$.04 eachFor 60 or more checksThe back also charges an extra $15 if the balance of the account falls below $400 (before any check fees are applied). Write a program that asks for the beginning balance and the number of checks written. Compute and display the bank’s service fees for the month.Input Validation: Do not accept a negative value for the number of checks written. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.Geometry CalculatorWrite a program that displays the following menu:Geometry Calculator Calculate the Area of a CircleCalculate the Area of a RectangleCalculate the Area of a TriangleQuitEnter your choice (1-4):If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the following formula:Area = ∏r2Use 3.14159 for ∏ and the radius of the circle for r. If the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. Use the following formula:Area = Length * WidthIf the user enters 3 the program should ask for the length of the triangle’s base and its height, and then display its area. Use the following formula:Area = Base * Height * .5If the user enters 4, the program should end.Input Validation: Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. Do not accept negative values for the circle’s radius, the rectangles length or width, or the triangle’s base or height.This problem has 3 parts. I have divided it up so that it will make it easier to write.Part 1:An internet service provider has three difference subscription packages for its customers:Package A:For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.Package B:For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour.Package C:For $19.99 per month unlimited access is provided.Write a program that calculates a customer’s monthly bill. It should ask which package the customer has purchased and how many hours were used. It should then display the total amount due.Input Validation: Be sure the user only selects package A, B, or C. Also, the number of hours used a month cannot exceed 744.Part 2:Modify the program so that it also displays how much money Package A customers would save if they purchased packages B or C, and how much money package B customers would save if they purchased package C. If there would be no savings, no message should be printed.Part 3:Months with 30 days have 720 hours, and months with 31 days have 744 hours. February, with 28 days, has 672 hours. Enhance the input validation of the Internet Service Provider program by asking the user for the month (by name), and validating that the number of hours entered is not more than the maximum for the entire month. Here is a table of the months, their days, and number of hours in each. MonthDaysHoursJanuary31744February28672March31744April30720May31744June30720July31744August31744September30720October31744November30720December31744 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download