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
Would be much appreciated if someone could help with this will give brainiest.
Mashcka [7]

Answer:   both mm and inches on each dimension in a sketch (with the main dimension in one format and the other in brackets below it), in the way you can have dual dimensions shown when detailing an idw view.

personally think it would look a mess/cluttered with even more text all over the sketch environment, but everyone's differenent.

If it's any help - you know you can enter dimensions in either format?  If you're working in mm you can still dimension a line and type "2in" and vice-versa.  Probably know this already, but no harm saying it, just in case.

You can enter the units directly in or mm and Inventor will convert to current document settings (which  you can change - maybe someone can come up with a simple toggle icon to toggle the document settings).  Tools>Document Settings>Units

Unlike SolidWorks when you edit the dimension the original entry shows in the dialog box so it makes it easy to keep track of different units even if they aren't always displayed.  (SWx does the conversion or equation and then that is what you get.)

I work quite a bit in inch and metric and combination (ex metric frame motor on inch machine) and it doesn't seem to be a real difficulty to me.

4 0
3 years ago
A cylindrical metal specimen having an original diameter of 11.34 mm and gauge length of 53.3 mm is pulled in tension until frac
WINSTONCH [101]

Answer:

a) 70.29 %

b) 37%

Explanation:

percent reduction can be found from:

PR = 100*(π(do/2)^2-π(df/2)^2)/π(do/2)^2

     = 100*(π(11.34/2)^2-π(6.21/2)^2)/π(11.34/2)^2

     =70.29 %

percent elongation can be found from:

EL =L_f - Lo/Lo*100

    = (73.17 -53.3/53.3)*100

    = 37%

5 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
In an experiment, one selected two samples of copper-silver alloy. One sample has 40 wt% of silver and 60wt% of copper and the o
mote1985 [20]
I belive it’s 3 sorry if it’s wrong
6 0
3 years ago
What’s Statistics<br> What are the 2 Source of error in data collection
FromTheMoon [43]

Answer:

<em>The main sources of error in the collection of data are as follows : Due to direct personal interview. Due to indirect oral interviews. Information from correspondents may be misleading.</em>

4 0
3 years ago
Read 2 more answers
Other questions:
  • The idling engines of a landing turbojet produce forward thrust when operating in a normal manner, but they can produce reverse
    7·1 answer
  • 1. Which type of fit implies that a piece will never fit? a. interference fit b. construction fit c. transition fit d. impeding
    8·1 answer
  • The E7018 Electrode produces a/an
    9·1 answer
  • The sports car has a weight of 4900 lblb and center of gravity at GG. If it starts from rest it causes the rear wheels to slip a
    13·1 answer
  • Name the four ways in which heat is transferred from a diesel engine
    7·1 answer
  • two cars travel on a straight road from the point. A to point B both cars accelerate to their maximum speed and then continue at
    10·1 answer
  • Joinn my zo om lets play some blookets<br> 98867 708157<br> 9dPQPW
    14·1 answer
  • You installed a new 40 gallon water heater with a 54,000 BTUh burner. The underground water temperature coming into the house is
    9·1 answer
  • Identify the prefixes used in the International System of
    15·1 answer
  • 9. What power tool incorporates a set of dies and punches to cut new
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!