answer.
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
Nookie1986 [14]
2 years ago
11

Assign courseStudent's name with Smith, age with 20, and ID with 9999. Use the printAll() member method and a separate println()

statement to output courseStudents's data. Sample output from the given program: Name: Smith, Age: 20, ID: 9999
Engineering
1 answer:
BaLLatris [955]2 years ago
5 0

Answer:

The solution code is written in Java. Presume that there is a Student class with three private attributes (name, age and ID). Within the Student class, there is a member method, printAll that will display the name, age and ID using the println() method.

Student.java

  1. public class Student {
  2.    private String name;
  3.    private int age;
  4.    private int ID;
  5.    public Student(String name, int age, int ID){
  6.        this.name = name;
  7.        this.age = age;
  8.        this.ID = ID;
  9.    }
  10.    public void printAll(){
  11.        System.out.println("Name: " + this.name);
  12.        System.out.println("Age: " + this.age);
  13.        System.out.println("ID: " + this.ID);
  14.    }
  15. }

In the main program we create a student instance and use this instance to call the printAll member method to display the output as required by the question.

Main.java

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        Student courseStudent = new Student("Smith", 20, 9999);
  4.        courseStudent.printAll();
  5.    }
  6. }

You might be interested in
It is said that Archimedes discovered his principle during a bath while thinking about how he could determine if King Hiero’s cr
arlik [135]

Answer: The crown is not made of pure gold.

Explanation:

Archimedes discovered that any solid, of any shape, when submerged in a liquid receives an upward force, equal to the weight of the volume of the liquid removed by the solid, which is equal to the solid volume.

So, if any body is weighed in air, the normal force will be equal to the gravity force (which we call weight) which can be expressed as follows:

Fg = m g = δ V g = 34.7 N

When submerged in water, the normal force is equal to the difference between the actual weight, and the upward force due to Archimedes' principle, called buoyant force, as follows:

Fn = Fg - Ep = δx. V. g - δH20 . V. g = 31.5 N

Dividing Fg between Fn, and simplifying common terms, we have:

δx / (δx - δh20) = 34.7 / 31.5 = 1.10

Solving for δx, we get the following value:

δx = 11,000 Kg/m3, less dense than pure gold, so we can conclude that the crown was not made of pure gold.

3 0
2 years ago
Which of these is true about airbag charts?
Arlecino [84]
A should be it or b
4 0
2 years ago
A milling operation was used to remove a portion of a solid bar of square cross section. Forces of magnitude P = 18 kN are appli
monitta

The smallest allowable depth is d=16.04 \mathrm{mm} for the milled portion of bar.

<u>Explanation:</u>

Given,

Magnitude of force,\mathbf{p}=18 \mathrm{kN}

a=30 \mathrm{mm}

=0.03 \mathrm{m}

Allowable stress,\sigma_{a l l}=135 \mathrm{MPa}

cross sectional area of bar,

A=a \times d

A=a d

e - eccentricity

e=\frac{a}{2}-\frac{d}{2}

The internal forces in the cross section are equivalent to a centric force P and a bending couple M.

M=P e

=P\left(\frac{a}{2}-\frac{d}{2}\right)

=\frac{P(a-d)}{2}

Allowable stress

\sigma=\frac{P}{A}+\frac{M c}{I}

c=\frac{d}{2}

Moment of Inertia,

I=\frac{b d^{3}}{12}

=\frac{a d^{3}}{12}

\therefore \sigma=\frac{P}{a d}+\frac{\frac{P(a-d)}{2} \times \frac{d}{2}}{\frac{a d^{3}}{12}}

\sigma=\frac{P}{a d}+\frac{3 P(a-d)}{a d^{2}}\\

\sqrt{x} \sigma\left(a d^{2}\right)=P d+3 P(a-d)

\sigma\left(a d^{2}\right)=P d+3 P a-3 P d

\sigma\left(a d^{2}\right)=(P-3 P) d+3 P a

\left(\sigma a d^{2}\right)=-2 P d+3 P a

\sigma d^{2}=-\frac{2 P}{a} d+3 P

By substituting values we get,

\left(135 \times 10^{6}\right) d^{2}+\frac{2 \times 18 \times 10^{3}}{0.03} d-3\left(18 \times 10^{3}\right)=0

\left(135 \times 10^{6}\right) d^{2}+\left(12 \times 10^{5}\right) d-54 \times 10^{3}=0

On solving above equation we get,d=0.01604 \mathrm{m}\\

d=16.04 \mathrm{mm}

3 0
2 years ago
Given the following code, what indexes must be passed to the substring method to produce the new String with the value "SCORE"?
Ierofanga [76]

Answer:

For expr1 = index 5, length 5

For expr2 = index 0, length 4 and index 21, length 5

string quote = "Four score and seven years ago";

           string expr1 = quote.Substring(5, 5).ToUpper(); // "SCORE"  

           string expr2 = quote.Substring(0, 4) + quote.Substring(21, 5).ToLower(); // "fouryears"

           Console.WriteLine(expr1);

           Console.WriteLine(expr2);

Explanation:

Then code is written in c# and it produces SCORE and f

ouryears

Substring takes 2 arguments, the start of the specific character and the length

6 0
2 years ago
A diameter shaft contains a deep U-shaped groove that has a radius at the bottom of the groove. The maximum shear stress in the
sergejj [24]

Answer:

hello your question lacks the required figures here is the complete question

A 1.25-in diameter shaft contains a 0.25-in deep U-shaped groove that has a 1/8-in radius at the bottom of the groove. The maximum shear stress in the shaft must be limited to 12000 psi . If the shaft rotates at a constant angular speed of 6Hz , determine the maximum power that may be delivered by the shaft.

Answer: max power delivered by shaft = 4.045 hp

Explanation:

Determine The maximum power that can be delivered by the shaft

using the given data

diameter of shaft ( D ) = 1.25 inches

depth of U-shaped groove = 0.25 inches

radius of U-shaped groove = 1/8 inches = 0.125 inches

maximum shear stress in shaft = 12000 psi

shaft angular speed at frequency of  6 Hz

firstly calculate

The minor diameter (d) = 1.25 - 2(0.25 ) = 0.5 inches

Ratio = radius of groove / minor diameter = 0.125 / 0.75 = 0.167

Ratio, = diameter of shaft / minor diameter = 1.25 / 0.75 = 1.667

k = 1.39 from stress concentration factors graph

calculate the maximum shear stress produced by the torque in the minor diameter of the shaft

<em>Tmax</em> = \frac{Tc}{J}  -----------equation 1

where Tc = 16T

J = \pi d^{3}

equation 1 becomes( Tmax )  =  \frac{16*T}{\pi *0.75^3}

also <em>Tmax</em> = K * <em>Tmin -------- equation 2</em>

<em>      </em> 1.39 * \frac{16*T}{\pi *0.75^3 } \leq  1200

      T ≤ 715.122 Ib-in

      Tmax = 59.593 Ib-ft ( max shear stress )

Finally calculate the max power transmitted by the shaft

P max = 2\pifTmax = 2\pi * 6 * 59.593

therefore Pmax = 2246.6 Ib-ft/s

                           = 4.045 hp

<em />

8 0
2 years ago
Other questions:
  • Evan notices a small fire in his workplace. Since the fire is small and the atmosphere is not smoky he decides to fight the fire
    10·1 answer
  • A mass of 12 kg saturated refrigerant-134a vapor is contained in a piston-cylinder device at 240 kPa. Now 300 kJ of heat is tran
    8·1 answer
  • The in situ moist unit weight of a soil is 17.3 kN/m^3 and the moisture content is 16%. The specific gravity of soil solids is 2
    11·1 answer
  • 13–27. The conveyor belt is moving downward at 4 m&gt;s. If the coefficient of static friction between the conveyor and the 15-k
    11·1 answer
  • air at 600 kPa, 330 K enters a well-insulated, horizontal pipe having a diameter of 1.2 cm and exits at 120 kPa, 300 K. Applying
    10·1 answer
  • An inventor claims to have developed an engine that does not use fuel but operates as a power cycle at steady state while receiv
    10·2 answers
  • Refrigerant-134a is compressed from 2 bar, saturated vapor, to 10 bar, 90o C in a compressor operating at steady state. The mass
    11·1 answer
  • Determine the design angle ϕ (0∘≤ϕ≤90 ∘) between struts AB and AC so that the 400 lb horizontal force has a component of 600 lb
    10·1 answer
  • Mr. Ray deposited $200,000 in the Old and Third National Bank. If the bank pays 8% interest, how much will he have in the accoun
    10·2 answers
  • It has been stated that crime rates are impacted by ecological conditions. Which of the following
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!