Writing only algorithms for 4 cases for python programming Write a program that
ID: 3828931 • Letter: W
Question
Writing only algorithms for 4 cases for python programming
Write a program that reads a column of numbers from a file and fills in an array with these numbers until you reach to the end of file. Multiply large numbers Multiply two 30-digit numbers not using math functions and/or libraries. Simulate the trajectory of a fuel-consuming rocket. i. Take a rocket leaving the surface of Earth with an variable acceleration (include mass consumption) Take Earth's gravity variable too. Continuously (i.e., real clock time) calculate the rocket's velocity and stop when it reaches escape speed Using angular speeds of Sun and Moon, simulate the total solar eclipse event with respect to an observer on Earth. You need to make the following assumptions: It is the eclipse time When the Full Moon crosses the Sun will be covered. It will be a total solar eclipse (learn what it is). Fix the total eclipse time. Assume that the mid-eclipse (learn what it is will occur on observer's meridian (i.e. mid-day at 12:00 00:00 is midnight). When calculating eclipse status, take Sun and Moon as point sources. Obtain angular speeds of Sun and Moon on the sky. Take an arbitrary initial date/time mark. Your calculations should also continue some time after the eclipse. Your code should give: count-down to eclipse count the eclipse duration give status as 'coming to eclipse 'on eclipse', at mid-eclipse', 'coming out of eclipse" etcExplanation / Answer
Answered oly one question
C11 : Algorithm
1. Have a dictionary of arrays and each key as Column of the file
2.iterate for each line in the file
3. split the line for splitter " " in each line and get the element for each column
4. iterate for each element
5. for each elemnt as key ( column index of the file) insert a new list if not present else insert the value of the column for that line
6. At the end we will have a dictionary with keys as columns and each columns value as list.
7.In order to print for each column in the file we will use print(dict[0])
The functions are below:
1. Read file for each line
3. for each column element check if the list present and append the column list with the value
def putelem(elem,index):
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.