The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 364 Weeks Ago, 6 Days Ago |
| Questions Answered: | 1850 |
| Tutorials Posted: | 1850 |
Graduate in Biology and Nutrition, MBA Finance
Florida State University
Aug-2000 - Jul-2007
Ass. Relationship Manager
Penn-Florida
Mar-2009 - Feb-2016
You must display your code and run the projects to demonstrate the output.
Submit each project individually..
Â
Rainfall Class:
Â
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following:
Demonstrate the class in a complete program.
Input Validation: Do not accept negative numbers for monthly rainfall figures.
Â
Payroll Class:
Â
Write a Payroll class that uses the following arrays as fields:
Â
* employeeId. An arrray of seven integers to hold employee identification numbers. The
array should be initialized with the following numbers:
5658845 4520125 7895122 8777541
8451277 1302850 7580489
Â
The class should relate the data in each array through the subscripts. For example, the number in element 0 of the hours array should be the number of hours worked by the employee whose identification number is stored in element 0 of the employeeId array. That same employeeâs pay rate should be stored in element 0 of the payRate array.
Â
In addition to the appropriate accessor and mutator methods, the class should have a method that accepts an employeeâs identification number as an argument and returns the gross pay for that employee.
Â
Demonstrate the class in a complete program that displays each employee number and asks the user to enter that employeeâs hours and pay rate. It should then display each employeeâs identification number and gross wages.
Â
Input Validation: Do not accept negative values for hours or numbers less than 6.00 for pay rate.
Â
Lottery Application:
Â
Write a Lottery class that simulates a lottery. The class should have an array of five integers named lotteryNumbers. The constructor should use the Random class (from the Java API) to generate a random number in the range of 0 through 9 for each element in the array. The class should also have a method that accepts an array of five integers that represent a personâs lottery picks. The method is to compare the corresponding elements in the two arrays and return the number of digits that match. For example, the following shows the lotteryNumbers array and the userâs array with sample numbers stored in each. There are two matching digits (elements 2 and 4).
Â
lotteryNumbers array:
(7, 4, 9, 1, 3)
user's array:
(4, 2, 9, 7, 3)
Â
In addition, the class should have a method that returns a copy of the lotteryNumbers array.
Â
Demonstrate the class in a program that asks the user to enter five numbers. The program should display the number of digits that match the randomly generated lottery numbers. If all of the digits match, display a message proclaiming the user a grand prize winner.
Â
2D Array Operations:
Write a program that creates a two-dimensional array initialized with test data. Use any primitive data type that you wish. The program should have the following methods:
Â
Â
Demonstrate each of the methods in this program.
Â
Â
Lo Shu Magic Square:
The Lo Shu Magic Square is a grid with 3 rows and 3 columns, shown in Figure 7-31. The Lo Shu Magic Square has the following properties:
Â
In a program you can simulate a magic square using a two-dimensional array. Write a method that accepts a two-dimensional array as an argument, and determines whether the array is a Lo Shu Magic Square. Test the function in a program.
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I