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
horsena [70]
3 years ago
8

It is good programming style to always use a for loop when the number of times to repeat the action is known. The following code

uses a while loop that mimics what a for loop should do. Rewrite it using a for loop that accomplishes exactly the same thing.
myprod = 1;
i = 1;
while i <= 4
num = input('Enter a number: ');
myprod = myprod ⁎ num;
i = i + 1;
end
Mathematics
1 answer:
Paraphin [41]3 years ago
7 0

myprod = 1

num = input("Enter a number: ")

for i in range(1, 5):

myprod *= num

You might be interested in
Solving the equation
creativ13 [48]

Answer:

9s+2=9s-5

Step-by-step explanation:

2 times 9s and 2 times 2 then subtract your 9sequals 3 times 3sand 3 times 6 so then you get 9s and 18 then you subtract 23 and you get 23. then you get your answer 9s-5=9s+2

5 0
3 years ago
A = 1/2 bh solve for h
Elanso [62]
H=A/0.5b isolate h
h=2A/b Make all terms integers (optional)
6 0
3 years ago
Advertising expenses are a significant component of the cost of goods sold. Listed below is a frequency distribution showing the
Alexxandr [17]

Answer:

Step-by-step explanation:

The table can be computed as:

Advertising Expenses ($ million)     Number of companies

25 up to 35                                                    4

35 up to 45                                                    19

45 up to 55                                                    27

55 up to 65                                                    16

65 up to 75                                                     9

TOTAL                                                            75

Let's find the probabilities first:

P(25 - 35) = P \Big(\dfrac{25-50.93}{10.80}

For 35 up to 45

P(35 - 45) = P \Big(\dfrac{35-50.93}{10.80}

For 45 up to 55

P(45 - 55) = P \Big(\dfrac{45-50.93}{10.80}

For 55 up to 65

P(55 - 65) = P \Big(\dfrac{55-50.93}{10.80}

For 65 up to 75

P(65 - 75) = P \Big(\dfrac{65-50.93}{10.80}

Chi-Square Table can be computed as follows:

Expense   No of   Probabilities(P)  Expe                (O-E)^2   \dfrac{(O-E)^2}{E}

             compa                                 cted E (n*p)

             nies (O)  

25-35           4      0.0612    75*0.0612 = 4.59        0.3481       0.0758

35-45           19     0.2218   75*0.2218 = 16.635     5.5932       0.3362

45-55           27     0.3568   75*0.3568 = 26.76     0.0576      0.021

55-65           16      0.2552   75*0.2552 = 19.14      9.8596      0.5151

65-75           9      0.0839     75*0.0839 = 6.2925   7.331         1.1650

                                                                                           \sum \dfrac{(O-E)^2}{E}= 2.0492                                                                                                      

Using the Chi-square formula:

X^2 = \dfrac{(O-E)^2}{E} \\ \\ Chi-square  \ X^2 = 2.0942

Null hypothesis:

H_o: \text{The population of advertising expenses follows a normal distribution}

Alternative hypothesis:  

H_a: \text{The population of advertising expenses does not follows a normal distribution}

Assume that:

\alpha = 0.02

degree of freedom:

= n-1

= 5 -1

= 4

Critical value from X^2 = 11.667

Decision rule: To reject H_o  \  if \  X^2  test statistics is greater than X^2 tabulated.

Conclusion: Since X^2 = 2.0942 is less than critical value 11.667. Then we fail to reject H_o

6 0
3 years ago
Which represents the solution to the absolute value equation? 3|2x+4|-1=11
larisa86 [58]
The first step for absolute value equations is to isolate the expression contained within the absolute value bars:

3|2x+4|-1 = 11
3|2x+4| = 12
|2x+4| = 4

so |2x+4| is 4 units away from 0 on a number line, but we don't know in which direction -- negative or positive? you'll have two answers.

2x+4 = 4

AND

2x+4 = -4

solve both of those two step equations and you'll get

x = 0

AND

x = -4

so 0 and -4 are your solutions.
5 0
3 years ago
Find the distance between the two points rounding to the nearest tenth (if necessary). (-1,8) and (8,5)​
Cloud [144]
Your answer to is 9.5
4 0
3 years ago
Other questions:
  • Homework I need help
    12·1 answer
  • Use Vocabulary in Writing
    14·1 answer
  • Willis bought a gallon of paint. He painted a wall that is 9 ft high and 10 ft wide. Then he used the rest of the paint to paint
    7·1 answer
  • Mariska was comparing her options for investment. One choice she was looking at showed that her principal of $1,875 over 10 year
    8·1 answer
  • Which of this expressions is not a polynomial
    7·1 answer
  • Which phrases can be represented by the expression StartFraction h Over 30 EndFraction? Check all that apply.
    13·2 answers
  • Mr. Clark wants to pay for his order with a $20 bill, but Jeremy does not have change. Jeremy tells Mr. Clark he will give him t
    14·1 answer
  • Can someone tell me what the answer for <br> 2 kos60° + tan 45 ° ​
    14·1 answer
  • Multiply ()
    13·1 answer
  • Heeeeeeeeeeeeeeeeeelp
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!