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
"Write a statement that outputs variable numItems. End with a newline. Program will be tested with different input values."
kirill [66]

Answer:

The solution code is written in Java.

System.out.println(numItems);

Explanation:

Java <em>println() </em>method can be used to display any string on the console terminal. We can use <em>println()</em> method to output the value held by variable <em>numItems.</em> The <em>numItems </em>is passed as the input parameter to <em>println()</em> and this will output the value of <em>numItems</em> to console terminal and at the same time the output with be ended with a newline automatically.  

6 0
3 years ago
Given a two-dimensional steady inviscid air flow field with no body forces described by the velocity field given below. Assuming
kolbaska11 [484]

Answer:

the pressure gradient in the x direction = -15.48Pa/m

Explanation:

  • The concept of partial differentiation was used in the determination of the expression for u and v.
  • each is partially differentiated with respect to x and the appropriate substitution was done to get the value of the pressure gradient as shown in the attached file.

4 0
3 years ago
Before finishing and installing a shelved cabinet you just constructed, you need to check the
Greeley [361]

Answer:

Carpenter's square

Explanation:

The most common hand tool used to measure or set angles with its application extending to setting angles of roofs and rafters. Another name of a Carpenter's square is a framing square.

Other hand tools that are used to measure angles are;

  • The combination square that allows a user to set both 90°  and 45° angles
  • A Bevel that allows users to set any angle they like.
  • A Protractor that resembles a bevel but its marks are marked in an arc.
  • An electromagnetic angle finder which gives a reading according to the measure of the arms adjusted by the user.
7 0
3 years ago
He is going ___ in the hot air ballon​
Vladimir [108]

no artical shoul be used here

5 0
2 years ago
QUESTION ONE Write short answers on the following questions: i. Rainfall depth over a watershed is monitored through six number
Bond [772]

Answer:

identify function of the system unit and its components

4 0
3 years ago
Other questions:
  • What is matrix ? answer plzzz 27 point you got answer​
    15·2 answers
  • In an experiment, the local heat transfer over a flat plate were correlated in the form of local Nusselt number as expressed by
    5·1 answer
  • Demonstreaza in 20 de propoziti ca snoava pacala si zarzarele boerului e o snoava
    12·1 answer
  • You talk with the owner and he likes the idea of using two large glulam beams as shown to carry the joist loads. Design the glul
    5·1 answer
  • Cual es el costo del kwh
    8·1 answer
  • Construction lines are thick lines true false
    11·2 answers
  • What is true about a point and shoot camera?
    9·1 answer
  • What is the difference between absorbed wavelengths and reflected wavelengths?
    11·1 answer
  • s) Use Cramer’s rule to solve the system below, and state the condition at which solution exists. ax+by = 1 cx+dy =−1
    15·1 answer
  • The source term will affect all algebraic equations.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!