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
What flight patterns do groups of birds utilize and why?
lara31 [8.8K]
Birds mostly fly in a V because the lead bird cuts al of the wind and has the hardest work and then after a while the lead bird goes to the back and another bird takes his place cutting all the wind for the other birds
7 0
3 years ago
Short-term memoryA) has a larger storage capacity than long-term memory.B) takes longer to retrieve than long-term memory.C) inv
zaharov [31]

Answer:D

Explanation:

Take longer time to retrieve than long term memory, involves transient modifications in the function of pre existing synapses, such as channel modifications.

6 0
3 years ago
A highway reconstruction project is being undertaken to reduce crash rates. The reconstruction involves a major realignment of t
CaHeK987 [17]

Answer:

The provided length of the vertical curve is satisfactory for the reconstruction design speed of 60 mi/h

Explanation:

The explanation is shown on the first uploaded image

8 0
3 years ago
A masonry facade consisting of 3,800 square feet is to be constructed for a building. The total cost per worker hour is estimate
lana66690 [7]

Answer:

Days: 6.9444 days

Production rate: 547.2035 ft²/s

Explanation:

the solution is attached in the Word file

Download docx
6 0
3 years ago
A second inventor was driving down the highway in her Prius one day with her hand out the window. She happened to be driving thr
Eva8 [605]

Answer:

Explanation:

It wouldn't work because the wind energy she would be collecting would actually come from the car engine.

The relative wind velocity observed from a moving vehicle is the sum of the actual wind velocity and the velovity of the vehicle.

u' = u + v

While running a car will generate a rather high wind velocity, and increase the power generated by a wind turbine, the turbine would only be able to convert part of the wind energy into electricity while adding a lot of drag. In the end, it would generate less energy that what the drag casuses the car to waste to move the turbine.

Regenerative braking uses an electric generator connected to the wheel axle to recover part of the kinetic energy eliminated when one brakes the vehicle. Normal brakes dissipate this energy as heat, a regenerative brake uses it to recharge a batttery. Note that is is a fraction of the energy that is recovered, not all of it.

A "regenerative accelerator" makes no sense. Braking is taking kinetic energy out of the vehicle, while accelerating is adding kinetic energy to it. Cars accelerate using the power from their engines.

6 0
3 years ago
Other questions:
  • An atomic force that can attract or repel ferrous substances is<br> known as:
    14·1 answer
  • Benzoic acid 1.35 g, is reacted with oxygen in a constant volumecalorimeter to form H2 O(l) and CO2 (g)at 298 K. the mass of the
    7·1 answer
  • Ventajas motor avion
    5·1 answer
  • What are the functions of the peripheral nervous system
    6·2 answers
  • Materials to be used to build a watch tower​
    9·1 answer
  • Dndbgddbdbhfdhdhdhhfhffhfhhddhhdhdhdhdhd​
    11·2 answers
  • Welding and cutting done in confined spaces must
    5·2 answers
  • How many times greater is the value of the 2 of the 270413 than the valuce of the 2 in 419427?
    8·1 answer
  • Hi I'm trying to build a desk that moves up and down electrically but i need help
    9·1 answer
  • Silicon chips are used primarily in ?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!