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
An engine indicator is used to determine the following: (a) speed (d) m.e.p, and IHP (e) BHP (b) temperature (c) volume of cylin
Greeley [361]

Answer:

Option (d) MEP and IHP

Explanation:

MEP stands for Mean Effective Pressure and IHP stands for Indicated Horse Power

In engines (Internal Combustion), engine indicator is generally to indicate the indicate the changes in pressure inside the cylinder of an Internal Combustion Engine or IC engines. Once, Mean Effective Pressure of the engine is calculated it further helps to calculate the Horse power and both these quantities, i.e., MEP and IHP are displayed on the engine indicator.

8 0
3 years ago
If safeguarding is not possible what must be used instead
Gnom [1K]

Answer: since safeguarding isn't possible distance and location must be used instead

5 0
3 years ago
La liberacion de energia se facilita por
lakkis [162]

Answer:

Enzimas

Explanation:

6 0
3 years ago
What should you use to keep battery terminals from corroding
Ray Of Light [21]

Answer: Apply battery-terminal grease to the terminals to help prevent corrosion. It's available at any auto parts store and usually comes in a little ketchup-like packet. Another great option is AMSOIL Heavy-Duty Metal Protector. It creates a protective coating on terminals that wards off corrosion.

Explanation:

3 0
3 years ago
This is just so I can flip the picture
Pepsi [2]

Answer:

ok

Explanation:

thx for points

7 0
4 years ago
Other questions:
  • This is a new technology meant to reduce vehicle roll-overs A. Lane-departure warning B. Anti-lock brakes C. Inspection reports
    7·1 answer
  • "Hint: A backslash \ in a string acts as an escape character, such as with a newline \n. So, to print an actual backslash, escap
    6·1 answer
  • A thin metal disk of mass m=2.00 x 10^-3 kg and radius R=2.20cm is attached at its center to a long fiber. When the disk is turn
    11·1 answer
  • Air flows through a 0.25-m-diameter duct. At the inlet the velocity is 300 m/s, and the stagnation temperature is 90°C. If the M
    8·1 answer
  • What browser should you use with Canvas?
    15·1 answer
  • Discuss the effect of PRE and CLR in JK flip-flop.​
    8·1 answer
  • Select the correct answer.
    6·1 answer
  • Many of the problems applied scientists address are multidisciplinary issues and therefore require the collaboration of scientis
    14·1 answer
  • A continuous fiber-reinforced composite is to be produced by dispersing 60 vol% carbon fibers in a polycarbonate matrix. if the
    6·1 answer
  • Liquid methanol is pumped from a large storage tank through a 1-in.ID pipe at a rate of 3.00gal/mm.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!