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
Goryan [66]
3 years ago
5

Write a statement that assigns freeBooks the appropriate value based on the values of the boolean variable isPremiumCustomer and

the int variable nbooksPurchased.
Engineering
1 answer:
solniwko [45]3 years ago
4 0

Write a statement that assigns freeBooks the appropriate value based on the values of the boolean variable isPremiumCustomer and the int variable nbooksPurchased is described below

Explanation:

Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with every purchase of 8 or more books. It offers regular customers 1 free book with every purchase of 7 or more books, and offers 2 free books with every purchase of 12 or more books.

A statement that assigns freeBooks the appropriate value based on the values of the boolean variable isPremiumCustomer and the int variable nbooksPurchased. Here's what we have:

if(isPremiumCustomer = true){

   if(nbooksPurchased >= 5));

        freeBooks = 1;  

   }else if(nbooksPurchased >= 8){

  freeBooks = 2;

}else {

if(nbooksPurchased >= 7);

  freeBooks = 1;

}else if(nbooksPurchased >= 12){

 freeBooks = 2;

}

We are getting an error of "illegal start of expression".

Two of the hints are "You are using an incorrect number somewhere in your solution" and "We think you might want to consider using: ==".

I do not want the answer, I just want pointed in the right direction.

You might be interested in
No question but thx<br> reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
jeka94

Answer:

why you doin this

Explanation:

is this so we get free points?

5 0
2 years ago
Read 2 more answers
A body weighs 50 N and hangs from a spring with spring constant of 50 N/m. A dashpot is attached to the body. If the body is rai
lbvjy [14]

Answer:

a) 3.607 m

b) 1.5963 m

Explanation:

See that attached pictures for explanation.

3 0
2 years ago
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
Which system of linear inequalities is represented by the graph? y &gt; x – 2 and y x + 1 y x + 1 y &gt; x – 2 and y &lt; x + 1
KatRina [158]

Answer:

The graph representing the linear inequalities is attached below.

Explanation:

The inequalities given are :

y>x-2   and y<x+1

For tables for values of x and y and get coordinates to plot for both equation.

In the first equation;

y>x-2

y=x-2

y-x = -2

The table will be :

x    y

-2  -4

-1    -3

0     -2

1      -1

2      0

The coordinates to plot are : (-2,-4) , (-1,-3), (0,-2), (1,-1) ,(2,0)

Use a dotted line and shade the part right hand side of the line.

Do the same for the second inequality equation and plot then shade the part satisfying the inequality.

The graph attached shows results.

5 0
3 years ago
Read 2 more answers
After reading through the code, what will happen when you click run?* 1 point when run move forward while there is a pile do rem
KATRIN_1 [288]

Explanation:

I'm not exactly a master at coding, but I'm pretty sure that:

The farmer will remove dirt as long as there is a pile, then stop when the pile is done.

5 0
2 years ago
Other questions:
  • Select the correct answer.
    7·1 answer
  • Liquid water enters an adiabatic piping system at 15°C at a rate of 8kg/s. If the water temperature rises by 0.2°C during flow d
    12·1 answer
  • Example – a 100 kW, 60 Hz, 1175 rpm motor is coupled to a flywheel through a gearbox • the kinetic energy of the revolving compo
    12·1 answer
  • A fluid of specific gravity 0.96 flows steadily in a long, vertical 0.71-in.-diameter pipe with an average velocity of 0.90 ft/s
    5·2 answers
  • Technician A says that 18 gauge AWG wire can carry more current flow that 12 gauge AWG wire. Technician B says that metric wire
    9·1 answer
  • Burn in hell i watched your stupid video and i still could not get the answer
    14·1 answer
  • The base class Pet has attributes name and age. The derived class Dog inherits attributes from the base class Pet class and incl
    10·1 answer
  • PLEASE HELP!!! ILL GIVE BRANLIEST *EXTRA POINTS* dont skip :((
    14·2 answers
  • The cost of hiring new employees outpaces the raises for established employees is
    5·1 answer
  • Question 5(Multiple Choice Worth 2 points)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!