Question: Only 20, please do it using Matlab in response to a 17 In a script, the user is supposed to enter either a 'y or
Only 20, please do it using Matlab in response to a 17 In a script, the user is supposed to enter either a 'y or 'n prompt. The user's input is read into a character variable called "letter. T script will print "OK, continuing" if the user enters either a 'y or Y or it print "OK, halting" if the user enters a n or N or Error" if the user enter anything else. Put this statement in the script first he WI etter- input ('Enter your answer: ', 's') Write the script using a single nested if-else statement lelseif clause is permitted. Write the script from the previous exercise using a switch statement instead 18. 19. In aerodynamics, the Mach number is a critical quantity. It is defined as the ratio of the speed of an object le.g, an aircraft) to the speed of sound. If the Mach number is less than 1, the flow is subsonic; if the Mach number is equal to 1, the flow is transonic; and if the Mach number is greater than 1, the flow is supersonic. Write a script that will prompt the user for the speed of an aircraft and the speed of sound at the aircraft's current altitude and will print whether the condition is subsonic, transonic, or supersonic. 20. Write a script that will generate one random integer and will print whether the random integer is an even or an odd number. (Hint: an even number is divisible by 2, whereas an odd number is not; so check the remainder after dividing by 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
