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

  Write ijvm program to multiply two hexadecimal numbers

Write the IJVM program that multiplies two (hexadecimal) numbers. The user inputs the hex numbers and the result is printed out. The program then accepts another pair of numbers.

  Write a program in java that uses a method called quadrant

JAVA) write a program IN JAVA that uses a method called quadrant that accepts as parameters a pair of double values representing an (x, y) point and returns the quadrant number for that point. Recall that quadrants are numbered as integers from 1 to ..

  What is the java source filename extension

What is the Java source filename extension? What is the Java bytecode filename extension and write a Java statement to display the string The value is 100 to a user in a plain dialog box.

  Concept of java socket programming

Designed to asses learning outcomes and write programs that would communicate with another program running in the network

  Swing gui program to make the applet

Each button under Yes or No, when clicked, would respond with a corresponding statement printed in the South border to say

  Java program by array

Write a program that reads in a file that contains one integer per line. Each integer represents one location in the image. Assume that there are 64 rows and 64 columns in the image

  What significant justification is there for the -> operator

Dynamic type binding is closely related to implicit heap-dynamic variables. Explain this relationship. Keep your answer to 1 paragraph or less.

  An elementary calculation yields the result

An elementary calculation yields the result that theoretically, the probability of turning up 7 when two dice are thrown is 1/6, or .166666. But what if more dice are thrown? If 3 dice are thrown, what is the probability that some 2 of three sum to 7..

  Write a new queue method called movetorear

Write a new queue method called moveToRear() that moves the element currently at the front of the queue to the rear of the queue. The element that was second in line will be the new front element. Do this using methods q.enqueue() and q.dequeue()

  Develop a java program given the width, length and depth

Write the source code for each class in a separate file which must have the same name as the class name together with the extension .java. Remember also that by convention, class names commence with a capital letter.

  Write the constructor date which has 3 parameters

The Date.java class. Implement a public class Date that represents a date composed of a month , day, and a year. Declare month, day, and year as integers. Date has a constructor with 3 parameters and 4 methods. Write the constructor Date which has..

  Explain eventhandling concepts in java

Enhance the ButtonViewer program so that it prints the time at which the button was clicked.Please provide the ClickListener class in your solution.

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