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
MrRissso [65]
2 years ago
14

LAB: Miles to track laps. (PLEASE CODE IN PYTHON)

Computers and Technology
2 answers:
vagabundo [1.1K]2 years ago
4 0

Answer:

def miles_to_laps(miles):

  return miles / 0.25

miles = 5.2

num_of_lap = miles_to_laps(miles)

print("Number of laps for %0.2f miles is %0.2f lap(s)" % (miles, num_of_lap))

Explanation:

bekas [8.4K]2 years ago
3 0

Answer:

The program in python is as follows:

def miles_to_laps(user_miles):

     return (user_miles/0.25)

mile = float(input("Number of Miles: "))

print("Number of laps: ",end="")

print('{:.2f}'.format(miles_to_laps(mile)))

Explanation:

The first line defines the function miles_to_lap

def miles_to_laps(user_miles):

This line returns the equivalent number of laps

     return (user_miles/0.25)

The main method starts here

This line prompts user for input

mile = float(input("Number of Miles: "))

This line prints the string "Number of laps", without the quotes

print("Number of laps: ",end="")

This prints the equivalent number of laps to two decimal places

print('{:.2f}'.format(miles_to_laps(mile)))

You might be interested in
Why are computer manufacturers constantly releasing faster computers? how do computer users benefit from the increased speed?
Anastaziya [24]
<span>As programs and online activities have grown more robust and innovative, it has simultaneously required computer manufacturers to identify ways to make their devices faster to keep up with these changes. Users benefit immensely due to their ability to have boundless and efficient access to their various needs.</span>
8 0
1 year ago
Jefferson is interested in starting his own business. He plans to borrow money from the local bank in order to finance the busin
sweet [91]
A business plan and a <u>financial plan</u> to show the both his plan to make money, and how much money he will make, spend, use.
8 0
2 years ago
Read 2 more answers
Your network administrator finds a virus has been successfully inserted into the network software. The virus itself is now consi
Svetlanka [38]

Answer: Vulnerability of

Explanation:

The network administrator was able to identify that virus before it led to denial of service to users. Since it has been discovered, it is no longer a threat as measures will be taken to eliminate it. But a virus that was successful uploaded shows how vulnerable the system is or how bad the security protections put in place are. Steps has to be taken to ensure it does not reoccur.

7 0
1 year ago
Read 2 more answers
Write the prototype for a function named showValues. It should accept an array of integers and an integer for the array size as
aalyn [17]

Answer:

void showValues(int [<em>maximum</em><em> </em><em>volume</em>],int);

4 0
2 years ago
Read 3 more answers
A blood bank maintains two tables - DONOR, with information about people who are willing to donate blood and ACCEPTOR, with info
Kipish [7]

Answer:

The sql query is given below.

Since we need to count of males and females for a particular blood group, we put xxx for the blood group.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors,

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

Explanation:

The clauses in the query are as follows.

1. SELECT: all the columns required in the output are put in this clause.

2. FROM JOIN ON: the table(s) from which the above columns are taken are put in this clause.

3. WHERE: any condition required to filter the output is put in this clause.

The query is explained below.

1. Find the number of male donors. Number of anything can be found using COUNT() function. A query is required since gender is included in deciding the type of donor.

2. The query is defined to find number of male donors as follows.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "M%"; )

3. In the previous query, LIKE operator is used since it is not defined what value is stored for male donors.

4. Similarly, the query to find the number of female donors is formed.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "F%"; )

5. Next, the final query is formed as follows.

SELECT: both COUNT() functions will come here.

FROM: table name

WHERE: specific blood group will be put here

GROUP BY: this clause is optional and is not used in this query.

HAVING: this clause is optional and is not used in this query.

6. The query after putting all clauses is shown below.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%"),

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%")

FROM DONOR

WHERE BG = xxx;

7. Alias is used in the above query for each column to get the final query.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors, COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

7 0
2 years ago
Other questions:
  • A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
    10·1 answer
  • When creating a table in the relational database design from an entity in the extended e-r model, the attributes of the entity b
    13·1 answer
  • A ____ partition contains the data necessary to restore a hard drive back to its state at the time the computer was purchased an
    8·2 answers
  • Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest
    10·1 answer
  • Write the definition of a class Telephone. The class has no constructors, one instance variable of type String called number, an
    9·1 answer
  • 1.the following code example would print the data type of x, what data type would that be?
    12·1 answer
  • Assume you have a project with seven activities labeled A-G (following). Derive the earliest completion time (or early finish-EF
    15·1 answer
  • Quantum units of information deploy the properties of entanglement and ____ to offer exponentially greater computing power.
    9·1 answer
  • Which of the following are true statements about the data that can be represented using binary sequences?
    5·1 answer
  • A large number of genetic codes are stored as binary values in a list. Which one of the following conditions must be true in ord
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!