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
2. When manipulating your pedals, you should use your
astra-53 [7]

Answer:

D. left foot for the accelerator and your right foot for the brake.

* Hopefully this helps:) mark me the brainliest:)!!

7 0
3 years ago
Read 2 more answers
Three tool materials (high-speed steel, cemented carbide, and ceramic) are to be compared for the same turning operation on a ba
Tpy6a [65]

Answer:

Among all three tools, the ceramic tool is taking the least time for the production of a batch, however, machining from the HSS tool is taking the highest time.

Explanation:

The optimum cutting speed for the minimum cost

V_{opt}= \frac{C}{\left[\left(T_c+\frac{C_e}{C_m}\right)\left(\frac{1}{n}-1\right)\right]^n}\;\cdots(i)

Where,

C,n = Taylor equation parameters

T_h =Tool changing time in minutes

C_e=Cost per grinding per edge

C_m= Machine and operator cost per minute

On comparing with the Taylor equation VT^n=C,

Tool life,

T= \left[ \left(T_t+\frac{C_e}{C_m}\right)\left(\frac{1}{n}-1\right)\right]}\;\cdots(ii)

Given that,  

Cost of operator and machine time=\$40/hr=\$0.667/min

Batch setting time = 2 hr

Part handling time: T_h=2.5 min

Part diameter: D=73 mm =73\times 10^{-3} m

Part length: l=250 mm=250\times 10^{-3} m

Feed: f=0.30 mm/rev= 0.3\times 10^{-3} m/rev

Depth of cut: d=3.5 mm

For the HSS tool:

Tool cost is $20 and it can be ground and reground 15 times and the grinding= $2/grind.

So, C_e= \$20/15+2=\$3.33/edge

Tool changing time, T_t=3 min.

C= 80 m/min

n=0.130

(a) From equation (i), cutting speed for the minimum cost:

V_{opt}= \frac {80}{\left[ \left(3+\frac{3.33}{0.667}\right)\left(\frac{1}{0.13}-1\right)\right]^{0.13}}

\Rightarrow 47.7 m/min

(b) From equation (ii), the tool life,

T=\left(3+\frac{3.33}{0.667}\right)\left(\frac{1}{0.13}-1\right)\right]}

\Rightarrow T=53.4 min

(c) Cycle time: T_c=T_h+T_m+\frac{T_t}{n_p}

where,

T_m= Machining time for one part

n_p= Number of pieces cut in one tool life

T_m= \frac{l}{fN} min, where N=\frac{V_{opt}}{\pi D} is the rpm of the spindle.

\Rightarrow T_m= \frac{\pi D l}{fV_{opt}}

\Rightarrow T_m=\frac{\pi \times 73 \times 250\times 10^{-6}}{0.3\times 10^{-3}\times 47.7}=4.01 min/pc

So, the number of parts produced in one tool life

n_p=\frac {T}{T_m}

\Rightarrow n_p=\frac {53.4}{4.01}=13.3

Round it to the lower integer

\Rightarrow n_p=13

So, the cycle time

T_c=2.5+4.01+\frac{3}{13}=6.74 min/pc

(d) Cost per production unit:

C_c= C_mT_c+\frac{C_e}{n_p}

\Rightarrow C_c=0.667\times6.74+\frac{3.33}{13}=\$4.75/pc

(e) Total time to complete the batch= Sum of setup time and production time for one batch

=2\times60+ {50\times 6.74}{50}=457 min=7.62 hr.

(f) The proportion of time spent actually cutting metal

=\frac{50\times4.01}{457}=0.4387=43.87\%

Now, for the cemented carbide tool:

Cost per edge,

C_e= \$8/6=\$1.33/edge

Tool changing time, T_t=1min

C= 650 m/min

n=0.30

(a) Cutting speed for the minimum cost:

V_{opt}= \frac {650}{\left[ \left(1+\frac{1.33}{0.667}\right)\left(\frac{1}{0.3}-1\right)\right]^{0.3}}=363m/min [from(i)]

(b) Tool life,

T=\left[ \left(1+\frac{1.33}{0.667}\right)\left(\frac{1}{0.3}-1\right)\right]=7min [from(ii)]

(c) Cycle time:

T_c=T_h+T_m+\frac{T_t}{n_p}

T_m= \frac{\pi D l}{fV_{opt}}

\Rightarrow T_m=\frac{\pi \times 73 \times 250\times 10^{-6}}{0.3\times 10^{-3}\times 363}=0.53min/pc

n_p=\frac {7}{0.53}=13.2

\Rightarrow n_p=13 [ nearest lower integer]

So, the cycle time

T_c=2.5+0.53+\frac{1}{13}=3.11 min/pc

(d) Cost per production unit:

C_c= C_mT_c+\frac{C_e}{n_p}

\Rightarrow C_c=0.667\times3.11+\frac{1.33}{13}=\$2.18/pc

(e) Total time to complete the batch=2\times60+ {50\times 3.11}{50}=275.5 min=4.59 hr.

(f) The proportion of time spent actually cutting metal

=\frac{50\times0.53}{275.5}=0.0962=9.62\%

Similarly, for the ceramic tool:

C_e= \$10/6=\$1.67/edge

T_t-1min

C= 3500 m/min

n=0.6

(a) Cutting speed:

V_{opt}= \frac {3500}{\left[ \left(1+\frac{1.67}{0.667}\right)\left(\frac{1}{0.6}-1\right)\right]^{0.6}}

\Rightarrow V_{opt}=2105 m/min

(b) Tool life,

T=\left[ \left(1+\frac{1.67}{0.667}\right)\left(\frac{1}{0.6}-1\right)\right]=2.33 min

(c) Cycle time:

T_c=T_h+T_m+\frac{T_t}{n_p}

\Rightarrow T_m=\frac{\pi \times 73 \times 250\times 10^{-6}}{0.3\times 10^{-3}\times 2105}=0.091 min/pc

n_p=\frac {2.33}{0.091}=25.6

\Rightarrow n_p=25 pc/tool\; life

So,

T_c=2.5+0.091+\frac{1}{25}=2.63 min/pc

(d) Cost per production unit:

C_c= C_mT_c+\frac{C_e}{n_p}

\Rightarrow C_c=0.667\times2.63+\frac{1.67}{25}=$1.82/pc

(e) Total time to complete the batch

=2\times60+ {50\times 2.63}=251.5 min=4.19 hr.

(f) The proportion of time spent actually cutting metal

=\frac{50\times0.091}{251.5}=0.0181=1.81\%

3 0
3 years ago
Which of the following best describes the relationship between the World Wide Web and the Internet? А The World Wide Web is a pr
Gwar [14]

Answer:

C

Explanation:

5 0
3 years ago
_____ are used to control the flow of electricity in a circuit.
Travka [436]

Answer:

Switches control the flow of electricity in a circuit.

8 0
3 years ago
Read 2 more answers
Question #8
iris [78.8K]

Problem solving is the act of orderly searching for solutions to problem

The correct option that involves approaching a problem in a new way is the option;

Creative thinking

The reasons why creative thinking is the correct option is given as follows;

Finding new ways to approach a problem, involves considering alternatives to already known approaches to the problem

Given that the options to be considered are to be options which have not been applied, then the process does not involve;

Context: Which looks at the variables that relate the problem with setting or circumstance that aid understanding of the problem

Critical thinking; Which is based on the analysis of the known facts, but the new proposals are required

Perseverance; Which involves adherence to a particular option despite delay or difficulty

However;

Creative thinking; Creative thinking involves the consideration of a situation thing or problem in a new way or by approaching a task differently than what was considered a regular approach, which involves finding an unused or imaginative approach to a problem

Therefore;

The option that involves finding new ways to approach a problem is <u>creative thinking</u>

<u />

Learn lore about problem solving here:

brainly.com/question/24528689

3 0
2 years ago
Other questions:
  • Select the material used to clean a prototype board before soldering.
    5·1 answer
  • An equal-tangent sag vertical curve connects a 1% and 3% initial and final grades, respectively, and is designed for 70 mph. The
    12·1 answer
  • An electronic device dissipating 25 W has a mass of 20 g and a specific heat of 850 J/kg·0K. The device is lightly used, and it
    9·1 answer
  • The snowmobile has a weight of 250 lb, centered at G1, while the rider has a weight of 150 lb, centered at G2. Ifh=3ft, determin
    11·1 answer
  • How many volts of electricity would it take to power up an entire city? Take Tokyo for example. Please explain!
    12·1 answer
  • One employee was climbing a metal ladder to hand an electric drill to the journeyman installer on a scaffold about five feet abo
    9·1 answer
  • Which statement describes the relay between minerals and rocks ?
    15·1 answer
  • Cual es el costo del kwh
    8·1 answer
  • Ignition for heavy fuel oil?
    12·2 answers
  • A technician is building a high-performance gaming pc. which two items should the technician focus on selecting parts for the ma
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!