Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, kenken2583
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
image
Computers and Technology, 23.06.2019 02:00, vivian2020
Read this excerpt from helen keller’s autobiography, the story of my life. have you ever been at sea in a dense fog, when it seemed as if a tangible white darkness shut you in, and the great ship, tense and anxious, groped her way toward the shore with plummet and sounding-line, and you waited with beating heart for something to happen? i was like that ship before my education began, only i was without compass or sounding-line, and had no way of knowing how near the harbour was. "light! give me light! " was the wordless cry of my soul, and the light of love shone on me in that very hour. . the morning after my teacher came she led me into her room and gave me a doll. the little blind children at the perkins institution had sent it and laura bridgman had dressed it; but i did not know this until afterward. when i had played with it a little while, miss sullivan slowly spelled into my hand the word "d-o-l-l." i was at once interested in this finger play and tried to imitate it. when i finally succeeded in making the letters correctly i was flushed with childish pleasure and pride. running downstairs to my mother i held up my hand and made the letters for doll. i did not know that i was spelling a word or even that words existed; i was simply making my fingers go in monkey-like imitation. in the days that followed i learned to spell in this uncomprehending way a great many words, among them pin, hat, cup and a few verbs like sit, stand and walk. based on this excerpt, which words best describe helen keller?
Answers: 2
image
Computers and Technology, 23.06.2019 23:00, Maya629277
Lucas put a lot of thought into the design for his company's new white paper. he made sure to include repeating design elements such as color schemes and decorative images. his goal was to a. add symmetry b. create a unified publication c. provide consistency d. save money
Answers: 1
image
Computers and Technology, 24.06.2019 17:30, leenzazou98241
What is the next step if your volume does not work on computer
Answers: 2
Do you know the correct answer?
Solve the following questions.
after write a method for each question, you need to write a cl...

Questions in other subjects: