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]
3 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]3 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
A thin metal disk of mass m=2.00 x 10^-3 kg and radius R=2.20cm is attached at its center to a long fiber. When the disk is turn
topjm [15]

Answer:

k = 1.91 × 10^-5 N m rad^-1

Workings and Solution to this question can be viewed in the screenshot below:

6 0
3 years ago
Sketch the asymptotes of the Bode plot magnitude and phase for the open-loop transfer ()=100(S+1)/((S+10)(S+100)) Use MATLAB to
Salsk061 [2.6K]

The asymptotes of the open loop transfer are:

  • Horizontal: y = 0
  • Vertical: x = -10 and x = -100

<h3>How to plot the asymptotes?</h3>

The open loop transfer function is given as:

f(s) = 100(s + 1)/((s + 10)(s + 100))

Set the numerator of the function to 0.

So, we have:

f(s) = 0/((s + 10)(s + 100))

Evaluate

f(s) = 0

This means that, the vertical asymptote is y = 0

Set the denominator of the function to 0.

(s + 10)(s + 100)  0

Split

s + 10 = 0 and s + 100 = 0

Solve for s

s = -10 and s = -100

This means that, the horizontal asymptotes are s = -10 and s = -100

See attachment for the graph of the asymptotes

Read more about asymptotes at:

brainly.com/question/4084552

#SPJ1

6 0
2 years ago
A refrigerated space is maintained at -15℃, and cooling water is available at 30℃, the refrigerant is ammonia. The refrigeration
Illusion [34]

Answer:

(1) 5.74

(2) 5.09

(3) 3.05×10⁻⁵ kg/s

(4) 0.00573 kW

Explanation:

The parameters given are;

Working temperature, T_C  = -15°C = 258.15 K

Temperature of the cooling water, T_H = 30°C = 303.15 K

(1) The Carnot coefficient of performance is given as follows;

\gamma_{Max} = \dfrac{T_C}{T_H - T_C}  =  \dfrac{258.15}{303.15 - 258.15}   = 5.74

(2) For ammonia refrigerant, we have;

h_2 = h_g = 1466.3 \ kJ/kg

h_3 = h_f = 322.42 \ kJ/kg

h_4 = h_3 = h_f = 322.42 \ kJ/kg

s₂ = s₁ = 4.9738 kJ/(kg·K)

0.4538 + x₁ × (5.5397 - 0.4538) = 4.9738

∴ x₁ = (4.9738 - 0.4538)/(5.5397 - 0.4538) = 0.89

h_1 = h_{f1} + x_1 \times h_{gf}

h₁ = 111.66 + 0.89 × (1424.6 - 111.66) = 1278.5 kJ/kg

\gamma = \dfrac{h_1 - h_4}{h_2 - h_1}

\gamma = \dfrac{1278.5 - 322.42}{1466.3 - 1278.5} = 5.09

(3) The circulation rate is given by the mass flow rate, \dot m as follows

\dot m = \dfrac{Refrigeration \ capacity}{Refrigeration \ effect \ per \ unit \ mass}

The refrigeration capacity = 105 kJ/h

The refrigeration effect, Q = (h₁ - h₄) = (1278.5 - 322.42) = 956.08 kJ/kg

Therefore;

\dot m = \dfrac{105}{956.08}  = 0.1098 \ kg/h

\dot m = 0.1098 kg/h = 0.1098/(60*60) = 3.05×10⁻⁵ kg/s

(4) The work done, W = (h₂ - h₁) = (1466.3 - 1278.5) = 187.8 kJ/kg

The rating power = Work done per second = W×\dot m

∴ The rating power = 187.8 × 3.05×10⁻⁵ = 0.00573 kW.

6 0
3 years ago
In your new role at Wayne Industries, you have been given the freedom to propose and develop your own project ideas. You have an
gulaghasi [49]

Answer:

461.65 KJ/Kg

Explanation:

In this question, we are asked to calculate the values of heat transferred in the process.

Please check attachment for complete solution and step by step explanation

5 0
4 years ago
4. When the ESC system senses oversteer,
bagirrra123 [75]
I’m pretty sure the answer is b I’m not 100% but I think
5 0
2 years ago
Other questions:
  • Which of the following is a safety device meant to protect an operator from the point of operation?
    14·1 answer
  • Martensitic transformations only occur in the Fe-C system. ___ Certain materials can age harden at room temperature. ___ Pure me
    7·1 answer
  • The lid on a pressure vessel is held down with 10 bolts that pass through the lid and a flange on the pressure vessel (similar t
    6·1 answer
  • A 1.8-m3 rigid tank contains water steam at 220oC. One-third of the volume is in the liquid phase and the rest is in the vapor f
    14·1 answer
  • Design a 3-bit binary counter using S-R flip flops.
    9·1 answer
  • There are three basic methods of transmitting power as a. Electronical, mechanical, and fluid power b. Electical, mechanical, an
    10·1 answer
  • What color is an orange? its for my 8th grade
    13·1 answer
  • A battery provides electricity in the state of ?
    15·1 answer
  • What is the derivative of?
    12·1 answer
  • HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!