Display a table of distance equivalents in miles and km

Assignment Help Computer Engineering
Reference no: EM132113600

FOR PYTHON:

Write another PYTHON program that generates the same table but by using a function that returns the kilometers for a miles parameter.

Use a loop in main and generate random integers as before, but catch the value returned by the function and use it in the loop to print a line of the table.

Repeat: The table is printed in main. Format your output as described and shown in program5_1(SHOWN BELOW).

Example output

MILES KILOMETERS

22.00 35.40548

33.00 53.10822

19.00 30.57746

25.00 40.23350

29.00 46.67086

54.00 86.90436

10.00 16.09340

48.00 77.24832

18.00 28.96812

35.00 56.32690

Write a program that displays a table of distance equivalents in miles and kilometers. See Example output. You must generate the table by running a function inside a loop in main.

Generate a random integer from 10 to 60, inclusive, in each loop cycle. Use this latter value as the miles argument to the function. The function must then print a line in the table.

Repeat: The function prints the table. Use the formatting concepts at the end of Chapter 2 to print columns with width and decimal control as shown.

Example output

MILES KILOMETERS

52.00 83.68568

11.00 17.70274

40.00 64.37360

21.00 33.79614

14.00 22.53076

23.00 37.01482

48.00 77.24832

22.00 35.40548

15.00 24.14010

16.00 25.74944

Reference no: EM132113600

Questions Cloud

What is the probability that 4 are red and the rest : What is the probability that 4 are red and the rest are silver? 7 are red and 3 are black, and all 8 red are displayed?
What would the null and alternative hypotheses : "What would the Null and Alternative Hypotheses be for the following contention? It is often felt that the order priority of critical would have higher shipping
Research an interval scale of measurement : Is a cross-sectional design (a self-report questionnaire) used in a research an interval scale of measurement.
What is the difference in execution speed : In Python, Using a random number generator, create a list of 500 integers.
Display a table of distance equivalents in miles and km : Write another PYTHON program that generates the same table but by using a function that returns the kilometers for a miles parameter.
What is the standard deviation of portfolio returns : Consider a portfolio of 70% stock X and 30% stock Y. What is the standard deviation of portfolio returns?
Prompt the user for an integer number that indicates : Write a PYTHON IDLE program that will prompt the user for an integer number that indicates the number of days after 9/25/09.
Effects of radiation and chemotherapy on cancer cells : Looking for some help on how to explain the 4 examples below for these three hypothesis.
Find the z-score corresponding to the given area : Find the z-score corresponding to the given area. Remember, z is distributed as the standard normal distribution with mean of and standard deviation

Reviews

Write a Review

Computer Engineering Questions & Answers

  How you could approach stakeholder that might resist project

In your initial post, identify these stakeholders and describe the strategies you would take to get stakeholder buy-in. Also, describe how you could approach stakeholders that might resist the project.

  Why keys usually partitioned first by significant position

In radix sort, why are the keys usually partitioned first by the least significant position, not the most significant?

  Draw the truth table and design an octal to binary encoder

What is the advantage of using multiplexers to implement logic functions?

  Implement a method for finding such a prime

Implement a method for finding such a prime by using the sieve algorithm. In this algorithm, we allocate a 2M cell Boolean array A.

  Why does the source of a cpp template function need

Why does the source of a C++ template function need to be available to be able to compile the client code? Is this necessary for an Ada generic function?

  Describe the impact of merging the domains into a single

question 1 how would you define an item on the internet with respect to a search statement and similarity

  Write a program that takes as input a fully parenthesized

Write a program that takes as input a fully parenthesized, arithmetic expression and converts it to a binary expression tree.

  Create new movie that has rectangles moving a random amount

Create a new movie that has two rectangles moving a random amount (from -5 to 5) in each direction in each frame.

  How many parameters does each method have

How many parameters does each method have? Which of the preceding methods will have a return statement as part of its body?

  Discuss why you think the network is effective and efficient

Examine its network design and explain why you think the network is effective and efficient

  How did you find out the dotted quad address that is what

the current ip address standard is 32 bits. ipv6 will increase the address length to 128 bits. an ip socket address is

  By using different internet sources find out an article or

using various internet sources find an article or website about attack prevention. show your personal content mastery

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd