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
grin007 [14]
3 years ago
13

For question 2 you will need to write your own Python code. Think through the problem, and re-read if necessary. Determine how y

ou might solve the problem logically. Think of what variables you might need to store temporary values. Your friend was bragging about how many stairs he climbed each day because of his apartment location on the fifth floor. Calculate how many times your friend would have to go down then back up the stairs to reach his fifth floor apartment to reach 100, 500, 1000 and 5000 steps. The apartments all have vaulted ceilings, so use 16 steps per floor in your calculations. Remember to count down and back up as one trip. You will also reuse the variable that contains the target number of steps. Round up. HINT: take a look at previous question, and the use of import math and math.ceil(). Recommended variable names you will need for this question: steps_per_floor, floor, target_steps, trips >>>: Write a program that calculates the total number of trips given 100, 500, 1000 or 5000 daily steps, 16 steps per floor, and down and back up the stairs represents one trip. Re-use the target_steps variable. Round the number of trips up to the nearest whole integer. >>>: Display the number of trips for each of the four step counts, using the following example, illustrating the output for 100 steps. Add the other three results below the 100 steps result.
Computers and Technology
1 answer:
user100 [1]3 years ago
7 0

Answer:

It has to be performed a minimum of  1  trips to do   100 steps

It has to be performed a minimum of  4  trips to do   500 steps

It has to be performed a minimum of  7  trips to do   1000 steps

It has to be performed a minimum of  32  trips to do   5000 steps

All trips need to be  44

Explanation:

open python console and execute the .py code bellow:

import math

floor_steps=16

floor=5

total=0

target_steps=2*floor_steps*floor

trips=100/(target_steps)

trips= math.ceil(trips)

total+=trips

print("It has to be performed a minimum of ",trips," trips to do   100 steps")

trips=500/(target_steps)

trips= math.ceil(trips)

total+=trips

print("It has to be performed a minimum of ",trips," trips to do   500 steps")

trips=1000/(target_steps)

trips= math.ceil(trips)

total+=trips

print("It has to be performed a minimum of ",trips," trips to do   1000 steps")

trips=5000/(target_steps)

trips= math.ceil(trips)

total+=trips

print("It has to be performed a minimum of ",trips," trips to do   5000 steps")

print("All trips need to be ",total)

You might be interested in
Write a complete program that asks the user to input the height and radius of a cone (both of type double) and calls two individ
Vika [28.1K]

Answer:

The program in C++ is as follows:

#include <iostream>

#include <math.h>

using namespace std;

double area(double r, double h){

   double A = 3.14 * r * (r + sqrt(h*h + r*r));

   return A;}

double volume(double r, double h){

   double V = (1.0/3) * 3.14 * r*r * h;

   return V;}

int main(){

   double radius, height;

   cout<<"Radius: "; cin>>radius;

   cout<<"Height: "; cin>>height;

   cout<<"Area: "<<area(radius,height)<<endl;

   cout<<"Volume: "<<volume(radius,height);

   return 0;

}

Explanation:

This declares the area function

double area(double r, double h){

Calculate area

   double A = 3.14 * r * (r + sqrt(h*h + r*r));

Return the calculated area

   return A;}

This declares the volume method

double volume(double r, double h){

Calculate volume

   double V = (1.0/3) * 3.14 * r*r * h;

Return the calculated volume

   return V;}

The main begins here

int main(){

Declare radius and height

   double radius, height;

Get input for radius

   cout<<"Radius: "; cin>>radius;

Get input for height

   cout<<"Height: "; cin>>height;

Call the area function and print the returned value for area

   cout<<"Area: "<<area(radius,height)<<endl;

Call the volume function and print the returned value for volume

   cout<<"Volume: "<<volume(radius,height);

   return 0;

}

4 0
3 years ago
Which type of topology describes the physical arrangement, installation, and connection of cables, computer, and other devices?
Nutka1998 [239]
<span>The network topology describes the physical arrangement, installation, and connection of cables, computer, and other devices.
The network topology can be bus topology (a</span><span> network topology that uses a single cable or conductor to connect all nodes on the network.) ,</span>star topology (a network topology in which cables running from each node connect to a single point, such as a hub.), ring (a network topology that consists of a single cable that runs continuously from node to node), mesh, hybrid, hub topology,... according the arrangement of the nodes. 

8 0
3 years ago
Read 2 more answers
Lorann sends messages to Aiden that always go into Aiden's Junk E-mail folder. Which process would best correct this problem so
BaLLatris [955]
Go to settings and find out.
7 0
3 years ago
With examples write short notes on any of the following terms below.
stepladder [879]

types of computer viruses

1. polymorphic virus

2. worm

3.trojan horse

4.directory virus

5.boot virus

6.directory virus

7. macro virus

8. web scripting virus

9. memory resident virus

10. overwrite virus

11. direct action virus

12. multipartite virus

5 0
3 years ago
Write the sum of products, the canonical product of sums, theminterm shorthand and the maxterm shorthand for the following:
dem82 [27]

Answer:

SOP=AB'+B'C

POS=B'(A'+C)

Shorthand Minterms=m₀+m₁+m₅

Shorthand Maxterms=M₃+M₂+M₄+M₆+M₇

Explanation:

For the full explanation of this question refer to the image attached which is of the k-Map of F.As we can see in the k-map that there are only 3 ones.by making 2 pairs of 1 we get the SOP expression.

Rest of them are zero from there we will get the POS expression.

The one's in the k-map represent the Minterms and 0's represent Maxterms and the number written in the box is their respective minterm and maxterm number.Minterms are represented by m and maxterms are represented by M.

7 0
4 years ago
Other questions:
  • I need help to find out what is wrong with this program and my variable, "exponent" comes out as 0 in the output instead of the
    14·1 answer
  • Explain the following terms:<br><br> a) Atomicity<br><br> b) DML
    12·1 answer
  • Write an if/else statement that compares the variable age with 65, adds 1 to the variable seniorCitizens if age is greater than
    14·1 answer
  • COMPUTER FUNDIMENTAL HELP 15 POINTS!! RESEND IT
    7·2 answers
  • Andy is trying to put together a holiday gift knapsack (with W=8) for Sarah. He has n items to choose from, each with infinitely
    15·1 answer
  • As Assembly language code runs on a CPU invoking functions and using the stack, it is clear that CPU registers are
    8·1 answer
  • Michael’s team is presenting a robot before their examiners. What do they need which is a definitive description of the final pr
    6·1 answer
  • COMO DEFINES LAS PALABRAS COMPUTADOR Y DISPOSITIVO? MENCIONA EJEMPLOS
    13·1 answer
  • How do I get the pictures from my old Samsung phone to put on my iPhone? The Samsung is turned off. Is there a way to transfer i
    8·1 answer
  • Define generation of computer ​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!