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
A BS of 5.43 ft is taken on a level rod at a 120-ft distance, and a FS of 8.76 ft is taken on the rod held 1,100 feet away.(a) W
jok3333 [9.3K]

Answer:

The answer is attached below

Explanation:

3 0
3 years ago
What type of engineer works to create a practical and safe energy source?
Fittoniya [83]
Why did you put this on here when you know the answer lol
4 0
3 years ago
A gas turbine operates with a regenerator and two stages of reheating and intercooling. Air enters this engine at 14 psia and 60
Rzqust [24]

Answer:

flow(m) = 7.941 lbm/s

Q_in = 90.5184 Btu/lbm

Q_out = 56.01856 Btu/lbm

Explanation:

Given:

- T_1 = 60 F = 520 R

- T_6 = 940 = 1400 R

- Heat ratio for air k = 1.4

- Compression ratio r = 3

- W_net,out = 1000 hp

Find:

mass flow rate of the air

rates of heat addition and rejection

Solution:

- Using ideal gas relation compute T_2, T_4, T_10:

                     T_2 = T_1 * r^(k-1/k)

                     T_2 = T_4 = T_10 = 520*3^(.4/1.4) = 711.744 R

- Using ideal gas relation compute T_7, T_5, T_9:

                     T_7 = T_6 * r^(-k-1/k)

                     T_7 = T_5 = T_9 = 1400*3^(-.4/1.4) = 1022.84 R

- The mass flow rate is obtained by:

                     flow(m) = W_net,out / 2*c_p*(1400-1022.84-711.744+520)

                     flow(m) = 1000*.7068 / 2*0.24*(1400-1022.84-711.744+520)

                     flow(m) = 7.941 lbm/s

- The heat input is as follows:

                     Q_in = c_p*(T_6 - T_5)

                     Q_in = 0.24*(1400 - 1022.84)

                     Q_in = 90.5184 Btu/lbm

- The heat output is as follows:

                     Q_out = c_p*(T_10 - T_1)

                     Q_out = 0.24*(711.744 - 520)

                    Q_out = 56.01856 Btu/lbm

                                           

                     

5 0
3 years ago
Gold forms a substitutional solid solution with silver. Compute the number of gold atoms per cubic centimeter for a silver-gold
evablogger [386]

Answer:

Compute the number of gold atoms per cubic centimeter = 9.052 x 10^21 atoms/cm3

Explanation:

The step by step and appropriate substitution is as shown in the attachment.

From number of moles = Concentration x volume

number of moles = number of particles/ Avogadro's number

Volume = mass/density, the appropriate derivation to get the number of moles of atoms

5 0
3 years ago
To find the quotient of 8 divided by 1/3, multiply 8 by?
iVinArrow [24]

Answer: 8.33333333 or 6.1989778

Explanation:

8 0
2 years ago
Other questions:
  • Describe the meaning of the different symbols and abbreviations found on the drawings/documents that they use (such as BS8888, s
    12·1 answer
  • the ____ method is the safest turning technique to use as it does not expose your hands to the airbags deployment area
    15·1 answer
  • The head difference between the inlet and outlet of a 1km long pipe discharging 0.1 m^3/s of water is 0.53 m. If the diameter is
    11·1 answer
  • Which statement about direct-mail messages is most accurate? Group of answer choices Direct mail is an effective channel for per
    15·1 answer
  • Burn in hell i watched your stupid video and i still could not get the answer
    14·1 answer
  • The information on a can of pop indicates that the can contains 360 mL. The mass of a full can of pop is 0.369 kg, while an empt
    14·1 answer
  • How many volts of electricity would it take to power up an entire city? Take Tokyo for example. Please explain!
    12·1 answer
  • 5 kg of a wet steam has a volume of 2 m3
    8·1 answer
  • Welding and cutting done in confined spaces must
    5·2 answers
  • Which of the following characteristics would not give animals an advantage in the ocean?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!