subject

Solve the following questions.
after write a method for each question, you need to write a class 'testnameclass' in a separate file, which includes a main method. in your main method, create two object of class name type and test each method you defined in the name class.

1. create a class called name that represents a person's name. the class should have fields representing the person's first name, last name, and middle initial. (your class should contain only fields for now.)

2. add two new methods to the name class: public string getnormalorder ( ) returns the person's name in normal order, with the first name followed by the middle initial and last name. for example, if the first name is "john", the middle initial is "q" and the last name is "public", returns "john q. public". public string getreverseorder ( ) returns the person's name in reverse order, with the last name preceding the first name and middle initial. for example, if the first name is "john", the middle initial is "q", and the last name is "public", returns "public, john q.".

3. write a tostring method for the name class that returns a string such as "john q. public". 4. add a constructor to the name class that accepts a first name, middle initial, and last name as parameters and initializes the name object's state with those values.

5. encapsulate the name class. make its fields private and add appropriate accessor methods to the class.

6. add methods called setfirstname, setmiddleinitial, and setlastname to your name class. give the parameters the same names as your fields, and use the this keyword in your solution.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
question
Computers and Technology, 24.06.2019 09:10
  to change the number of rows and columns displayed by the excel object a. select the object and drag a size handle on the active object. b. deselect the object and drag a size handle of the object. c. deselect the object and drag a row or column divider of the object. d. select the object and drag a row or column divider on the active object.
Answers: 2
You know the right answer?
Solve the following questions.
after write a method for each question, you need to write a cl...
Questions
question
Mathematics, 11.12.2020 07:20
question
Mathematics, 11.12.2020 07:20
question
Engineering, 11.12.2020 07:20
question
Mathematics, 11.12.2020 07:20
Questions on the website: 13722363