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 are the two main what are the two main concerns in the research of fluid power efficiency?
Galina-37 [17]

Answer:

The correct option is;

Materials and Components

Explanation:

The efficiency of fluid power is influenced by the components and the materials used to deliver the power of the fluid as such fluid power control are focused on

1) Advances in fluid power

2) Making use of the advantages

3) Making use of the other externally available technological advantages

4) Giving allowance for disadvantages

Areas of interest in advances in fluid power are;

a. Computer optimized flow

b. The use of new and improved materials/coatings

c. The use of components that save energy, such as intelligent supply pressure adapting systems

3 0
2 years ago
Read 2 more answers
Eutectic product in Fe-C system is called A. Pearlite B. Bainite C. Ledeburite D. Spheroidite
zimovet [89]

Answer:

Eutectic product in Fe-C system is called Ledeburite-C.

6 0
3 years ago
Create two arrays with 5 elements each: one will hold Strings and the second will hold integers. Write a program to ask the user
MrMuchimi

Answer:

#include <iostream>

#include <iomanip>

#include <string>

using namespace std;

int main() {

   string name[5];  

   int age[5];  

   int i,j;  

   for ( i = 0; i<=4; i++ ) {  

       cout << "Please enter student's name:";  

       cin >> name[i];  

       cout << "Please enter student's age:";  

       cin >> age[i];          

   }  

for (i=0;i<=4;i++){

   cout<<"Age of  "<< name[i]<<"  is  "<<age[i]<<endl;  

}

}

Output of above program is displayed in figure attached.

5 0
3 years ago
Hello Averyone Subs Chanel Me please "RezaDarmawangsa "<br>Thanks !!​
Yanka [14]

Answer:

what kind of content? I need to know

4 0
2 years ago
An object of mass 521 kg, initially having a velocity of 90 m/s, decelerates to a final velocity of 14 m/s. What is the change i
Harman [31]

Answer:2058.992KJ

Explanation:

Given data

Mass of object\left ( m\right )=521kg

initial velocity\left ( v_0\right )=90m/s

Final velocity\left ( v\right )=14m/s

kinetic energy of body is given by=\frac{1}{2}mv^{2}

change in kinectic energy is given by substracting  final kinetic energy from initial kinetic energy of body.

Change in kinetic energy=\frac{1}{2}\times m\left ( V_0^{2}-V^2\right )

Change in kinetic energy=\frac{1}{2}\times521\left ( 90^{2}-14^2\right )

Change in kinetic energy=2058.992KJ

7 0
3 years ago
Other questions:
  • The design specifications of a 1.2-m long solid circular transmission shaft require that the angle of twist of the shaft not exc
    15·1 answer
  • A cylindrical bar of metal having a diameter of 20.9 mm and a length of 205 mm is deformed elastically in tension with a force o
    9·1 answer
  • By using order of magnitude analysis, the continuity and Navier-Stokes equations can be simplified to the Prandtl boundary-layer
    9·1 answer
  • Ppman2000 Aye Get On Treasure Quest and Join Masons Kingdom :D
    10·1 answer
  • Question # 5
    15·1 answer
  • 1. A flywheel is suspended by resting the inside of the rim on a horizontal knife edge so that the wheel can swing in a vertical
    5·1 answer
  • What are the BENEFITS and RISKS of using automobiles?
    10·1 answer
  • Ughhh my cramps hurt sm
    8·2 answers
  • Nonconductive safety shoes can be safely worn in a potentially explosive environment.
    9·2 answers
  • Two technicians are discussing relays. Technician A says that relays can fail because the relay winding is open. Technician B sa
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!