Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Prompt the user to enter a large total number of days (e.g., 694444). Assuming 3

ID: 3835678 • Letter: P

Question

Prompt the user to enter a large total number of days (e.g., 694444). Assuming 365 days in a year, re-compute the value to display the number of years and leftover days. Display both numbers as whole numbers. The minimum runway length for an airplane can be computed if the airplane's speed, v, and acceleration, a, are known: length = v^2/a where length is in meters, v is in meters/second, and a is in meters/seconds^2 Prompt for acceleration, a, in m/s^2. Then, prompt for the speed v in miles per hour (mph) and convert to m/s. Output the minimum length of the runway to 2 decimal places. Recall that 1 mile = 1609 meters, and 1 hour = 3600 seconds. Enter the speed of the aircraft in mph: 134.25 Enter the acceleration of the aircraft in meters-per-seconds-squared: 3.5 The minimum length of the runway is 1028.7.33 meters

Explanation / Answer

2)

prompt = 'Enter a large total number of days:';           %asking the user to iput the large numeber of days%
x = input(prompt);                                       %taking input using function input%
y=floor(x/365);                                           %taking only integer part%
z=mod(x,365);                                           %taking only Remainder part%
fprintf('%d days is %d years and %d days. ',x,y,z);   %Printing the result%

Output:-
---------
Enter a large total number of days: 694444
69444 days is 1902 years and 214 days.


3)
prompt='Enter the speed of aircraft in mph:';                              
v=input(prompt);
prompt='Enter the acceleration of aircraft in meters-per-seconds-squared:';
a=input(prompt);
v=convvel(v,'mph','m/s');                                       %convvel function is used to convert the speed v from mph to m/s format%
l=(v^2)/a;
fprintf('The minimum length of runway is %0.2f meters',l) % '%0.2f' is used to print the output to 2 decimal places.%.

Output:-
Enter the speed of aircraft in mph: 134.25
Enter the acceleration of aircraft in meters-per-seconds-squared: 3.5
The minimum length of runway is 10287.33 meters