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
Alla [95]
4 years ago
15

Create a class called Name that will have three fields first name, middle initial, and last name as parameters. Add a constructo

r to the Name class that accepts a first name, middle initial, and last name as parameters (in that order) and initializes the Name object's state with those values. Write a complete program (i.e. with client class) to check your work. Please submit Name and client class .java files. [10 points]
Computers and Technology
1 answer:
KATRIN_1 [288]4 years ago
7 0

Answer:

The program to the given question can be given as:

Program:

import java.io.*; //import package for client class.

class Name //class-name Name.

{

// data members of the class.

String firstname, middleinitial, lastname;

// define parameterized constructor that would initialize data members

Name(String Fname,String Mname,String Lname)

{

this.firstname= Fname; //Using this key-word for holding value.

this.middleinitial= Mname;

this.lastname= Lname;

}

void showtime() //method showname with no return-type.

{

//define variable name for strore value.

String name;

name = firstname + " " + middleinitial + " " + lastname;

System.out.print(name); //print value.

}

}

class Main //main class

{

public static void main (String[] args) //main method.

{

Name ob =new Name("AAA","BBB","CCC");

//creating class object.and passing value to parameterized constructor.

ob.showtime();

//calling showtime function.

}

}

Output:

AAA BBB CCC.

Explanation:

The explanation of the program can be given as:

In this program, we create a class i.e. (Name). In class, we declare a variable that's data type is String because It is a sequence of characters that hold a string value. Then we define the parameterized constructor. It is used for holding string values in it. We define a function i.e. showtime. This function is used for string value that is passed in the constructor. Then we create the main class that has the main method. It is used for calling the Name class by creating its object. After creating a name class object we pass the value to the parameterized constructor. and call the function, Where it is a function that doesn't have any return type.

You might be interested in
MENCIONA ¿POR QUÉ SURGE EL CIVISMO TECNOLOGICO?
Lelu [443]

Answer:

La tecnología cívica es tecnología (principalmente tecnología de información) que permite la participación del público con el propósito de aumentar el bienestar

Explanation:

3 0
3 years ago
Which is a correct way to test whether two variables representing numbers, numOne and numTwo, are equal?
polet [3.4K]

Explanation:

Intital value of variable "NUM" is 10 when while loop execute for the first time , it check the condition ( num<10) and founds this FALSE. So the statement inside execute if while loop doesn't execute then it will not going to change the value of "NUM " . That is why the value of "NUM" will remain same i.e NUM 10

7 0
3 years ago
What are the two most common form factors used today for computer cases, power supplies, and motherboards?
Vitek1552 [10]
The two most common form factors used today is mATX and ATX
5 0
4 years ago
Which of the following is considered a period cost in absorption​ costing? A. variable manufacturing overhead costs B. fixed man
sasho [114]
Ccccccccccccccccccccc
5 0
3 years ago
Suppose you will invest $100 per month at the beginning of the month for 40 years with interest rate
Alexeev081 [22]

Answer:

future value = 232369.1361

return % = 384.10 %

Explanation:

given data

principal = $100 per month

time = 40 year = 480 months

rate = 6.25 % yearly = 0.0625 yearly = 0.005208 monthly

to find out

total amount of capital at the end of your investment and percentage is  your total return

solution

so here future value formula is

future value = P \frac{(1+r)^{t-1}}{r} * (1+r)   ..........1

here r is rate and t is time and P is principal

so put all value

future value = 100 \frac{(1+0.005208)^{480-1}}{0.005208} * (1+0.005208)

future value = 232369.1361

so

Total capital at the end of investment-Total principle invested over the years

232369.1361 - 100 ( 12 × 40 )

184369.1361

so

Return % = \frac{184369.1361}{48000} × 100

return % = 384.10 %

5 0
3 years ago
Other questions:
  • After typing “application letter” in the Search window in the New dialog box, Nate clicks the Education category. Three letters
    9·1 answer
  • What are the two types of computers
    15·2 answers
  • What are the four requirements of a linear programming​ problem?
    8·1 answer
  • Select all that apply. To assist in document sharing, you should?
    12·2 answers
  • An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-prio
    14·1 answer
  • The blank contains the most commonly used commands
    8·1 answer
  • How can a user restore a message that was removed from the Deleted Items folder?
    10·1 answer
  • You are working on a ticket for a user who cannot access the Internet from their PC. After troubleshooting, how do you confirm t
    10·1 answer
  • Spreadsheets are sometimes credited with legitimizing the personal computer as a business tool. Why do you think they had such a
    13·1 answer
  • You are given the following design parameters, fill in the table: All memory addresses are 32-bit long; A 64Kbyte (2^16 byte) ca
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!