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
Examples of reciprocating motion in daily life
bonufazy [111]

Answer:

Examples of reciprocating motion in daily life are;

1) The needles of a sewing machine

2) Electric powered reciprocating saw blade

3) The motion of a manual tire pump

Explanation:

A reciprocating motion is a motion that consists of motion of a part in an upward and downwards (\updownarrow) or in a backward and forward (↔) direction repetitively

Examples of reciprocating motion in daily life includes the reciprocating motion of the needles of a sewing machine and the reciprocating motion of the reciprocating saw and the motion of a manual tire pump

In a sewing machine, a crank shaft in between a wheel and the needle transforms the rotary motion of the wheel into reciprocating motion of the needle.

8 0
3 years ago
What is the composition of the two phases that form when a stream of 40% A, 39% B, and 21% C separates into two phases? Label th
irga5000 [103]

Answer:

vapor fraction = 0.4 and 0.08

Explanation:

At reasonably high temperatures, a mixture will exist in the form of a sub cooled liquid. Between these extremes, the mixture exists in a two phrase region where it is a vapor liquid equilibrium. From a vapor-liquid phase diagram, a mixture of 40% A, 39% B, and 21% C separates to give the vapor compositions of 0.4 and 0.08.

8 0
3 years ago
• Differentiate between laboratory and industrial reactors​
sergiy2304 [10]

Answer:

A reactor is a piece of equipment in which the feedstock is converted to the desired product. Reactors are chosen such that they meet the requirements imposed by the reaction mechanisms, rate expressions, and the required production capacity. Other parameters that must be determined to choose the correct type of reactor are reaction heat, reaction rate constant, heat transfer coefficient, and reactor size. Reactors that are free of the effect of the macro-kinetic properties are classified as: batch isothermal perfectly stirred reactor, batch adiabatic perfectly stirred reactor, semi-batch perfectly stirred reactor, continuous isothermal perfectly stirred reactor flow reactor, continuous adiabatic perfectly stirred flow reactor, continuous isothermal plug flow reactor, and continuous adiabatic plug flow reactor.

7 0
3 years ago
Five kg of nitrogen gas (N2) in a rigid, insulated container fitted with a paddle wheel is initially at 300 K, 150 kPa. The N2 g
andrew-mc [135]

Answer:

A) attached below

B) 743 KJ

C) 1.8983 KJ/K

Explanation:

A) Diagram of system schematic and set up states

attached below

<u>B) Calculate the amount of work received from the paddle wheel </u>

assuming ideal gas situation

v1 = v2 ( for a constant volume process )

work generated by paddle wheel = system internal energy

dw = mCv dT .     where ; Cv = 0.743 KJ/kgk

     = 5 * 0.743 * ( 500 - 300 )

     = 3.715 * 200 = 743 KJ

<u>C) calculate the amount of entropy generated  ( KJ/K )</u>

S2 - S1 = 1.8983 KJ/K

attached below is the detailed solution

4 0
3 years ago
A counter-flow double-piped heat exchange is to heat water from 20oC to 80oC at a rate of 1.2 kg/s. The heating is to be accompl
lawyer [7]

Answer:

110 m or 11,000 cm

Explanation:

  • let mass flow rate for cold and hot fluid = M<em>c</em> and M<em>h</em> respectively
  • let specific heat for cold and hot fluid = C<em>pc</em> and C<em>ph </em>respectively
  • let heat capacity rate for cold and hot fluid = C<em>c</em> and C<em>h </em>respectively

M<em>c</em> = 1.2 kg/s and M<em>h = </em>2 kg/s

C<em>pc</em> = 4.18 kj/kg °c and C<em>ph</em> = 4.31 kj/kg °c

<u>Using effectiveness-NUT method</u>

  1. <em>First, we need to determine heat capacity rate for cold and hot fluid, and determine the dimensionless heat capacity rate</em>

C<em>c</em> = M<em>c</em> × C<em>pc</em> = 1.2 kg/s  × 4.18 kj/kg °c = 5.016 kW/°c

C<em>h = </em>M<em>h</em> × C<em>ph </em>= 2 kg/s  × 4.31 kj/kg °c = 8.62 kW/°c

From the result above cold fluid heat capacity rate is smaller

Dimensionless heat capacity rate, C = minimum capacity/maximum capacity

C= C<em>min</em>/C<em>max</em>

C = 5.016/8.62 = 0.582

          .<em>2 Second, we determine the maximum heat transfer rate, Qmax</em>

Q<em>max</em> = C<em>min </em>(Inlet Temp. of hot fluid - Inlet Temp. of cold fluid)

Q<em>max</em> = (5.016 kW/°c)(160 - 20) °c

Q<em>max</em> = (5.016 kW/°c)(140) °c = 702.24 kW

          .<em>3 Third, we determine the actual heat transfer rate, Q</em>

Q = C<em>min (</em>outlet Temp. of cold fluid - inlet Temp. of cold fluid)

Q = (5.016 kW/°c)(80 - 20) °c

Q<em>max</em> = (5.016 kW/°c)(60) °c = 303.66 kW

            .<em>4 Fourth, we determine Effectiveness of the heat exchanger, </em>ε

ε<em> </em>= Q/Qmax

ε <em>= </em>303.66 kW/702.24 kW

ε = 0.432

           .<em>5 Fifth, using appropriate  effective relation for double pipe counter flow to determine NTU for the heat exchanger</em>

NTU = \\ \frac{1}{C-1} ln(\frac{ε-1}{εc -1} )

NTU = \frac{1}{0.582-1} ln(\frac{0.432 -1}{0.432 X 0.582   -1} )

NTU = 0.661

          <em>.6 sixth, we determine Heat Exchanger surface area, As</em>

From the question, the overall heat transfer coefficient U = 640 W/m²

As = \frac{NTU C{min} }{U}

As = \frac{0.661 x 5016 W. °c }{640 W/m²}

As = 5.18 m²

            <em>.7 Finally, we determine the length of the heat exchanger, L</em>

L = \frac{As}{\pi D}

L = \frac{5.18 m² }{\pi (0.015 m)}

L= 109.91 m

L ≅ 110 m = 11,000 cm

3 0
3 years ago
Other questions:
  • Using Python, have your program do the following, using loops (no recursion)
    5·1 answer
  • A stem and leaf display
    12·1 answer
  • A Norton ac equivalent circuit always consists of
    6·1 answer
  • A water contains 50.40 mg/L as CaCO3 of carbon dioxide, 190.00 mg/L as CaCO3 of Ca2 and 55.00 mg/L as CaCO3 of Mg2 . All of the
    5·2 answers
  • What is planning in pretech
    6·1 answer
  • What is a chipping hammer used for? <br><br> State three things.
    7·2 answers
  • Hi guys wut is 30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    9·2 answers
  • Technician A says that collapsible steering columns may use a pyrotechnic charge. Technician B says that collapsible brake pedal
    6·1 answer
  • Which statement is WRONG?
    13·1 answer
  • The web page you created displays the time in the correct time zone for the user's location.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!