Create appropriate get and set methods to retrieve values

Assignment Help JAVA Programming
Reference no: EM131251225

Prerequisite: Read what an API is in the textbook Introduction to Programming Using Java by David J. Eck on pages 142-143.

When solving the problems in this section, you must follow the application programming interface (API) expected in each problem. You should implement all the attributes and operations mentioned in the API.

Note that there is no main method in the APIs. That is, you should not perform any data processing within the main method. You should rather use the main method to test other methods, prompt the user for some inputs, and display the results returned by your methods.

Create a class named AddressBook that has the following field names:

firstName, middleName, lastName, homeAddress, businessPhone, homePhone, cellphone, skypeId, facebookId, and personalWebSite.

Use appropriate data types to store the values for these fields in AddressBook objects.

Create appropriate get and set methods to retrieve and assign values to these names. For example, getMiddleName(viveAddressBook) should return the middle name of the person Vive. Similarly, vive.setPersonalWebsite(url) should set the personal website of the person Vive to the specified URL object.

Using the get and set methods, create a comparison method compareNames(name1, name2) that compares the first, middle, and last names of strings name1 and name2. Assume that name1 and name2 follow the following format: "FirstName M. LastName".

Test your program for correct, partially correct (e.g., name string without the middleName), and incorrect inputs (e.g., phone number containing special characters).

A group of AU friends decide to run the Banff, Alberta, Marathon. Their names, times (marathon completion time in minutes), and number of years participated are given below:

1

Elena Brandon

341

1

2

Thomas Molson

273

2

3

Hamilton Winn

278

5

4

Suzie Sarandin

329

7

5

Philip Winne

445

9

6

Alex Trebok

275

3

7

Emma Pivoto

275

4

8

John Lenthen

243

1

9

James Lean

334

1

10

Jane Ostin

412

1

11

Emily Car

393

4

12

Daniel Hamshire

299

4

13

Neda Bazdar

343

3

14

Aaron Smith

317

6

15

Kate Hen

265

8

Extend the AddressBook class from Problem 1 to store the additional data. Now, write a method to find the fastest runner. Print the name, address, and his/her time (in minutes) on three separate lines.

Find the second fastest runner. Print the name, address, his/her time (in minutes), and the difference in time with the fastest runner.

Compute the average time of completion taken by these runners.

Finally, print the name and number of years participated for each runner if the runner's time of completion is equal to or better than the average time of completion.

Solve the following problem using a program: Suppose you save $100 each month into a savings account with an annual interest rate of 5%. Thus, the monthly interest rate is 0.05/12 = 0.00417.

After the first month, the value in the account becomes 100 * (1 + 0.00417) = 100.417
After the second month, the value in the account becomes (100 + 100.417) * (1 + 0.00417) = 201.252
And after the third month, the value in the account becomes (100 + 201.252) * (1 + 0.00417) = 302.507
... and so on.

Write a program that randomly generates monthly savings amounts for the 15 runners in Problem 4. Each monthly saving should be in the range of $100 to $800. Extend the AddressBook class to store the monthly savings generated by the random number generator.

Then, display the final account value for each of the 15 runners.

Google Inc. is looking to recruit three of the Boston runners. The criteria for selection are as follows:

Average final marks in bachelor's degree (store up to 2 decimal places). The fifteen candidates have the following grades: 82.30%, 85.10%, 77.77%, 69.93%, 93.03%, 88.61%, 55.99%, 87.49%, 88.00%, 91.20%, 66.79%, 76.65%, 55.89%, 90.01%, and 87.9%.

Ability to communicate as one of the three values - "excellent", "average", and "poor". The fifteen candidates have the following ability to communicate, respectively: poor, poor, average, average, average, poor, excellent, excellent, excellent, average, excellent, average, excellent, excellent, poor.

Innovation as one of the two values - "brilliant" and "average" (store as a Boolean; brilliant = true and average = false). The fifteen candidates have the following innovative abilities: brilliant, average, average, average, brilliant, brilliant, average, brilliant, average, brilliant, average, brilliant, brilliant, average, average.

Ability to regulate one's own skill as a probability value between 0 and 1.0 - 1.0 implies excellent regulatory capabilities and 0.0 implies no skills to regulate (store as a double). The fifteen candidates have the following regulatory abilities: 0.5, 1.0, 0.8, 0.0, 1.0, 0.7, 0.8, 0,9, 0.5, 0.6, 0.3, 0.2, 0.5, 0.3, 0.8.

Store these values for the fifteen candidates in an extended AddressBook class. In general, Google will not consider a candidate with average marks of less than 85%. Google will consider a candidate with average marks of less than 85% only if the candidate at least has 0.5 regulatory abilities and at least ‘average' ability to communicate. Google will only consider a candidate with poor communication ability if the candidate has a ‘brilliant' innovation capability. Write a program that will help Google to programmatically determine eligibility of the fifteen candidates for these positions, and print the output on the console.

Reference no: EM131251225

Questions Cloud

Fit a predictive model based on linear regression : Describe which data you used from the Spending and Bankruptcy Data Set, and what modifications you had to make to that data.
How might a culture perception of time influence views : How might a culture's perception of time influence views of individuals in later adulthood? What other cultural differences might impact a people's view of aging? This week, you explore different cultures' perspectives on aging and consider how th..
Guarantee the success of a business : While there is no blueprint or checklist that one can follow to guarantee the success of a business, much can be learned from analyzing those that have failed and those that have flourished during the same time period and under similar circumstanc..
Differences between domestic and international business : Write a memo in which you explain to Richard the differences between domestic and international business. -Explain the risks and other differences that Richard's firm will likely encounter if it expands abroad.
Create appropriate get and set methods to retrieve values : Create appropriate get and set methods to retrieve and assign values to these names. For example, getMiddleName(viveAddressBook) should return the middle name of the person Vive.
Difference college success and career success : What is the difference college success and career success? does a degree give you an edge over others?
Years of inception versus brand name : Years of inception vs. brand name: which is more effective for consumers - Consumers rely on many aspects in their decision to buy and/or dispose of products or services.
Considering preparing segmented information : Suppose that management is considering preparing segmented information but is unsure on how to identify a segment and is unsure on why the information is important. Outline a brief memo to management explaining the importance of segmented information..
Prove point while honestly interacting with opposing views : Body: its structured development should mirror your outline. This is where you prove your point while honestly interacting with opposing views and major objections. Make sure to include transitional sentences toinsure a flow and sense of unity fro..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd