answer.
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
Naily [24]
2 years ago
7

CHALLENGE ACTIVITY 2.8.1: Using constants in expressions. The cost to ship a package is a flat fee of 75 cents plus 25 cents per

pound. 1. Declare a const named CENTS_PER_POUND and initialize with 25. 2. Get the shipping weight from user input storing the weight into shipWeightPounds. 3. Using FLAT_FEE_CENTS and CENTS_PER_POUND constants, assign shipCostCents with the cost of shipping a package weighing shipWeightPounds.
Engineering
1 answer:
mihalych1998 [28]2 years ago
7 0

Answer:

Weight(lb): 10

Flat fee(cents): 75

Cents per pound: 25

Shipping cost(cents): 325

Explanation:

we run this as a jave programming language

import java.util.Scanner;

public class Shipping Calculator {

   public static void main (String [] args) {

       int shipWeightPounds = 10;

       int shipCostCents = 0;

       final int FLAT_FEE_CENTS = 75;

       

        final int CENTS_PER_POUND = 25;

       shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPound

       /* look up the solutioin above */

       System.out.println("Weight(lb): " + shipWeightPounds);

       System.out.println("Flat fee(cents): " + FLAT_FEE_CENTS);

       System.out.println("Cents per pound: " + CENTS_PER_POUND);

       System.out.println("Shipping cost(cents): " + shipCostCents);

   }

}

You might be interested in
4. Two technicians are discussing the evaporative emission monitor. Technician A says that serious monitor faults cause a blinki
snow_lady [41]

Answer:

The correct option is;

Neither Technician A nor B

Explanation:

The evaporative emission monitor or Evaporaive Emission Control System EVAP System monitors enables the Power Control Module of the car to check fuel system leak integrity and the vapor consumption efficiency during engine combustion

It is a requirement of EPA on cars to check the emission of smug forming evaporates from cars

Serious monitor faults can cause the turning on of the check engine lights and the vehicle will not pass OBD II test, but it will not lead to engine shutdown

It runs when the engine is 15 to 85% full and the TP sensor is between 9% and 35%.

Therefore, the correct option is that neither Technician A nor B are correct.

3 0
2 years ago
Finally you will implement the full Pegasos algorithm. You will be given the same feature matrix and labels array as you were gi
Diano4ka-milaya [45]

Answer:

In[7] def pegasos(feature_matrix, labels, T, L):

   """

   .

   let learning rate = 1/sqrt(t),

   where t is a counter for the number of updates performed so far       (between 1   and nT inclusive).

Args:

       feature_matrix - A numpy matrix describing the given data. Each row

           represents a single data point.

       labels - A numpy array where the kth element of the array is the

           correct classification of the kth row of the feature matrix.

       T -  the maximum number of times that you should iterate through the feature matrix before terminating the algorithm.

       L - The lamba valueto update the pegasos

   Returns: Is defined as a  tuple in which the first element is the final value of θ and the second element is the value of θ0

   """

   (nsamples, nfeatures) = feature_matrix.shape

   theta = np.zeros(nfeatures)

   theta_0 = 0

   count = 0

   for t in range(T):

       for i in get_order(nsamples):

           count += 1

           eta = 1.0 / np.sqrt(count)

           (theta, theta_0) = pegasos_single_step_update(

               feature_matrix[i], labels[i], L, eta, theta, theta_0)

   return (theta, theta_0)

In[7] (np.array([1-1/np.sqrt(2), 1-1/np.sqrt(2)]), 1)

Out[7] (array([0.29289322, 0.29289322]), 1)

In[8] feature_matrix = np.array([[1, 1], [1, 1]])

   labels = np.array([1, 1])

   T = 1

   L = 1

   exp_res = (np.array([1-1/np.sqrt(2), 1-1/np.sqrt(2)]), 1)

   

   pegasos(feature_matrix, labels, T, L)

Out[8] (array([0.29289322, 0.29289322]), 1.0)

Explanation:

In[7] def pegasos(feature_matrix, labels, T, L):

   """

   .

   let learning rate = 1/sqrt(t),

   where t is a counter for the number of updates performed so far       (between 1   and nT inclusive).

Args:

       feature_matrix - A numpy matrix describing the given data. Each row

           represents a single data point.

       labels - A numpy array where the kth element of the array is the

           correct classification of the kth row of the feature matrix.

       T -  the maximum number of times that you should iterate through the feature matrix before terminating the algorithm.

       L - The lamba valueto update the pegasos

   Returns: Is defined as a  tuple in which the first element is the final value of θ and the second element is the value of θ0

   """

   (nsamples, nfeatures) = feature_matrix.shape

   theta = np.zeros(nfeatures)

   theta_0 = 0

   count = 0

   for t in range(T):

       for i in get_order(nsamples):

           count += 1

           eta = 1.0 / np.sqrt(count)

           (theta, theta_0) = pegasos_single_step_update(

               feature_matrix[i], labels[i], L, eta, theta, theta_0)

   return (theta, theta_0)

In[7] (np.array([1-1/np.sqrt(2), 1-1/np.sqrt(2)]), 1)

Out[7] (array([0.29289322, 0.29289322]), 1)

In[8] feature_matrix = np.array([[1, 1], [1, 1]])

   labels = np.array([1, 1])

   T = 1

   L = 1

   exp_res = (np.array([1-1/np.sqrt(2), 1-1/np.sqrt(2)]), 1)

   

   pegasos(feature_matrix, labels, T, L)

Out[8] (array([0.29289322, 0.29289322]), 1.0)

6 0
2 years ago
A paint company produces glow in the dark paint with an advertised glow time of 15 min. A painter is interested in finding out i
andrew11 [14]

Answer:

p_v = P(z

Now we can decide based on the significance level \alpha. If p_v we reject the null hypothesis and in other case we FAIL to reject the null hypothesis.

\alpha=0.05 we see that p_v< \alpha so then we have enough evidence to reject the null hypothesis and we can conclude that the true mean is significantly less than 15

\alpha=0.01 we see that p_v> \alpha so then we have enough evidence to FAIL to reject the null hypothesis and we can conclude that the true mean is NOT significantly less than 15

\alpha=0.001 we see that p_v> \alpha so then we have enough evidence to FAIL to reject the null hypothesis and we can conclude that the true mean is NOT significantly less than 15

Explanation:

For this case they conduct the following system of hypothesis for the ture mean of interest:

Null hypothesis: \mu \leq 15

Alternative hypothesis: \mu >15

The statistic for this hypothesis is:

z = \frac{\bar X -\mu}{\frac{\sigma}{\sqrt{n}}}

And on this case the value is given z = -2.30

For this case in order to take a decision based on the significance level we need to calculate the p value first.

Since we have a lower tailed test the p value would be:

p_v = P(z

Now we can decide based on the significance level \alpha. If p_v we reject the null hypothesis and in other case we FAIL to reject the null hypothesis.

\alpha=0.05 we see that p_v< \alpha so then we have enough evidence to reject the null hypothesis and we can conclude that the true mean is significantly less than 15

\alpha=0.01 we see that p_v> \alpha so then we have enough evidence to FAIL to reject the null hypothesis and we can conclude that the true mean is NOT significantly less than 15

\alpha=0.001 we see that p_v> \alpha so then we have enough evidence to FAIL to reject the null hypothesis and we can conclude that the true mean is NOT significantly less than 15

3 0
2 years ago
Q1. In electronic circuits it is not unusual to encounter currents in the microampere range. Assume a 35 μA current, due to the
Anit [1.1K]

Answer:

2.9*10^14 electrons

Explanation:

An Ampere is the flow of one Coulomb per second, so 35 μA = is 35*10^-6 C per second.

An electron has a charge of 1.6*10^-19 C.

35*10^-6 / 1.6*10^-19 = 2.9*10^14 electrons

So, with a current o 35 μA you have an aevrage of 2.9*10^14 electrons flowing past a fixed reference cross section perpendicular to the direction of flow.

7 0
2 years ago
A water pump increases the water pressure from 15 psia to 70 psia. Determine the power input required, in hp, to pump 1.5 ft3/s
svetoff [14.1K]

Answer:

11.52 hp

Explanation:

<u><em>Givens: </em></u>

p_1  = 15 pisa

p_2  = 70 pisa

V_ol=1.5 ft^3/s

<u><em>Solution:  </em></u>

Note: m = p x V_ol (assuming in compressible flow —> p =const)  

The total change in the system mechanical energy can be calculated as follows,  

Δ e= (p_2 - p_1 ) /p

The power needed can be calculated as follows

P = W =mΔ e  = p x  V_ol x(p_2 - p_1 ) /p

  = V_ol x (p_2 - p_1 )

  = 44 pisa. ft^3/s

  = 44 x (1 btu/5.404pisa. ft^3) x (1 hp/0.7068btu/s)

  = 11.52 hp

3 0
2 years ago
Other questions:
  • What are the three most common metals used in die casting?
    6·1 answer
  • 5. A typical paper clip weighs 0.59 g and consists of BCC iron. Calculate (a) the number of
    5·1 answer
  • If the current on your power supply exceeds 500 mA it can damage the supply. Suppose the supply is set for 37 V. What is the sma
    9·1 answer
  • An excited electron in an Na atom emits radiation at a wavelength 589 nm and returns to the ground state. If the mean time for t
    10·1 answer
  • Suggest how any sorting algorithm can be augmented in a way to make the best-case count of its key comparisons equal to just n−1
    6·1 answer
  • The purification of hydrogen gas is possible by diffusion through a thin palladium sheet. Calculate the number of kilograms of h
    8·1 answer
  • Python Homework
    12·1 answer
  • Suppose we store a relation R (x,y) in a grid file. Both attributes have a range of values from 0 to 1000. The partitions of thi
    12·1 answer
  • The roof of a building frame is subjected to the wind loading shown. Determine (a) the equivalent force-couple system at D, (b)
    11·1 answer
  • 140-character statement that completes this sentence: I pledge to not text and drive because...
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!