1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Scilla [17]
3 years ago
8

1. Create a class called Name that represents a person's name. The class should have fields named firstName representing the per

son's first name, lastName representing their last name, and middleInitial representing their middle initial (a single character). 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", this method 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", this method returns "Public, John Q.".

(You don't need to write the class header or declare the fields; assume that this is already done for you. Just write your two methods' complete code in the box provided.)
Engineering
2 answers:
beks73 [17]3 years ago
8 0

Answer: Jhon Greenheart

Explanation:

attashe74 [19]3 years ago
4 0

ANSWER:

<u>( 1 )</u><em><u>.</u></em>

<em><u /></em>

public class Name{       //header declaration for the class <em>Name</em>    

   /*

<em>    Declare all necessary fields.</em>

   The first and last names of the person are string variables.

   Hence they are of type String.

   The middle initial of the person is a single character.

   Hence it is of type char.

   */

    String firstName;     // <em>person's first name called firstName</em>

    String lastName;      // <em>person's last name called lastName</em>

    char middleInitial;    // <em>person's middle initial called middleInitial</em>

}

==========================================================

<u>( 2 )</u>

/*

Method getNormalOrder() is declared as follows.

It returns the person's name in normal order with first name

followed by the middle initial and last name.

*/

public String getNormalOrder(){      

    // concatenate the firstName, middleInitial and lastName and return the

   // result.

    return this.firstName + " " + this.middleInitial + ". " + this.lastName;

}

/*

Method getReverseOrder() is declared as follows.

It returns the person's name with the last name

followed by the first name and middle initial.

*/

public String getReverseOrder(){

   // concatenate the lastName, lastName and middleInitial  and return the

   // result.

   return this.lastName + " " + this.firstName + " " + this.middleInitial + ".";

}

EXPLANATION:

The above code has been written in Java.

The code contains comments that explain every part of the code. Please go through the comments carefully for a better understanding of the code.

<em>Special note: </em>

i. Concatenation which means joining strings together, is done in Java using the + operator.

ii. The this keyword used in the two methods is optional. It is just used to reference to the instance variables - firstName, lastName and middleInitial - of the object.

<em>Hope this helps!</em>

You might be interested in
Are all transmissions fluids interchangeable
KiRa [710]

Answer:

<u>No</u>.

Explanation:

They are not all the same. Moreover, using a fluid that is not approved by the vehicle manufacturer will void the transmission warranty.

6 0
3 years ago
Explain how potential energy converts to kinetic energy in the loop-the-loop section of the roller coaster. Make sure to note wh
larisa86 [58]

Answer:

lol

Explanation:

8 0
3 years ago
I don’t understand this
blondinia [14]

Answer:

Sorry for the delayed response- Right now I don't have time to give you the answer, but I really want to help so I'll try to phrase it in a easier way to understand things: Basically what you need to do for this problem is find the area of the base of the figure (which means length x width) and then you would simply find the volume of 160cm^{2} by finding the length of each side of the figure, find the length of the figure, find the height of the figure and then find the radius.

Have an amazing day and I hope this can somewhat help :)

7 0
3 years ago
As part of the overall systems engineering process, there are a variety of software development methods, but the three most comm
saw5 [17]

The three most common software development methods are the Waterfall Approach, the Incremental Approach, and the SPIRAL Approach. These methods depend on the team size and specific goals.

Software development is the sequential procedure that involves the division of the work into smaller and parallel stages in order to improve software design and product management.

The software development methods depend on both the team size and specific objectives.

The most common methodologies for software development include:

  • Waterfall
  • Spiral
  • Incremental
  • Agile
  • Continuous integration

Learn more about software development here:

brainly.com/question/14275830

8 0
2 years ago
A system that is not influence anyway by the surroundings is called a)- control mass system b)- Isothermal system c)-- isolated
NARA [144]

Answer:

Isolated system

Explanation:

By definition of a closed system it means that a system that does not interact with it's surroundings in any manner

The other options are explained as under:

Isothermal system : It is a system that does not allow it's temperature to change

Control Mass system : It is a system whose mass remains conserved which means the mass entering the system equals the mass leaving the system

Open system: It is a system that allows transfer of mass and energy across it's boundary without any opposition i.e freely.

5 0
3 years ago
Other questions:
  • Modify any of the previous labs which would have crashed when non-numeric data was entered by adding exception handling so that
    8·1 answer
  • When it comes to making a good impression in a work setting, it does not apply to an initial contact, since both people are meet
    9·1 answer
  • One of our wifi network standards is IEEE 802.11ac. It can run at 6.77 Gbit/s data rate. Calculate the symbol rate for 801.11ac
    5·1 answer
  • Which of these is least likely a step in replacing a failed compressor?
    12·2 answers
  • A 200 W vacuum cleaner is powered by an electric motor whose efficiency is 70%. (Note that the electric motor delivers 200 W of
    13·1 answer
  • Consider a large plane wall of thickness L = 0.3 m, thermal conductivity k = 2.5 W/m · °C, and surface area A =12 m2. The left s
    6·1 answer
  • Thoughts about drinking and driving
    12·2 answers
  • 1. What's the maximum overall length of the part?<br> 2. What material is used to fabricate the part
    5·1 answer
  • Good night. I need to go to bed. Byeeeeeeeeeeeee.​
    15·1 answer
  • In an ungrounded electrical systems with conductors installed in grounded metal raceways and enclosures, what is the voltage fro
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!