Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design an algorithm for each of the following problems. All algorithms in this lab should include input steps, processing steps (e.g. steps performing calculations) and

Design an algorithm for each of the following problems. All algorithms in this lab should include input steps, processing steps (e.g. steps performing calculations) and output steps.

Problem 1

The retirement account of each employee in a company receives money from two sources each month. First, each employee contributes 6% of his salary to his own retirement account. Second, the company also makes a contribution equal to 3 % of the employees salary to the account. For example, suppose the monthly salary of an employee is $2000. The employees own contribution will be $120, while the companys contribution will be $60. They need a program to manage the retirement accounts. The user will enter the monthly salary of an employee. The program will calculate and display the following items: amount of money contributed by the employee each month, amount of money contributed by the company each month, total contribution each month (i.e. the sum of employees and companys contributions). Use 6% and 3% directly in the algorithm to calculate employees and companys contributions. There is no need to ask the user to enter these rates.

Problem 2

All jackets in a store are on sale now. They need a program to process discounts. The user will enter the original price of a jacket and the discount percentage using a decimal (for example: if it is 25% off, the user should enter 0.25; if it is 30% off, the user should enter 0.30, etc). The program will use the original price and the discount percentage entered by the user to calculate the sale price (i.e. the reduced price). It will all calculate sales tax and total amount due. Use 0.07 as sales tax rate. There is no need to ask the user to enter sales tax rates. Display sale price, sales tax and total amount due.

Problem 3

A group of high school students are selling pizza and soda during a basketball game to raise fund for a field trip. Pizza is $3.50 per slice and soda is $1.25 per cup. Design a program to do the following. Ask the user to enter number of cups of soda and number of slices of pizza ordered by the customer. The program will calculate and display the total amount due from the customer.

Problem 4

A company is sending its employees to receiving training on some new equipment. The training includes two parts: part A and part B. The cost for attending part A is $100 while the cost for part B is $150. There are three options for each attendee:

Option A: Attend part A only

Option B: Attend part B only

Option C: Attend both part A and part B

Attendees who choose option C get a 20% discount. Write a program to calculate how much training fee the company needs to pay in total. The program should ask the user to enter the number of people who choose option A, option B and option C, respectively. It will calculate and display the total training fee the company needs to pay.

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

3. Have the group identify common themes.

Answered: 1 week ago

Question

6. The cost of the training creates a need to show that it works.

Answered: 1 week ago