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
Dimas [21]
3 years ago
14

A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output i

s the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value)) Ex: If the input is: 5345 the output is: 2.67 Your program must define and call the following function. The function should return the amount of miles walked. def steps_to_miles(user_steps)
Computers and Technology
1 answer:
Oksi-84 [34.3K]3 years ago
3 0

Answer:

Follows are the code to the given question:

def steps_to_miles(user_steps):#defining a method steps_to_miles that takes a variable user_steps

   return user_steps/2000#use return to calculate the steps

user_steps = int(input())#defining a variable user_steps that holds value from the user-end

print('%0.2f' % steps_to_miles(user_steps))#defining print that calls the steps_to_miles method

Output:

5345

2.67

Explanation:

In this code a method "steps_to_miles" that takes "user_steps" in the parameter inside the method a return keyword is used that calculates the user steps and return its values.

Outside the method, a "user_steps" variable is declared that inputs the value from the user-end pass into the method and prints its value.

You might be interested in
How can you represent a graphic element in a wireframe?
rusak2 [61]

Answer:

The answer is "in the form of design, color and graphic".

Explanation:

The wireframe is also recognized as 'skeleton', it is a static, low-fidelity description of various layouts, which provides shapes to the component. It is indeed a visualization of even an interface using only basic shapes.

It is a 2D illustration of a site user interface, which primarily focuses on capacity planning and priority of information, features available, and role expectations like, storyboards which do usually not include design, color, or graphics.

3 0
3 years ago
write a C program the prints out the size of variables with the following C data types- int, long, unsigned, long long, double,
Anit [1.1K]

<u>C program for finding size of different data types</u>

#include <stdio.h>

//driver function

int main()

{

   int a;  //declaring a of type int

   float b; //declaring b of type float

   double c; //declaring c of type double

   char d; //declaring d of type char

   long e; //declaring e of type long

   long long f; //declaring f of type longlong

   unsigned g; //declaring g of type unsigned

   // Sizeof operator is used to evaluate the size of a variable

printf(" int data type contains: %lu bytes\n",sizeof(a));/*Finding size of int */

printf("float data type contains : %lu bytes\n",sizeof(b));/*Finding size of float */

printf("double data type contains: %lu bytes\n",sizeof(c));/*Finding size of double */

printf("char data type contains: %lu byte\n",sizeof(d));/*Finding size of char */

printf("long data type contains: %lu byte\n",sizeof(e));/*Finding size of long*/ printf("longlong data type contains: %lu byte\n",sizeof(f));/*Finding size of longlong */

printf("unsigned data type contains: %lu byte\n",sizeof(g)); /*Finding size of unsigned */

   return 0;

}

<u>Output</u>

int data type contains: 4 bytes

float data type contains : 4 bytes

double data type contains: 8 bytes

char data type contains: 1 byte

long data type contains: 8 byte

longlong data type contains: 8 byte

unsigned data type contains: 4 byte

4 0
3 years ago
I NEED HEP QUICK
avanturin [10]

Answer:

O = (C2+C3+C4+C5)-81

Explanation:

5 0
2 years ago
Write a program that reads numbers from the user until a blank line is entered. Your
ddd [48]

Answer:

nums = []

while True:

   in = input()

   if in:

       nums.append(in)

   else:

       break

if nums:

   avg = sum(nums) / len(nums)

   for i in range(len(nums)):

       if nums[i] == avg:

           print(f"index: {i+1}")

           print(nums[i])

else:

   print(-1)  # if there aren't any values in nums

Explanation:

Assuming that you are coding in Python 3x. The last 'else' statement is an edge case that you might want to consider, I don't know what you want to put there, but I'm just going to leave it as -1.

5 0
3 years ago
1.an electronic index of books A. web page
zimovet [89]
It was quite difficult to understand what you need. Anyway, I've got it. I guess you need to much all the terms to each sentence. So I think I've done it right. Check it out:

1.an electronic index of books - <span>B. computer catalog
</span><span>
2.a device which categorizes and locates web sites - </span><span>H. search engine
</span><span>
3.to draw a conclusion - </span>D. infer<span> 

4.a block of information stored in an HTML file on a server - </span><span>A. web page
</span><span>
5.the table of contents of a web site - </span><span>G. home page
</span><span>
6.a software package which retrieves information from any or all available Internet servers - </span><span>I. browser
</span><span>
7.a highlighted word or phrase within a web page which acts as a "bridge" to another web page or site - </span><span>F. hyperlink
</span><span>
8.a topic sentence - </span><span>C. key sentence
</span><span>
9.a term which aids in narrowing a web search - </span>E. keyword
5 0
3 years ago
Other questions:
  • "The pkill command terminates _________."
    14·1 answer
  • WHAT IS A COMPUTER ????
    14·2 answers
  • 25 POINTS! PLEASE ANSWER! Karrie would like to draw attention to some short statements in her document. What is the best way to
    6·2 answers
  • How can an administrator make only the files and folders to which a user has at least Read permissions visible?
    13·1 answer
  • Andy, a developer, is designing a new program. Which tool should Andy use to help him complete his task?
    13·1 answer
  • Which type of computer is the best? laptop, tablet, or desktop
    15·2 answers
  • What is key for evaluating internal controls such as human resources, logistics, information technology, risk, legal, marketing
    11·1 answer
  • Visual culture is an area of academic study that deals with the totality of images and visual objects produced in ____________,
    6·1 answer
  • What is a spreadsheet program?<br> A spreadsheet program is a computerized version of _______
    5·1 answer
  • Why do computers use binary code?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!