Hi! I need help writing out the pseudocode and codes for these programs. All instructions are included and the programs are in python! Any help is appreciated. Thanks!   program5_1.py Write a program that displays a table of ten 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.  Print  the miles in a column 5 characters wide with 2 decimals and the kilometers in a column 13 characters wide with 5 decimals. Use the column formatting concepts at the end of Chapter 2, not tabs or other methods not in this course. 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   program5_2.py Write another program that generates another table with the same columns and decimals but by using a function that returns the kilometers for a specified 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.    program5_3.py Write a program about triangles. You need two files, a module file and an executable file with a main method. The module file (defines two functions): One function that takes the three sides of a triangle as arguments. It returns True if the sides define a right triangle and False if it doesn't. HINT: This is easiest with a Math module function. The other function must use Heron's Formula to calculate and return the area of a triangle. Learn about Heron's formula online. The main file: Prompt the user to enter the three sides (longest first) of the triangle. Use integers only. Make sure that no side is longer than the sum of the other two sides. Call the function that returns a boolean and use it to output whether the triangle is a right triangle, or not. Call the function that returns the area. Display the value returned with two decimal places.   Two Example outputs Enter longest side of the triangle 14 Enter any another side of the triangle 11 Enter third side of the triangle 10 Not a right triangle Area is 54.64 >>>  Enter longest side of the triangle 10 Enter any another side of the triangle 8 Enter third side of the triangle 6 Triangle is a right triangle Area is 24.00

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 7PP: (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point...
icon
Related questions
Question

Hi! I need help writing out the pseudocode and codes for these programs. All instructions are included and the programs are in python! Any help is appreciated. Thanks!

 

program5_1.py
Write a program that displays a table of ten 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.  Print  the miles in a column 5 characters wide with 2 decimals and the kilometers in a column 13 characters wide with 5 decimals. Use the column formatting concepts at the end of Chapter 2, not tabs or other methods not in this course.

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

 

program5_2.py
Write another program that generates another table with the same columns and decimals but by using a function that returns the kilometers for a specified 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

 

program5_3.py
Write a program about triangles. You need two files, a module file and an executable file with a main method.
The module file (defines two functions):

  • One function that takes the three sides of a triangle as arguments. It returns True if the sides define a right triangle and False if it doesn't. HINT: This is easiest with a Math module function.
  • The other function must use Heron's Formula to calculate and return the area of a triangle. Learn about Heron's formula online.
The main file:
Prompt the user to enter the three sides (longest first) of the triangle. Use integers only. Make sure that no side is longer than the sum of the other two sides. Call the function that returns a boolean and use it to output whether the triangle is a right triangle, or not. Call the function that returns the area. Display the value returned with two decimal places.
 
Two Example outputs
Enter longest side of the triangle 14
Enter any another side of the triangle 11
Enter third side of the triangle 10
Not a right triangle
Area is 54.64
>>> 
Enter longest side of the triangle 10
Enter any another side of the triangle 8
Enter third side of the triangle 6
Triangle is a right triangle
Area is 24.00

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr