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
Determine whether or not each of the following four transaction execution histories is serializable. If a history is serializabl
ludmilkaskok [199]

Answer:

Option D. w1[x] w2[u] w2[y] w1[y] w3[x] w3[u] w1[z]

Explanation:

The execution in the option D is correct. This is because there is more than one reasonable criterion.

8 0
3 years ago
Select the correct answer.
cricket20 [7]

Answer:

A.

The power generated by a wind farm is not constant because of irregular wind patterns.

5 0
3 years ago
A 60-cm-high, 40-cm-diameter cylindrical water tank is being transported on a level road. The highest acceleration anticipated i
dlinn [17]

Answer:

h_{max} = 51.8 cm

Explanation:

given data:

height of tank = 60cm

diameter of tank =40cm

accelration = 4 m/s2

suppose x- axis - direction of motion

z -axis - vertical direction

\theta = water surface angle with horizontal surface

a_x =accelration in x direction

a_z =accelration in z direction

slope in xz plane is

tan\theta = \frac{a_x}{g +a_z}

tan\theta = \frac{4}{9.81+0}

tan\theta =0.4077

the maximum height of water surface at mid of inclination is

\Delta h = \frac{d}{2} tan\theta

            =\frac{0.4}{2}0.4077

\Delta h  0.082 cm

the maximu height of wwater to avoid spilling is

h_{max} = h_{tank} -\Delta h

            = 60 - 8.2

h_{max} = 51.8 cm

the height requird if no spill water is h_{max} = 51.8 cm

3 0
3 years ago
According to the video, what are examples of systems that Stationary Engineers oversee? Check all that apply. electrical systems
garik1379 [7]

Answer:

electrial systems

fire systems

heating systems

air systems

Explanation:

3 0
3 years ago
Read 2 more answers
Situation: Peter is designing a new hybrid car that functions on solar power. He is currently working on sketches of his design
givi [52]

Answer:

whats the question?

Explanation:

8 0
2 years ago
Other questions:
  • In electric heaters, electrical energy is converted to potential energy. a)-True b)-false?
    11·1 answer
  • How does an engine convert fuel into a useful form of energy
    6·1 answer
  • Developed an automated program in any language which take 12 dependent variable and corresponding independent variables and show
    14·1 answer
  • Which of the following activities could be considered unethical?
    7·1 answer
  • . An ideal vapor compression refrigeration cycle operates with a condenser pressure of 900 kPa. The temperature at the inlet to
    14·1 answer
  • According to the video, what are some tasks that Construction Managers perform? Check all that apply.
    9·2 answers
  • It's in the picture please asap
    6·2 answers
  • Complex machines are defined by
    8·1 answer
  • The thrust angle is checked by referencing
    12·1 answer
  • Briefly explain the term soil sampling and outline its importance in building engineering works.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!