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
Anni [7]
3 years ago
9

For this assignment you will create two student objects and then print out the objects values. Within the Student Class you will

have the following properties: StudentID LastName FirstName Major Within the Main you will create 2 student objects by setting each of their property values. You will then write out a header line and each of the student objects to the console.
Engineering
2 answers:
kenny6666 [7]3 years ago
8 0

Answer:

public class Student { private String studentMajor; private String firstName; private String lastName; private int studentCredits; private int studentPoints;

Explanation:

public class Student { private String studentMajor; private String firstName; private String lastName; private int studentCredits; private int studentPoints;

alisha [4.7K]3 years ago
3 0

Answer:

// Student class is defined

public class Student{

// student properties is defined

int studentID;

String firstName;

String lastName;

String major;

// student constructor is defined

public Student(int studentIdentity, String fName, String lName, String studentMajor){

studentID = studentIdentity;

firstName = fName;

lastName = lName;

major = studentMajor;

}

// setter method for studentID

public void setStudentID(int studentIdentity){

   studentID = studentIdentity;

}

// setter method for firstName

public void setFirstName(String fName){

   firstName = fName;

}

// setter method for lastName

public void setLastName(String lName){

lastName = lName;

}

// setter method for major

public void setMajor(String studentMajor){

major = studentMajor;

}

// getter method for studentID

public int getStudentID(){

   return studentID;

}

// getter method for firstName

public String getFirstName(){

return firstName;

}

// getter method for lastName

public String getLastName(){

return lastName;

}

// getter method for major

public String getMajor(){

return major;

}

// displayMessage method to display class property in a better format

public void displayMessage(){

System.out.printf("The detail of students is shown below:\nThe name of the student is: %s %s!\nThe major is: %s.", getFirstName(), getLastName(), getMajor());

}

}

// main class for student is defined

public class StudentMain{

   // main method that signify beginning of program execution

   public static void main(String[] args) {

// object of Student is created

       Student student1 = new Student(1111, "John", "Smith", "Computer Science");

       Student student2 = new Student(1234, "Joe", "Doe", "Literature");

// the object is displayed by called displayMessage method

       student1.displayMessage();

       student2.displayMessage();

   }

}

Explanation:

The code is written in Java and well commented. It contains two class. The first section is Student.java and the second section is the StudentMain.java; it contains the main method which begins program execution.

You might be interested in
What is the purpose of a television​
dusya [7]

Answer:

I'm guessing for information or entertainment

Explanation:

7 0
3 years ago
............ ..........<br>​
sukhopar [10]

Answer:

...................

Explanation:

6 0
3 years ago
A pressurized 2-m-diameter tank of water has a 10-cm-diameter orifice at the bottom where water discharges to the atmosphere. Th
alukav5142 [94]

Answer:

A fluid is defined as a material that deforms continuously and permanently under the

application of a shearing stress.

• The pressure at a point in a fluid is independent of the orientation of the surface

passing through the point; the pressure is isotropic.

• The force due to a pressure p acting on one side of a small element of surface dA

defined by a unit normal vector n is given by −pndA.

• Pressure is transmitted through a fluid at the speed of sound.

• The units we use depend on whatever system we have chosen, and they include quantities

like feet, seconds, newtons and pascals. In contrast, a dimension is a more

abstract notion, and it is the term used to describe concepts such as mass, length and

time.

• The specific gravity (SG) of a solid or liquid is the ratio of its density to that of water

at the same temperature.

• A Newtonian fluid is one where the viscous stress is proportional to the rate of strain

(velocity gradient). The constant of proportionality is the viscosity, µ, which is a

property of the fluid, and depends on temperature.

• At the boundary between a solid and a fluid, the fluid and solid velocities are equal;

this is called the “no-slip condition.” As a consequence, for large Reynolds numbers

(>> 1), boundary layers form close to the solid boundary. In the boundary layer,

large velocity gradients are found, and so viscous effects are important.

• At the interface between two fluids, surface tension may become important. Surface

tension leads to the formation of a meniscus, drops and bubbles, and the capillary rise

observed in small tubes, because surface tension can resist pressure differences across

the interface.

5 0
4 years ago
A renewable item is something that is capable of being replaced naturally.
djverab [1.8K]
The answer is False.
6 0
4 years ago
Read 2 more answers
What is the weight density of a 2.24 in diameter titanium sphere that weights 0.82 lb?
nasty-shy [4]

Answer:

0.14\ lb/in^{3}

Explanation:

Density is defined as mass ler unit volume, expressed as

\rho=\frac {m}{v}

Where m is mass, \rho is density and v is the volume. For a sphere, volume is given as

v=\frac {4\pi r^{3}}{3}

Replacing this into the formula of density then

\rho=\frac {m}{\frac {4\pi r^{3}}{3}}

Given diameter of 2.24 in then the radius is 1.12 in. Substituting 0.82 lb for m then

\rho=\frac {0.82}{\frac {4\pi 1.12^{3}}{3}}=0.13932044952427\approx 0.14 lb/in^{3}

4 0
4 years ago
Other questions:
  • You want a potof water to boil at 105 celcius. How heavy a
    11·1 answer
  • The universe is sometimes described as an isolated system. Why?
    14·1 answer
  • The Molybdenum with an atomic radius 0.1363 nm and atomic weight 95.95 has a BCC unit cell structure. Calculate its theoretical
    15·1 answer
  • How do i get a used eraser out of a mechanical pencil
    11·2 answers
  • Block B starts from rest and moves downward with a constant acceleration. Knowing that after slider block A has moved 400 mm its
    13·1 answer
  • To test the effects of a new fertilizer, 100 plots were divided in half. Fertilizer A is randomly applied to one half, and B to
    13·2 answers
  • What’s tree about freedom of expression
    11·1 answer
  • Consider a mixing tank with a volume of 4 m3. Glycerinflows into a mixing tank through pipe A with an average velocity of 6 m/s,
    13·1 answer
  • Select the correct answer. which process involves creating a product by heating metals and changing their shape through the appl
    13·1 answer
  • Which measure is a correct definition of density?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!