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
QUESTION 6
Aloiza [94]
It would be 2 Portfolio
3 0
3 years ago
The 15-kg block A slides on the surface for which µk = 0.3. The block has a velocity v = 10 m/s when it is s = 4 m from the 10-k
sammy [17]

Answer:

s_max = 0.8394m

Explanation:

From equilibrium of block, N = W = mg

Frictional force = μ_k•N = μ_k•mg

Since μ_k = 0.3,then F = 0.3mg

To determine the velocity of Block A just before collision, let's apply the principle of work and energy;

T1 + ΣU_1-2 = T2

So, (1/2)m_a•(v_ao)² - F•s =(1/2)m_a•(v_a1)²

Plugging in the relevant values to get ;

(1/2)•(15)•(10)² - (0.3•15•9.81•4) =(1/2)(15)•(v_a1)²

750 - 176.58 = 7.5(v_a1)²

v_a1 = 8.744 m/s

Using law of conservation of momentum;

Σ(m1v1) = Σ(m2v2)

Thus,

m_a•v_a1 + m_b•v_b1 = m_a•v_a2 + m_b•v_b2

Thus;

15(8.744) + 10(0) = 15(v_a2) + 10(v_b2)

Divide through by 5;

3(8.744) + 2(0) = 3(v_a2) + 2(v_b2)

Thus,

3(v_a2) + 2(v_b2) = 26.232 - - - (eq1)

Coefficient of restitution has a formula;

e = (v_b2 - v_a2)/(v_a1 - v_b1)

From the question, e = 0.6.

Thus;

0.6 = (v_b2 - v_a2)/(8.744 - 0)

0.6 x 8.744 = (v_b2 - v_a2)

(v_b2 - v_a2) = 5.246 - - - (eq2)

Solving eq(1) and 2 simultaneously, we have;

v_b2 = 8.394 m/s

v_a2 = 3.148 m/s

Now, to find maximum compression, let's apply conservation of energy on block B;

T1 + V1 = T2 + V2

Thus,

(1/2)m_b•(v_b2)² + (1/2)k(s_1)² = (1/2)m_b•(v_b'2)² + (1/2)k(s_max)²

(1/2)10•(8.394)² + (1/2)1000(0)² = (1/2)10•(0)² + (1/2)(1000)(s_max)²

500(s_max)² = 352.29618

(s_max)² = 352.29618/500

(s_max)² = 0.7046

s_max = 0.8394m

8 0
3 years ago
What type of models can be communicated in more than one way.
guajiro [1.7K]
A 3-D model can be communicated, and can also be a visual model.
4 0
3 years ago
In Lab 7, we worked through a program that displayed the homeless shelter occupancy over time. The same approach can be used for
Bezzdna [24]

Answer:

Explanation:

The python code to generate this is quite simple to run.

i hope you understand everything written here, you can as well try out other problems to understand better.

First to begin, we import the package;

Code:

import pandas as pd

import matplotlib.pyplot as plt

name = input('Enter name of the file: ')

op = input('Enter name of output file: ')

df = pd.read_csv(name)

df['Date'] = pd.to_datetime(df["Date"].apply(str))

plt.plot(df['Date'],df['Absent']/(df['Present']+df['Absent']+df['Released']),label="% Absent")

plt.legend(loc="upper right")

plt.xticks(rotation=20)

plt.savefig(op)

plt.show()

This should generate the data(plot) as seen in the uploaded screenshot.

thanks i hope this helps!!!

6 0
3 years ago
Steep safety ramps are built beside mountain highway to enable vehichles with fedective brakes to stop safely. a truck enters a
Veronika [31]

Answer:

a. 6 seconds

b. 180 feet

Explanation:

Images attached to show working.

a. You have the position of the truck so you integrate twice. Use the formula and plug in the time t = 7 sec. Check out uniform acceleration. The time at which the truck's velocity is zero  is when it stops.

b. Determine the initial speed. Plug in the time calculated in the previous step. From this we can observe that the truck comes to a stop before the end of the ramp.

7 0
3 years ago
Other questions:
  • Effects of adding more insulation to a cylinder increases heat transfer area. a)-True b)-False
    13·1 answer
  • The level of water in a dam is 6 m. The rectangular gate ABC is pinned at point B so it can rotate freely about this point. When
    12·1 answer
  • As a top-level executive at your own company, you are worried that your employees may steal confidential data too easily by down
    12·1 answer
  • An intranet is a restricted network that relies on Internet technologies to provide an Internet-like environment within the comp
    11·1 answer
  • Determine the design angle ϕ (0∘≤ϕ≤90 ∘) between struts AB and AC so that the 400 lb horizontal force has a component of 600 lb
    10·1 answer
  • Drivers killed in speed related accidents usually have a history of_______
    8·2 answers
  • alguien me ayuda con una tarea? Está en mi perfil de matemática, porfavorrr regalaré corona pero porfavor​
    7·1 answer
  • A cylindrical 1040 steel rod having a minimum tensile strength of 865 MPa (125,000 psi), a ductility of at least 10%EL, and a fi
    7·1 answer
  • The loneliest people are to kindest
    14·2 answers
  • What are the inputs and outputs of a sailboat?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!