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
What is the measurement of this dial caliper? <br> A. 5.491<br> B. 4.044<br> C. 5.691
just olya [345]
Its C .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4 0
3 years ago
A microscope illuminator uses a transformer to step down the 120 V AC of the wall outlet to power a 12.0 V,50 W microscope bulb.
Anna35 [415]

Answer:2.88 ohms

Explanation:

R= V^2 / P

12^2/50

144/50

2.88 ohms

5 0
2 years ago
Water flows through a multisection pipe placed horizontally on the ground. The velocity is 3.0 m/s at the entrance and 2.1 m/s a
Alex_Xolod [135]

Answer:

b. 2.3 kPa.

Explanation:

This situation can be modelled by Bernoulli's Principle, as there are no energy interaction throughout the multisection pipe and current lines exists between both ends. Likewise, this system have no significant change in gravitational potential energy since it is placed horizontally on the ground and is described by the following model:

P_{1} + \rho \cdot \frac{v_{1}^{2}}{2} = P_{2} + \rho \cdot \frac{v_{2}^{2}}{2}

Where:

P_{1}, P_{2} - Pressures at the beginning and at the end of the current line, measured in kilopascals.

\rho - Water density, measured in kilograms per cubic meter.

v_{1}, v_{2} - Fluid velocity at the beginning and at the end of the current line, measured in meters per second.

Now, the pressure difference between these two points is:

P_{1} - P_{2} = \rho \cdot \frac{v_{2}^{2}-v_{1}^{2}}{2}

If \rho = 1000\,\frac{kg}{m^{3}}, v_{1} = 3\,\frac{m}{s} and v_{2} = 2.1\,\frac{m}{s}, then:

P_{1} - P_{2} = \left(1000\,\frac{kg}{m^{3}} \right)\cdot \frac{\left(2.1\,\frac{m}{s} \right)^{2}-\left(3\,\frac{m}{s} \right)^{2}}{2}

P_{1} - P_{2} = -2295\,Pa

P_{1} - P_{2} = -2.295\,kPa (1 kPa is equivalent to 1000 Pa)

Hence, the right answer is B.

7 0
3 years ago
Think about all the things we have investigated in class so far this semester. Identify three examples of climate-related aspect
Free_Kalibri [48]

Answer:

1) the mean surface temperature of earth.

2) precipitation and sunshine

3) air and wind movement.

6 0
3 years ago
A well-insulated, rigid vessel contains 3 kg of saturated liquid water at 40°C. The vessel also contains an electrical resistor
Olenka [21]

Answer:

The final temperature in the vessel after the resistor has been operating for 30 min is 111.67°C

Explanation:

given information:

mass, m = 3 kg

initial temperature,  T₁ = 40°C

current, I = 10 A

voltage, V = 50 V

time, t = 30 min = 1800 s

Heat for the system because of the resistance is

Q = V I t

where

V = voltage (V)

I = current (A)

t = time (s)

Q = heat transfer to the system (J)

so,

Q = V x I x t

   = 50 x 10 x 1800

   = 900000

   = 9 x 10⁵ J

the heat transfer in the closed system is

Q = ΔU + W

where

U = internal energy

W = work done by the system

thus,

Q = ΔU + W

9 x 10⁵ = ΔU + 0, W = 0 because the tank is a well-insulated and rigid.

ΔU = 9 x 10⁵ J = 900 kJ

then, the energy change in the system is

ΔU = m c ΔT

ΔT = ΔU / m c, c = 4.186 J/g°C

     = 900 / (3 x 4.186)

     = 71.67°C

so,the final temperature (T₂)

ΔT = T₂ - T₁

T₂ = ΔT + T₁

    = 71.67°C + 40°C

    = 111.67°C

5 0
3 years ago
Other questions:
  • A computer maintenance company wants to 'capture' the knowledge that employees carry around in their heads by creating a databas
    5·1 answer
  • A(n)______ is a device used to ensure positive position of a valve or damper actuator A. calibrator B. positioner C. actuator D.
    6·1 answer
  • NO reacts with Br2 in the gas phase according to the following chemical equation: 2NO(g) +Br2(g)2NOBr(g) It is observed that, wh
    6·1 answer
  • You are a designer of a new processor. You have to choose between two possible implementations (called M1 and M2) of the same ar
    5·1 answer
  • WHEN WAS THE FIRST CAR INVENTED?
    13·2 answers
  • What Degree Do You Need To Become a Solar Engineer?<br> (2 or more sentences please)
    13·1 answer
  • A teenager was pulling a prank and placed a large stuffed penguin in the middle of a roadway. A driver is traveling on this leve
    13·1 answer
  • What is the definition of a tolerance on a dimension typically found on technical drawings?
    7·1 answer
  • How long should the shafts remain in the furnace to achieve a desired centerline temperature of 800K? 2) Determine the temperatu
    5·1 answer
  • How do I get my son to do his work?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!