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
The wheel and the attached reel have a combined weight of 50lb and a radius of gyration about their center of 6 A k in = . If pu
marishachu [46]

The complete question is;

The wheel and the attached reel have a combined weight of 50 lb and a radius of gyration about their center of ka = 6 in. If pulley B that is attached to the motor is subjected to a torque of M = 50 lb.ft, determine the velocity of the 200lb crate after the pulley has turned 5 revolutions. Neglect the mass of the pulley.

The image of this system is attached.

Answer:

Velocity = 11.8 ft/s

Explanation:

Since the wheel at A rotates about a fixed axis, then;

v_c = ω•r_c

r_c is 4.5 in. Let's convert it to ft.

So, r_c = 4.5/12 ft = 0.375 ft

Thus;

v_c = 0.375ω

Now the mass moment of inertia about of wheel A about it's mass centre is given as;

I_a = m•(k_a)²

The mass in in lb, so let's convert to slug. So, m = 50/32.2 slug = 1.5528 slug

Also, let's convert ka from inches to ft.

So, ka = 6/12 = 0.5

So,I_a = 1.5528 × 0.5²

I_a = 0.388 slug.ft²

The kinetic energy of the system would be;

T = Ta + Tc

Where; Ta = ½•I_a•ω²

And Tc = ½•m_c•(v_c)²

So, T = ½•I_a•ω² + ½•m_c•(v_c)²

Now, m_c is given as 200 lb.

Converting to slug, we have;

m_c = (200/32.2) slugs

Plugging in the relevant values, we have;

T = (½•0.388•ω²) + (½•(200/32.2)•(0.375ω)²)

This now gives;

T = 0.6307 ω²

The system is initially at rest at T1 = 0.

Resolving forces at A, we have; Ax, Ay and Wa. These 3 forces do no work.

Whereas at B, M does positive work and at C, W_c does negative work.

When pulley B rotates, it has an angle of; θ_b = 5 revs × 2π rad/revs = 10π

While the wheel rotates through an angle of;θ_a = (rb/ra) • θ_b

Where, rb = 3 in = 3/12 ft = 0.25 ft

ra = 7.5 in = 7.5/12 ft = 0.625 ft

So, θ_a = (0.25/0.625) × 10π

θ_a = 4π

Thus, we can say that the crate will have am upward displacement through a distance;

s_c = r_c × θ_a = 0.375 × 4π

s_c = 1.5π ft

So, the work done by M is;

U_m = M × θ_b

U_m = 50lb × 10π

U_m = 500π

Also,the work done by W_c is;

U_Wc = -W_c × s_c = -200lb × 1.5π

U_Wc = -300π

From principle of work and energy;

T1 + (U_m + U_Wc) = T

Since T1 is zero as stated earlier,

Thus ;

0 + 500π - 300π = 0.6307 ω²

0.6307ω² = 200π

ω² = 200π/0.6307

ω² = 996.224

ω = √996.224

ω = 31.56 rad/s

We earlier derived that;v_c = 0.375ω

Thus; v_c = 0.375 × 31.56

v_c = 11.8 ft/s

3 0
4 years ago
The 10 foot wide circle quarter gate AB is articulated at A. Determine the contact force between the gate and the smooth surface
slamgirl [31]

Answer:

F = 641,771.52 \dfrac{lb-ft}{s^2}

Explanation:

Given that

R=8 ft

Width= 10 ft

We know that hydro statics force given as

  F=ρ g A X

ρ is the density of fluid

A projected area on vertical plane

X is distance of center mass of projected plane from free surface of water.

Here

X=8/2  ⇒X=4 ft

A=8 x 10=80  ft^2

So now putting the values

F=ρ g A X

F=62.4(32.14)(80)(4)

F = 641,771.52 \dfrac{lb-ft}{s^2}

   

4 0
4 years ago
Water enters a boiler at a temperature of 110°F. The boiler is to produce 2000 lb/hr of steam at a pressure of 130 psia. How man
strojnjashka [21]
Yes it does the answer is no
5 0
2 years ago
Supercharging is the process of (a) Supplying the intake of an engine with air at a density greater than the density of the surr
iVinArrow [24]

Answer:

a)supplying the  intake of an engine  with air at a  density greater  than the density  of the surrounding  atmosphere

Explanation:

Supercharging  is the process of  supplying the  intake of an engine  with air at a  density greater  than the density  of the surrounding  atmosphere.

By doing this , it increases  the power out put  and increases the  brake thermal  efficiency of the  engine.It also  increases the  volumetric efficiency of the  engine.

So the our  option a is  right.

4 0
3 years ago
Un mol de gas ideal realiza un trabajo de 3000 J sobre su entorno, cuando se expande de manera isotermica a una temperatura de 5
Shkiper50 [21]

Answer:

74,4 litros

Explanation:

Dado que

W = nRT ln (Vf / Vi)

W = 3000J

R = 8,314 JK-1mol-1

T = 58 + 273 = 331 K

Vf = desconocido

Vi = 25 L

W / nRT = ln (Vf / Vi)

W / nRT = 2.303 log (Vf / Vi)

W / nRT * 1 / 2.303 = log (Vf / Vi)

Vf / Vi = Antilog (W / nRT * 1 / 2.303)

Vf = Antilog (W / nRT * 1 / 2.303) * Vi

Vf = Antilog (3000/1 * 8,314 * 331 * 1 / 2,303) * 25

Vf = 74,4 litros

3 0
3 years ago
Other questions:
  • What are the disadvantages of using 3D ink jet printing ??
    8·1 answer
  • Determine the minimum force P to prevent the 30 kg uniform rod AB from sliding. The contact surface at B is smooth, whereas the
    13·1 answer
  • In the contemporary approach to control systems, benefits of continuous monitoring include which one of the following? Multiple
    9·1 answer
  • In this type of projection, the angles between the three axes are different:- A) Isometric B) Axonometric C) Trimetric D) Dimetn
    11·1 answer
  • Problem 4.041 SI Refrigerant 134a enters an insulated compressor operating at steady state as saturated vapor at -26oC with a vo
    8·1 answer
  • What can you add to a seatbelt ??<br> HELP ASAP
    15·1 answer
  • These are the most widely used tools and most often abuse tool​
    15·2 answers
  • What is a beam on a bridge? what does it do?
    6·1 answer
  • ANSWER ASAP<br> What is the point system?<br> this is for driving
    8·1 answer
  • Write a SELECT statement that returns these four columns:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!