Java patterns question

timer Asked: Dec 11th, 2017

Question description

I need assistance with the following:

1. Write an empty method (skip anything in the method body) named 'standardDeviation' which takes an array of double values named 'observations' and an int variable named 'size' as parameters and return a double typed value.

2. Write a multi-way branch control structure using either switch or if-else if-else statements to handle a user input (char type) called 'userChoice', call methods named 'commandA', 'commandB', 'commendC' when userChoice equals 'a', 'b', 'c' respectively.

3. Write a class named 'JustHoldDataClass'. Define three instance variables 'field1' (int), 'field2' (double), 'name' (String) the class as well as the corresponding accessors and mutators of all three instance variables.

4. Write a class named 'JustHoldDataClassRunner' which only have one main method. In the main method, make an instance of the JustHoldDataClass and call accessors to set field1 to 10, field 2 to 2.0 and name to "John Smith". Finally, print a message "Good bye, John Smith!". Make sure the "John Smith" in the message is from the name field, not hard coded.

Tutor Answer

(Top Tutor) Studypool Tutor
School: Cornell University
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors