write a python program OR to calculate the thickness and difference between the surface of the ocean to the bottom of the ocean.
please include comments, thank you
v=1507
#v is the speed of sound in water, it is always 1507m/s
t=int(input("Enter the Time taken in seconds "))
# we take the input t in seconds as we must maintain similar SI Units for all variables.
#the input is first converted into integer format so that we can apply the multiplication operation.
d=v*(0.5*t)
print(d," meters is the depth of the ocean, given that it takes time of ",t," seconds")
=========================================================================
Your code on the compiler:
Expected output:
write a python program OR to calculate the thickness and difference between the surface of the...
use Python and please comments every step. [25] 6. Write a program that reads from standard input, two times in military format and prints the number of hours and minutes between the two times. Assume that the second time is always ahead of the first time. You should avoid using conditional statement (if-else) for this program. Your program must query the user for the two times and output the difference based on the two sample runs given below. Please enter...
Please help with this python assignment. Thank you. question 1 Write a Python program to read a file line by line store it into a variable. question 2 Write a Python program to read a file line by line store it into an array. question 3 Write a python program to find the longest words. question 4 Write a Python program to count the number of lines in a text file. question 5 Write a Python program to count the...
Write a Python program that will input two fractions then report their sum, difference, product and quotient.
5. (30 pts) Write a program that calculates the surface area of a cube (see the formula below). The user inputs the cube's side length and your program will then print out the surface area of that cube. Your code must follow the output in the sample run below. Your program must be complete and correct, but you do not need to include comments. Here is the formula to calculate surface area given a cube's side length: surface area 6...
Write the code in PYTHON and please provide the full code, thank you! Write a program that plots two functions: f(x) = x2 and g(x) = ax. Write it in such a way that the intersection points are marked with an X, for arbitrary a. • You may use your favorite ready-made function to find the intersection points, if not: • One possible way to tackle this problem is to put both function values in arrays and check using a...
Use python please! Thank u 5. Write a program to determine (not by counting yourself!) how many odd numbers exist between 56 and 22. (ex. There are odd numbers). Your program should not print any other numbers.
Write a Python program to calculate the volume of a sphere with the radius = 5.
Please write comments with the program. Python programming!! Part III - write student data In this part the program should create a .csv file and fill it with generated student information. The program should: Ask the user for a name for the .csv file (use your own name for the exercise) Create the .csv file with columns named - ID, first-name, GPA Based on the information received in part I, generate and fill students information in the CSV file Tell...
Python Program 5. Write a Python program in a file named validTime.py. Include a function named string parameter of the form hh:mm: ss in which these are numeric validTime that takes a values and returns True or False indicating whether or not the time is valid. The number of hours, minutes, and seconds must two digits and use a between 0 and 9). The number of hours must be between 0 and 23, the number of minutes and seconds must...
The program is in python :) Write a code program to calculate the mortgage payment. The equation for calculating the mortgage payment is: M = P (1+r)n (1+r)n-1 Where: M is your monthly payment P is your principal r is your monthly interest rate, calculated by dividing your annual interest rate by 12. n is your number of payments (the number of months you will be paying the loan) Example: You have a $100,000 mortgage loan with 6 percent annual...