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
DaniilM [7]
2 years ago
9

Write a method called compFloat5 which accepts as input two doubles as an argument (parameter). Write the appropriate code to te

st the two numbers up to five decimal points to see if they are close enough. If they are close enough return true else return false. This would be a Boolean value. f. Write a method called compInt which accepts as input two integers as an argument (parameter). Write the appropriate code to test the two integers to see if they are equal. If they are equal return true else return false. This would be a Boolean value. g. Write a method called stringEqual program that reads in two sentences as an argument (parameter). Write the appropriate code to test the two strings to see if they are the equal. If they are equal return true
Engineering
1 answer:
Umnica [9.8K]2 years ago
4 0

Answer:

public class Comparision {

public boolean compFloat5(double d1, double d2) {

// Rounding off to two decimal places

d1 = (Math.round(d1 * 100000) / 100000.00);

d2 = (Math.round(d2 * 100000) / 100000.00);

if (d1 == d2)

return true;

else

return false;

}

public boolean compInt(int int1, int int2) {

if (int1 == int2)

return true;

else

return false;

}

public boolean stringEqual(String s1, String s2) {  

if (s1.equals(s2))

return true;

else

return false;

}

public boolean stringCompare(String s1, String s2) {

int i = s1.compareTo(s2);

if (i == -1)

return true;

else  

return false;

}  

}

You might be interested in
Expalin the application of diesel cycle in detail.
mars1129 [50]

Explanation:

Diesel cycle:

        All diesel engine work on diesel cycle .In diesel cycle there are four process .These processes are as follows

1. Adiabatic reversible compression

2.Heat addition at constant pressure

3.Adiabatic reversible expansion

4.Constant volume heat rejection

In general compression ratio in diesel engine is high as compare to petrol engine.But the efficiency of diesel cycle is less as compare to petrol cycle for same compression ratio.

Applications of diesel cycle:

Generally diesel cycle used for heavy vehicle or equipment because heavy vehicle or equipment is required high initial torque.So this cycle have lots of applications such as in industrial machining,in trucks,power plant,in mining ,in defense or military,large motors ,compressor and pump etc.

   

5 0
3 years ago
Exhaust gas from a furnace is used to preheat the combustion air supplied to the furnace burners. The gas, which has a flow rate
Monica [59]

Answer:

The total tube surface area in m² required to achieve an air outlet temperature of 850 K is 192.3 m²

Explanation:

Here we have the heat Q given as follows;

Q = 15 × 1075 × (1100 - t_{A2}) = 10 × 1075 × (850 - 300) = 5912500 J

∴ 1100 - t_{A2} = 1100/3

t_{A2}  = 733.33 K

\Delta \bar{t}_{a} =\frac{t_{A_{1}}+t_{A_{2}}}{2} - \frac{t_{B_{1}}+t_{B_{2}}}{2}

Where

\Delta \bar{t}_{a} = Arithmetic mean temperature difference

t_{A_{1} = Inlet temperature of the gas = 1100 K

t_{A_{2} = Outlet temperature of the gas = 733.33 K

t_{B_{1} =  Inlet temperature of the air = 300 K

t_{B_{2} = Outlet temperature of the air = 850 K

Hence, plugging in the values, we have;

\Delta \bar{t}_{a} =\frac{1100+733.33}{2} - \frac{300+850}{2} = 341\tfrac{2}{3} \, K = 341.67 \, K

Hence, from;

\dot{Q} = UA\Delta \bar{t}_{a}, we have

5912500  = 90 × A × 341.67

A = \frac{5912500  }{90 \times 341.67} = 192.3 \, m^2

Hence, the total tube surface area in m² required to achieve an air outlet temperature of 850 K = 192.3 m².

4 0
3 years ago
Which kind of fracture (ductile or brittle) is associated with each of the two crack propagation mechanisms?
Nina [5.8K]

dutile is the correct answer

6 0
2 years ago
Technician A says a solenoid is not used on modern automobiles. Technician B says fuel injectors and starter motor solenoids are
julia-pushkina [17]

Answer:

ON THE BOTTOM

Explanation:

red cord plus black cord

5 0
3 years ago
Can someone pls give me the answer to this?
olganol [36]

I think option c 12 is currect

7 0
2 years ago
Other questions:
  • Use the drop-down menus to choose the correct term or words to complete the statements.
    10·1 answer
  • Who can work on a fixed ladder that extends more than 24 feet?
    11·1 answer
  • 1. Represent each of the following combinations of units in the correct SI form using the appropriate prefix: (a) μMN, (b) N/μm,
    6·1 answer
  • An equal-tangent sag vertical curve (with a negative initial and a positive final grade) is designed for 55 mi/h. The PVI is at
    5·1 answer
  • Urgent please help me...
    8·1 answer
  • Can some one help me with this plumbing question. Even just a guess.<br> Plz no shady links
    11·2 answers
  • You are hired as the investigators to identify the root cause and describe what should have occurred based on the following info
    9·1 answer
  • Which fields of engineering use fluid power? Explain how these fields make use of fluid power systems: water supply, agricultura
    10·1 answer
  • Component of earthing and reasons why each material is being used<br><br>​
    5·1 answer
  • Compare and contrast mechanical properties of plastics, metals and ceramics.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!