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
Dvinal [7]
2 years ago
12

One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a numbe

r of miles as an argument and returns the number of laps. Complete the program to output the number of laps. 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: 1.5 the output is: 6.00 Ex: If the input is: 2.2 the output is: 8.80 Your program must define and call the following function: def miles_to_laps(user_miles)
Engineering
2 answers:
hodyreva [135]2 years ago
8 0

Answer:

Java.

Explanation:

import java.util.Scanner;

///////////////////////////////////////////////////////////

public class MyClass {

   static void miles_to_laps(float miles) {

       double laps = miles/0.25;

       System.out.printf("Number of laps: %s", String.format("%.2f", laps));

   }

///////////////////////////////////////////////////////////

   public static void main(String args[]) {

       System.out.print("Enter miles: ");

       Scanner input = new Scanner(System.in);

       float miles = input.nextFloat();

       if (miles < 0) {

           System.out.println("Invalid input");

       }

       else

           miles_to_laps(miles);

   }

}

I have used the Scanner library for user input.

MatroZZZ [7]2 years ago
7 0

Answer:

def miles_to_laps(user_miles):

return user_miles/0.25

if __name__ == '__main__':

miles = float(input(""))

lap = miles_to_laps(miles)

print("%.2f"%lap)

Explanation:

because it works.

You might be interested in
In this module you learned about searching, sorting and algorithms in C++ and how to implement these elements in your C++ progra
alisha [4.7K]

Question is not well presented:

The search strings in the question are not well formatted.

First thing, I'll arrange the account number in order of 7;

Meaning that the length of each account number is 7

8149420 5333174 3080098 6755963 9526981 4449539 9387197 5104726 2931356 4282637 1750219 6086650 3164838 2419590 4578589 9718904 674994 12545408

Answer:

// This program is written in C++ Programming Language

// Comments are used for explanatory purpose

// Program starts here

#include <iostream>

using namespace std;

// Initialise Function

int ArrayList(int[], int, int);

// Main Method starts at

int main()

{

// The list of account is 18; so, we Initialise an integer Variable to hold this value

const int acctlist = 18;

// Initialise an array to hold the account numbers

int List[acctlist] = { 8149420 5333174 3080098 6755963 9526981 4449539 9387197 5104726 2931356 4282637 1750219 6086650 3164838 2419590 4578589 9718904 674994 12545408

};

// Declare account number and search result Variables of type integer

int accountnumber, Result;

// Prompt user for account number

cout << "Enter a valid account number: ";

cin >> accountnumber;

// Determine if valid or not

Result = ArrayList(List, acctlist, accountnumber);

if(Result == -1){

cout << "Account number " << AcctNum << " is invalid.\n";}

else{

cout << "Account number " << List[Result] << " is valid\n";

}

return 0;

}

// Function starts here

int ArrayList(int list[], int size, int value)

{

int index = 0,

pos = -1;

bool seen = false;

// Check if Account number is seen in list

while (!seen && index < size)

{

if (list[index] == value)

{

seen = true;

}

pos = index;

}

index++;

}

return pos;

}

3 0
2 years ago
A gas pressure difference is applied to the legs of a U-tube manometer filled with a liquid with specific gravity of 1.7. The ma
MArishka [77]

Answer:

5320.6 Pascal

Explanation:

Manometer is a pressure measuring device use to measure gas pressure .

Pressure difference in Manometer is a function of density,gravity and the height difference of the liquid.

Pressure difference = density x acceleration due to gravity x difference in height of liquid

Density of liquid = specific gravity of object x density of water.

Density of water = 997 kg/m^3

Specific gravity of liquid = 1.7

Density of liquid = 997 x 1.7 =1694.9kg/m^3

g= 9.81 m/s^2

h =320mm = 0.320m

Pressure difference = 1694.9 x 9.81 x 0.320 = 5320.6 Pascal

3 0
2 years ago
Read 2 more answers
An inventor claims to have developed an engine that does not use fuel but operates as a power cycle at steady state while receiv
svp [43]

Answer:

b. False

Explanation:

The project would require energy in order to be able to draw energy from its sorrounding, meaning it will require more energy input compared to other systems. Also, drawing heat energy from the envoirment might not be a reliable energy source. All this also counteract energy conversion law.

4 0
2 years ago
Read 2 more answers
The Hamming encoder/decoder in the lecture detected and corrected one error bit. By adding a thirteen bit which is the exclusive
krek1111 [17]

Cos of error of special characters

The solution has been attached to the portal

7 0
2 years ago
Who play 1v1 lol unblocked games 76
nikklg [1K]

Answer:

I did not what is it about?

8 0
2 years ago
Read 2 more answers
Other questions:
  • Oil with a density of 800 kg/m3 is pumped from a pressure of 0.6 bar to a pressure of 1.4 bar, and the outlet is 3 m above the i
    9·1 answer
  • Consider a plane composite wall that is composed of two materials of thermal conductivities kA 0.1 W/mK and kB 0.04 W/mK and thi
    14·1 answer
  • 3. (20 points) Suppose we wish to search a linked list of length n, where each element contains a key k along with a hash value
    7·1 answer
  • A driver traveling at 65 mi/h rounds a curve on a level grade to see a truck overturned across the roadway at a distance of 350
    13·1 answer
  • Current density is given in cylindrical coordinates as J = −106z1.5az A/m2 in the region 0 ≤ rho ≤ 20 µm; for rho ≥ 20 µm, J = 0
    13·1 answer
  • An aircraft component is fabricated from an aluminum alloy that has a plane-strain fracture toughness of 40 MPa1m (36.4 ksi1in.)
    15·1 answer
  • You are an electrician on the job. The electrical blueprint shows that eight 500-W lamps are to be installed on the same circuit
    11·1 answer
  • Two physical properties that have a major influence on the cracking of workpieces, tools, or dies during thermal cycling are the
    13·1 answer
  • 6.8.1: Function pass by pointer: Transforming coordinates. Define a function CoordTransform() that transforms its first two inpu
    9·1 answer
  • Argon contained in a closed, rigid tank, initially at 33.7°C, 2.1 bar, and a volume of 4.2 m3, is heated to a final pressure of
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!