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, 22.06.2019 02:30
Larry sent an email to andy. andy didn't open larry's email but still understood what the message was. how did andy determine the message without opening the email?
Answers: 1
question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
question
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Answers: 1
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, 23.08.2019 16:30
question
Mathematics, 23.08.2019 16:30
question
Health, 23.08.2019 16:30
question
Mathematics, 23.08.2019 16:30
Questions on the website: 13722361