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
Π/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9 ...
leva [86]

Answer: Pi= 4 - 4/3 + 4/5 - 4/7 + 4/9 ...

Explanation:

Is the same as the example,

If Π/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9 ...

Then

(Π/4 )*4= 4*(1 - 1/3 + 1/5 - 1/7 + 1/9 ...)

Π =4 - 4/3 + 4/5 - 4/7 + 4/9 ...

The way to write this is

Sum(from n=0 to n=inf) of (-1)^n 4/(2n+1)

(photo)

6 0
3 years ago
What is (10 to the power of three) times (3 to the power of 10)? will give brainliest
VLD [36.1K]

59,049,000 is the answer.

7 0
3 years ago
The electric motor exerts a torque of 800 N·m on the steel shaft ABCD when it is rotating at a constant speed. Design specificat
kodGreya [7K]

Answer:

d= 4.079m ≈ 4.1m

Explanation:

calculate the shaft diameter from the torque,    \frac{τ}{r} = \frac{T}{J} = \frac{C . ∅}{l}

Where, τ = Torsional stress induced at the outer surface of the shaft (Maximum Shear stress).

r = Radius of the shaft.

T = Twisting Moment or Torque.

J = Polar moment of inertia.

C = Modulus of rigidity for the shaft material.

l = Length of the shaft.

θ = Angle of twist in radians on a length.  

Maximum Torque, ζ= τ ×  \frac{ π}{16} × d³

τ= 60 MPa

ζ= 800 N·m

800 = 60 ×  \frac{ π}{16} × d³

800= 11.78 ×  d³

d³= 800 ÷ 11.78

d³= 67.9

d= \sqrt[3]{} 67.9

d= 4.079m ≈ 4.1m

3 0
3 years ago
Read 2 more answers
You don't have to notify employees that a lockout/tagout is about to begin?
Sergeu [11.5K]

Answer:

When the imposter is sus : O

Explanation:

3 0
3 years ago
A specific internal combustion engine has a displacement volume VD of 5.6 liters. The processes within each cylinder of the engi
Kisachek [45]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the step by step explanation to the question above.

6 0
3 years ago
Other questions:
  • A circuit contains a 40 ohm resistor and a 60 ohms resistor connected in parallel. If you test this circuit with a DMM you shoul
    14·1 answer
  • A driver is traveling at 52 mi/h on a wet road. an object is spotted on the road 415 ft ahead and the driver is able to come to
    5·2 answers
  • Exercise 19
    15·1 answer
  • What is the ILS stand for
    8·2 answers
  • The value read at an analog input pin using analogRead() is returned as a binary number between 0 and the maximum value that can
    14·1 answer
  • What is 39483048^349374*3948048/3i4u4
    15·1 answer
  • An ideal Rankine cycle with reheat uses water as the working fluid. The conditions at the inlet to the first-stage turbine are p
    12·1 answer
  • How do you explain the application of regulations in locations containing baths, showers and electric floor heating, including t
    10·1 answer
  • A single-phase load is located 2800 ft from its source. The load draws a current of 86 A and operates on 480 V. The maximum volt
    10·1 answer
  • In a morphological matrix, which of the following contains the parameters that are essential to a design?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!