Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1: program Pay.java to calculate the amount of money a person would earn over a period of time. Assume the current salary is $50,000,

Problem 1:

program Pay.java to calculate the amount of money a person would earn over a period of time. Assume the current salary is $50,000, salary would increase 4% a year and there is also a yearly bonus between $2000 and $6000.For the purpose of the calculation, the bonus will be a random number between $2000 and $6000.

(7 pt) Print out the person's yearly earnings for the next 5 years.

(3 pt) Determine the number of years needed to accumulate 1 million dollars in total overall earnings (Use the appropriate loop structure to solve this. Do not use break.)

Sample output:

YearSalaryBonusYear TotalOverall Total

1$52,000$3,242$55,242$55,242

2$54,080$2,771$56,851$112,093

3$56,243$5,325$61,568$173,661

4$58,493$5,200$63,693$237,354

5$60,833$5,912$66,745$304,099

It will take 14 years to accumulate 1 million dollars in overall total earnings.

Problem 2:

program Matrix.java that performs the following,

(5 pt) Define a method called printStarMatrix which takes two parameters, number of rows (m) and columns(n), then print a m by n matrix of stars.

(3 pt) Define a method called printBorder which takes 3 parameters, number of rows (m), columns(n), and a border character (ch), then print a m by n matrix bordered with the character.

(2 pt) Take user input of number of rows, columns and border character, call printStarMatrix and printBorder methods to print the matrix. See sample output.

Sample output:

Enter number of rows: 3

Enter number of columns: 6

Enter Border character: x

Star Matrix:

******

******

******

Matrix with Border

xxxxxx

xx

xxxxxx

Problem 3

program GradeArray.java that performs the following,

(2 pt) Ask user to input 10 students' scores on a test. (100-point test) and save the scores in an array.

(4 pt) Iterate through the array to find the average and highest of these scores, print them out.

(2 pt) Count how many students scored above the average and print out the count.

(2 pt) Instructor decided to curve the student's scores using adjustment to highest score curving method (highest score is considered 100, i.e, takes the raw score multiple by 100 divide by the highest score as the new score for each student). Print out the scores after curving and calculate the new average.

Sample output:

Enter score: 90

Enter score: 70

Enter score: 58

Enter score: 45

Enter score: 95

Enter score: 80

Enter score: 86

Enter score: 75

Enter score: 68

Enter score: 81

Average:74.80

Highest score: 95

Number of student scored above average: 6

Scores after curving: 94.773.761.147.4100.084.290.578.971.685.3

New average: 78.74

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

Recommended Textbook for

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions

Question

1-3. Define marketing research.

Answered: 1 week ago