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
The engine of a 2000kg car has a power rating of 75kW. How long would it take (seconds) to accelerate from rest to 100 km/hr at
Delvig [45]

Answer: 10.29 sec.

Explanation:

Neglecting drag and friction, and at road level , the energy developed during the time the car is accelerating, is equal to the change in kinetic energy.

If the car starts from rest, this means the following:

ΔK = 1/2 m*vf ²

As Power (by definition) is equal to Energy/Time= 75000 W= 75000 N.m/seg, in order to get time in seconds, we need to convert 100 km/h to m/sec first:

100 (Km/h)*( 1000m /1 Km)*(3600 sec/1 h)= 27,78 m/sec

Now, we calculate the change in energy:

ΔK= 1/2*2000 Kg. (27,78)² m²/sec²= 771,728 J

<h2>If P= ΔK/Δt, </h2><h2>Δt= ΔK/P= 771,728 J / 75,000 J/sec= 10.29 sec.</h2>
4 0
4 years ago
When you arrive at an intersection with a stop sign in your direction, if there is no marked stop
Illusion [34]

Answer:

C: Stop before entering the pedestrian crosswalk.

Explanation:

3 0
3 years ago
Read 2 more answers
A cubic transmission casing whose side length is 25cm receives an input from the engine at a rate of 350 hp. If the vehicle's ve
Musya8 [376]

Answer:

The surface temperature is 921.95°C .

Explanation:

Given:

   a=25 cm ,P=350 hp⇒P=260750 W

Power transmitted 0.95\times 260750W and remaining will lost in the form of heat.This heat transmitted to air by the convection.

 h=230\frac{W}{m^2-K},\eta =0.95

Actually heat will be transmit by the convection.

In convection Q=hA\Delta T

So P=\Delta T\times Q

0.05\times 260750=230\times0.25^2\(T-15)

T=921.95°C

So the surface temperature is 921.95°C .

6 0
3 years ago
Hey, I have a question, I was thinking that if you have engineering skills or drawing skill you could help me to start a project
gayaneshka [121]

Answer

Dont have one;(

Explanation:

7 0
3 years ago
Some cars have an FCW, which stands for
Natalka [10]

Answer:

FCW in car stands for <em>Forward Collision Warning. </em>

<u>Explanation:</u>

The vehicle speed is monitored by <em>FCW system</em>, this is an advanced technology which indicates to the rear vehicle that a crash is going to happen if the vehicle gets close <em>because of speed</em>. This FCW systems monitor’s distance between the vehicles and speed of the vehicles.

<em>FCW system do not control the vehicle completely</em>. This system consists of sensors to detect stationary or slower-moving vehicles. A signal alerts the driver if the <em>distance between the vehicles is less</em> so that crash is being happened. It helps driver from crash by changing his route. Cars with this technology consists of audible alert.  

8 0
3 years ago
Other questions:
  • A 1-lb collar is attached to a spring and slides without friction along a circular rod in a vertical plane. The spring has an un
    6·1 answer
  • 100 points Im so bored lol
    11·2 answers
  • Why do electricians require critical thinking skills? In order to logically identify alternative solutions to problems in order
    8·1 answer
  • // This program accepts data about 100 books and// determines a price for each.// The price is 10 cents per page for the// first
    12·1 answer
  • Pls help! 39 points!!
    5·2 answers
  • The Aluminum Electrical Conductor Handbook lists a dc resistance of 0.01558 ohm per 1000 ft at 208C and a 60-Hz resistance of 0.
    11·1 answer
  • A cylindrical 1040 steel rod having a minimum tensile strength of 865 MPa (125,000 psi), a ductility of at least 10%EL, and a fi
    7·1 answer
  • Policeman says, "Son, you can't stay here"
    9·1 answer
  • What is the condition for maximum efficiency in a DC motor?
    15·1 answer
  • assuming complementary inputs are available, the minimum number of transistors needed to realize a two input xor gate is:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!