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
Aleks [24]
2 years ago
4

Create an ItemSold class for Francis Pet Supply. Fields include an invoice number, description, and price. Create get and set me

thods for each field. Create a subclass named PetSold that descends from ItemSold and includes three Boolean fields that indicate whether the pet has been vaccinated, neutered, and housebroken, and include get and set methods for these fields. Write an application that creates two objects of each class, and demonstrate that all the methods work correctly. Save the files as ItemSold.java, PetSold.java, and DemoItemsAndPets.java.
Engineering
1 answer:
finlep [7]2 years ago
4 0

Answer:

The program to this question can be given as:

Program:

class ItemSold //define class.  

{  

private int invoiceNumber; //define variable  

private String description;  

private float price;  

/define parameterized constructor.  

ItemSold(int invoiceNumber, String description, float price)  

{  

this. invoiceNumber = invoiceNumber;  

this. description = description;  

this. price = price;  

}  

public int getInvoiceNum() //define function.  

{  

return invoiceNumber; //return value.  

}  

public void setInvoiceNum(int invoiceNumber) //define function

{  

this. invoiceNumber = invoiceNumber; //hold value.  

}

public String getDescription() //define function.  

{  

return description; //return value  

}  

public void setDescription(String description) //define function.

{  

this. description = description; //hold value.  

}  

public float getPrice() //define function

{  

return price; //return value  

}  

public void setPrice(float price)  

{  

this. price = price; //hold value.  

}  

}  

class PetSold extends ItemSold //define class.

{  

private Boolean vaccinated; //define variable  

private Boolean neutered;  

private Boolean housebroken;

//parameterized constructor  

PetSold(int invoiceNumber, String description, float price, Boolean vaccinated, Boolean neutered, Boolean housebroken)  

{  

super(invoiceNumber, description, price); //use super function.  

this.vaccinated = vaccinated; //holding value.  

this.neutered = neutered;  

this.housebroken = housebroken;  

}  

public Boolean isVaccinated() //define function .  

{  

return vaccinated; //return value.  

}  

public void setVaccinated(Boolean vaccinated) //define function  

{  

this. vaccinated = vaccinated; //holding value  

}  

public Boolean isNeutered() //define function  

{  

return neutered; //return value  

}  

public void setNeutered(Boolean neutered) //define function  

{

this. neutered = neutered; //holding value  

}

public Boolean isHousebroken() //define function.  

{  

return housebroken; //return value  

}  

public void setHousebroken(Boolean housebroken) //define function  

{  

this. housebroken = housebroken; //holding value  

}  

}  

public class DemoItemsAndPets //define class.

{  

public static void main(String[] args) //define Main function  

{  

ItemSold ob1 = new ItemSold(101,"mug",6.95f); //creating Object of ItemSold class & call constructor.  

//creating Object of PetSold class & call constructor.  

PetSold ob2 = new PetSold(102,"The book of love",234.97f,true,true,false);  

System.out.print(ob1.getDescription() + " was sold for " + ob1.getPrice());  

System.out.print(ob2.getDescription() + " was sold in " + ob2.getPrice());  

System.out.print(ob2.getDescription() + " Neutered status is: " + ob2.isNeutered() +  

"\nAnd it is " + ob2.isHousebroken() + " that " + ob2.getDescription() +" is housebroken");  

}  

}  

Output:

mug was sold in 6.95

The book of love was sold in 234.97.

The book of love Neutered status is: true.

And it is false that The book of love is housebroken.

Explanation:

In this program firstly we declare the class that's name is already given in the question. The class name is ItemSold.java, PetSold.java, and DemoItemsAndPets.java. In the ItemSold and PetSold class, we use the variable as a private, parameterized constructor and function. The variable is used for initializing the value in the constructor and the function is used for return and sets the value. In this class, there are two functions for each variable i.e get and set. The get function is used to return the value and set function is used to set the value. At the lass we define the main class that is DemoItemsAndPets in this class we create above class objects and pass the value in the constructor and print its value.

You might be interested in
A 75,000 ft3 clarifier is to be used to treat wastewater. The recycle ratio is 50%, the sludge volume index (SVI) is 125, and th
Inessa05 [86]

Answer:

11 hours approximately

Explanation:

We are to calculate mean cell residence time mcrt

= Mass of solid in reactor/mass of solid wasted in a day

Q = Qe + We

Q = 2.5

Qw = 0.5

Qe = 2.5 - 0.5

= 2 MGD

10⁶/svi

= 10⁶/125

= 8000

X = 3500

Xe = 20mg/

1MGD = 0.1337million

Mcrt = 75000x3500/[0.5*8000*10⁶+2*20*10⁶] x 0.1337

= 262500000/[4000000000+40000000} x 0.1337

= 262500000/574800000

= 0.45668 days

= 0.45668 x 24 hours

= 10.9603 hours

Approximately 11 hours

3 0
2 years ago
2An oil pump is drawing 44 kW of electric power while pumping oil withrho=860kg/m3at a rate of 0.1m3/s.The inlet and outlet diam
Natasha2012 [34]

Answer:

\eta = 91.7%

Explanation:

Determine the initial velocity

v_1 = \frac{\dot v}{A_1}

    = \frac{0.1}{\pi}{4} 0.08^2

     = 19.89 m/s

final velocity

v_2 =\frac{\dot v}{A_2}

      = \frac{0.1}{\frac{\pi}{4} 0.12^2}

      =8.84 m/s

total mechanical energy is given as

E_{mech} = \dot m (P_2v_2 -P_1v_1) + \dot m \frac{v_2^2 - v_1^2}{2}

\dot v = \dot m v                       ( v =v_1 =v_2)

E_{mech} = \dot mv (P_2 -P_1) + \dot m \frac{v_2^2 - v_1^2}{2}

                = mv\Delta P + \dot m  \frac{v_2^2 -v_1^2}{2}

                 = \dot v \Delta P  + \dot v \rho \frac{v_2^2 -v_1^2}{2}

              = 0.1\times 500 + 0.1\times 860\frac{8.84^2 -19.89^2}{2}\times \frac{1}{1000}

E_{mech} = 36.34 W

Shaft power

W = \eta_[motar} W_{elec}

    =0.9\times 44 =39.6

mechanical efficiency

\eta{pump} =\frac{ E_{mech}}{W}

=\frac{36.34}{39.6} = 0.917  = 91.7%

8 0
2 years ago
During an experiment conducted in a room at 25°C, a laboratory assistant measures that a refrigerator that draws 2 kW of power h
zvonat [6]

Answer:

Not reasonable.

Explanation:

To solve this problem it is necessary to take into account the concepts related to the performance of a reversible refrigerator. The coefficient of performance is basically defined as the ratio between the heating or cooling provided and the electricity consumed. The higher coefficients are equivalent to lower operating costs. The coefficient can be greater than 1, because it is a percentage of the output: losses, other than the thermal efficiency ratio: input energy. For a reversible refrigerator the coefficient is given by

COP_{R,rev} = \frac{1}{\frac{T_1}{T_2}-1}

Where,

T_1 =High temperature

T_2 =Low Temperature

With our values previous given we can find it:

T_2 = -30\°C = (-30+273)

T_2 = 243K

T_1 = 25\°C = (25+273)

T_1 = 298K

With these values we can now calculate the coefficient of performance:

COP_{R,rev} = \frac{1}{\frac{298}{243}-1}

COP_{R,rev} = 4.42

At the same time we can calculate the work consumption of the refrigerator, this is

W = \dot{W}\Delta t

Where,

\dot{W} = Required power input

t = time to remove heat from a cool to water medium

W = 2kJ/s * 20 min

W = 2kJ/s * 1200s

W = 2400kJ

In this way we can calculate the coefficient of the refrigerator directly:

COP_R = \frac{Q_L}{W}

Where,

Q = Amoun of heat rejected

COP_R = \frac{30000}{2400}

COP_R = 12.5

Comparing the values of both coefficients we have that the experiments are NOT reasonable, because the coefficient of a refrigerator is high compared to  coefficient of reversible refrigerator.

5 0
2 years ago
Q1. In electronic circuits it is not unusual to encounter currents in the microampere range. Assume a 35 μA current, due to the
Anit [1.1K]

Answer:

2.9*10^14 electrons

Explanation:

An Ampere is the flow of one Coulomb per second, so 35 μA = is 35*10^-6 C per second.

An electron has a charge of 1.6*10^-19 C.

35*10^-6 / 1.6*10^-19 = 2.9*10^14 electrons

So, with a current o 35 μA you have an aevrage of 2.9*10^14 electrons flowing past a fixed reference cross section perpendicular to the direction of flow.

7 0
2 years ago
For laminar flow of air over a flat plate that has a uniform surface temperature, the curve that most closely describes the vari
Aliun [14]

This question is incomplete, the missing diagram is uploaded along this answer below;

Answer:

from the diagram, the curve that most closely describes the variation of the local heat transfer coefficient with position along the plate is Option D

Explanation:

Given the data in the question;

We write the expression for the local Nusselt number for Laminar flow over the flat plate;

Nu = C(Re_x)^{0.5 (Pr)^{1/3

Nu = C(\frac{Vx}{v})^{0.5} (Pr)^{1/3

\frac{h_xx}{k} = C(\frac{V}{v})^{0.5}  (Pr)^{1/3  (x)^{0.5

h_x = \frac{1}{x^{1/2}}

Next we write down the expression for the local heat flux from the plate with  uniform surface temperature;

q = h_xA( T_s - T∞ )

q ∝ h_x

∴

q ∝  \frac{1}{x^{1/2}}

The local heat flux decreases with the position as it is inversely proportional to the square root of the position from the leading edge and it will not be zero at the end of the plate.

Therefore, from the diagram, the curve that most closely describes the variation of the local heat transfer coefficient with position along the plate is Option D

3 0
2 years ago
Other questions:
  • The 8-mm-thick bottom of a 220-mm-diameter pan may be made from aluminum (k = 240 W/m ⋅ K) or copper (k = 390 W/m ⋅ K). When use
    6·1 answer
  • Which of these is true about airbag charts?
    6·1 answer
  • As shown, a load of mass 10 kg is situated on a piston of diameter D1 = 140 mm. The piston rides on a reservoir of oil of depth
    9·1 answer
  • A meter stick can be read to the nearest millimeter and a travelling microscope can be read to the nearest 0.1 mm. Suppose you w
    11·1 answer
  • Let Deterministic Quicksort be the non-randomized Quicksort which takes the first element as a pivot, using the partition routin
    13·1 answer
  • Flow and Pressure Drop of Gases in Packed Bed. Air at 394.3 K flows through a packed bed of cylinders having a diameter of 0.012
    8·1 answer
  • Technician A says that TSBs are typically updates to the owner's manual. Technician B says that TSBs are generally
    11·1 answer
  • Toeboards are usually ___ inches high and used on landings and balconies.
    8·1 answer
  • If you see rough patches, loose gravel, or potholes on the road, you should ______.l
    8·1 answer
  • Laminar flow normally persists on a smooth flat plate until a critical Reynolds number value is reached. However, the flow can b
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!