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
Who plays a role in the financial activities of a company?
KatRina [158]

Hey,

Who plays a role in the financial activities of a company?

<em>O D. Everyone at the company, including managers and employees</em>

3 0
3 years ago
A 20-cm-long rod with a diameter of 0.250 cm is loaded with a 5500 N weight. If the diameter decreases to 0.210 cm, determine th
ss7ja [257]

Answer:

1561.84 MPa

Explanation:

L=20 cm

d1=0.21 cm

d2=0.25 cm

F=5500 N

a) σ= F/A1= 5000/(π/4×(0.0025)^2)= 1018.5916 MPa

lateral strain= Δd/d1= (0.0021-0.0025)/0.0025= -0.16

longitudinal strain (ε_l)= -lateral strain/ν = -(-0.16)/0.3

(assuming a poisson's ration of  0.3)

ε_l =0.16/0.3 = 0.5333

b) σ_true= σ(1+ ε_l)= 1018.5916( 1+0.5333)

σ_true = 1561.84 MPa

ε_true = ln( 1+ε_l)= ln(1+0.5333)

ε_true= 0.4274222

The engineering stress on the rod when it is loaded with a 5500 N weight is 1561.84 MPa.

7 0
4 years ago
A heat pump cycle whose coefficient of performance is 2.5 delivers energy by heat transfer to a dwelling at a rate of 20kW.
12345 [234]

Answer:

a) 8kW

b) $128

Explanation:

Given the coefficient of performance of the heat pump cycle to be 2.5

Energy delivered by the heat pump = 20kW

a) net power required to operate the heat pump = Energy delivered / coefficient of performance

Net power required = 20/2.5

= 8kW

b) Given the cost of electricity is $0.08 for 1kWhour

Since net power required to operate heat pump = 8kW

If the heat pump operate for 200hours, total power required for a month = 8kW×200hours = 1600kWhour

since 1kWh of electricity costs $0.08, cost of electricity used in a month when the pump operates for 200hour will be 1600kWh×$0.08 which is equivalent to $128

8 0
3 years ago
Supercharged engine what it does to the car
geniusboy [140]

Answer:

A supercharger is an air compressor that increases the pressure or density of air supplied to an internal combustion engine. This gives each intake cycle of the engine more oxygen, letting it burn more fuel and do more work, thus increasing power.

Explanation:

3 0
3 years ago
Read 2 more answers
Du
leonid [27]

Answer=

low-frequency EMFs pose little danger to human health. ... Exposure to large levels of high-frequency EMFs is known to damage human DNA and cells

Explanation:

8 0
3 years ago
Other questions:
  • You find a publication from a research laboratory that identifies a new catalyst for ammonia synthesis. The article contains the
    6·1 answer
  • What is EL Niño?
    9·1 answer
  • Write a function called pyramid(height) that acceptsa parameter ""height"". It then prints a pyramid of that height
    10·1 answer
  • An insulated piston–cylinder device initially contains 1 m3 of air at 120 kPa and 17°C. Air is now heated for 15 min by a 200-W
    7·1 answer
  • Please help me in this assignment.
    13·1 answer
  • The hot-wire anemometer.' A hot-wire anemome ter is essentially a fine wire, usually made of platinum,which is heated electrical
    6·1 answer
  • 6) Describe the differences between the troposphere and stratosphere.
    14·1 answer
  • Why is electricity considered a secondary source of energy
    6·1 answer
  • Careful planning will save time, __________, and energy while ensuring the production of a high quality product.
    15·1 answer
  • A thin aluminum sheet is placed between two very large parallel plates that are maintained at uniform temperatures T1 = 900 K, T
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!