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
Metal and dirt are not considered contaminants to oll.<br> A) O True<br> B) O False
Likurg_2 [28]

Answer:

true

Explanation:

6 0
2 years ago
Read 2 more answers
2. A counter flow tube-shell heat exchanger is used to heat a cold water stream from 18 to 78oC at a flow rate of 1 kg/s. Heatin
Anastaziya [24]

Answer:

a) L = 220\,m, b) U_{o} \approx 0.63\,\frac{kW}{m^{2}\cdot ^{\textdegree}C}

Explanation:

a) The counterflow heat exchanger is presented in the attachment. Given that cold water is an uncompressible fluid, specific heat does not vary significantly with changes on temperature. Let assume that cold water has the following specific heat:

c_{p,c} = 4.186\,\frac{kJ}{kg\cdot ^{\textdegree}C}

The effectiveness of the counterflow heat exchanger as a function of the capacity ratio and NTU is:

\epsilon = \frac{1-e^{-NTU\cdot(1-c)}}{1-c\cdot e^{-NTU\cdot (1-c)}}

The capacity ratio is:

c = \frac{C_{min}}{C_{max}}

c = \frac{(1\,\frac{kg}{s} )\cdot(4.186\,\frac{kW}{kg^{\textdegree}C} )}{(1.8\,\frac{kg}{s} )\cdot(4.30\,\frac{kW}{kg^{\textdegree}C} )}

c = 0.541

Heat exchangers with NTU greater than 3 have enormous heat transfer surfaces and are not justified economically. Let consider that NTU = 2.5. The efectiveness of the heat exchanger is:

\epsilon = \frac{1-e^{-(2.5)\cdot(1-0.541)}}{1-(2.5)\cdot e^{-(2.5)\cdot (1-0.541)}}

\epsilon \approx 0.824

The real heat transfer rate is:

\dot Q = \epsilon \cdot \dot Q_{max}

\dot Q = \epsilon \cdot C_{min}\cdot (T_{h,in}-T_{c,in})

\dot Q = (0.824)\cdot (4.186\,\frac{kW}{^{\textdegree}C} )\cdot (160^{\textdegree}C-18^{\textdegree}C)

\dot Q = 489.795\,kW

The exit temperature of the hot fluid is:

\dot Q = \dot m_{h}\cdot c_{p,h}\cdot (T_{h,in}-T_{h,out})

T_{h,out} = T_{h,in} - \frac{\dot Q}{\dot m_{h}\cdot c_{p,h}}

T_{h,out} = 160^{\textdegree}C + \frac{489.795\,kW}{(7.74\,\frac{kW}{^{\textdegree}C} )}

T_{h,out} = 96.719^{\textdegree}C

The log mean temperature difference is determined herein:

\Delta T_{lm} = \frac{(T_{h,in}-T_{c, out})-(T_{h,out}-T_{c,in})}{\ln\frac{T_{h,in}-T_{c, out}}{T_{h,out}-T_{c,in}} }

\Delta T_{lm} = \frac{(160^{\textdegree}C-78^{\textdegree}C)-(96.719^{\textdegree}C-18^{\textdegree}C)}{\ln\frac{160^{\textdegree}C-78^{\textdegree}C}{96.719^{\textdegree}C-18^{\textdegree}C} }

\Delta T_{lm} \approx 80.348^{\textdegree}C

The heat transfer surface area is:

A_{i} = \frac{\dot Q}{U_{i}\cdot \Delta T_{lm}}

A_{i} = \frac{489.795\,kW}{(0.63\,\frac{kW}{m^{2}\cdot ^{\textdegree}C} )\cdot(80.348^{\textdegree}C) }

A_{i} = 9.676\,m^{2}

Length of a single pass counter flow heat exchanger is:

L =\frac{A_{i}}{\pi\cdot D_{i}}

L = \frac{9.676\,m^{2}}{\pi\cdot (0.014\,m)}

L = 220\,m

b) Given that tube wall is very thin, inner and outer heat transfer areas are similar and, consequently, the cold side heat transfer coefficient is approximately equal to the hot side heat transfer coefficient.

U_{o} \approx 0.63\,\frac{kW}{m^{2}\cdot ^{\textdegree}C}

5 0
3 years ago
What Advantage does a voltmeter have over a noncontact voltage indicator when testing for voltage
galina1969 [7]

Answer:

Obviously you shouldn't rely just on the meter for your safety. You'd disconnect wall fuses or kill main switches before you start, using the meter just gives you some extra protection: with the meter you might notice for example that you've disconnected the wrong fuse and the unit is still live.

Explanation:

Hope it helps! :)

5 0
2 years ago
You have a Switch LED Lightbulb with the following information: It is equivalent to a 40 Watt incandescent lightbulb. It uses 8
DochEvi [55]

The lightning efficiency based on the scenario depicted will be C. 56 lumens/Watt, more efficient.

<h3>How to calculate the lightning efficiency</h3>

The efficiency of the incandescent bulb will be:

= 450/40 = 11.25 lumens per watt.

The efficiency of the LED bulb will be:

= 450/8 = 56 lumens per watt.

In this case, the LED bulb is more efficient than the incandescent bulb.

Therefore, the lighting efficiency will be 56 lumens/Watt, more efficient

Learn more lightning efficiency on:

brainly.com/question/25927632

4 0
2 years ago
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
Likurg_2 [28]

Answer:

See explanation

Explanation:

//Include the

//required header files.

#include <stdio.h>

//Define the

//main() function.

int main(void) {

//Declare the

//required variables.

char input_char;

int input_int;

double input_double;

char input_string[100];

//Prompt the user

//to enter an integer.

printf("Enter integer: ");

//Read and store

//the integer.

scanf("%d", &input_int);

//Prompt the user

//to enter a double value.

printf("Enter double: ");

//Read and store

//the double value.

scanf("%lf", &input_double);

//Prompt the user

//to enter a character.

printf("Enter character: ");

//Read and store

//the character.

scanf(" %c", &input_char);

//Prompt user to

//enter the string

printf("Enter string: ");

//Read and

//store the string.

scanf("%s", input_string);

//(1)

//Display the values.

printf("%d %lf %c %s\n",

input_int, input_double,

input_char, input_string);

//(2)

//Display the values

//in reverse order.

printf("%s %c %lf %d\n",

input_string, input_char,

input_double, input_int);

//(3)

//Cast the double to

//an integer and display it.

printf("%lf cast to an integer is %d",

input_double, (int)(input_double));

//Return from the

//main() function.

return 0;

}

4 0
3 years ago
Other questions:
  • Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "To
    7·1 answer
  • The flowchart below shows the design steps required to build a working model.
    6·1 answer
  • The function below takes a single parameter, a list of numbers called number_list. Complete the function to return a string of t
    14·1 answer
  • A stem and leaf display
    12·1 answer
  • The line voltage of a balanced three-phase transmission line is 4200 V rms. The transmission line has an impedance of 4 6 Z j l
    12·1 answer
  • Are routers better for internet connection rather than a WiFi modem?
    6·2 answers
  • Determine the combined moment about O due to the weight of the mailbox and the cross member AB. The mailbox weighs 3.2 lb and th
    14·1 answer
  • The traffic lights are not functioning.
    7·1 answer
  • . An ideal vapor compression refrigeration cycle operates with a condenser pressure of 900 kPa. The temperature at the inlet to
    14·1 answer
  • A new approval process is being adapted by Ursa Major Solar. After an opportunity has been approved, the contract is sent to the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!