1) Write a MATLAB script to prompt a user to input two numbers, then assess whether the two numbers are equal or not. If the two numbers are equal, display that they are equal in the Command Window. If they are not equal, display that they are not equal in the Command Window.
2) Write a MATLAB script that prompts the user to enter the day of the week using the input function. If the information the user enters is equal to “Saturday” or “Sunday”, display “have a nice weekend” in the Command Window. Otherwise, display “Good luck in your class lectures and your studies.”
1)
x=input('Enter first number')
y=input('Enter second number')
if x==y
disp('The two numbers are equal')
else
disp('The two numbers are not equal')
end
2)
day=input('Enter the day of the week','s')
if strcmpi(day,"Saturday")==1||strcmpi(day,"Sunday")==1
disp('have a nice weekend')
else
disp('Good luck in your class lectures and your studies.')
end
1) Write a MATLAB script to prompt a user to input two numbers, then assess whether...
Write a Python script in that will prompt the user to enter a string. After the user enters their string print its length and the ordinal value of the first, third, and seventh character. Assume the input will be of sufficient length. Use "nice" input and output
MATLAB QUESTION 8) Create a program that first prompts the user to enter any two numbers. Then prompt the user again to input as many numbers as they choose. Stop the program by inputting-1. Then, display the largest number and second largest number in the command window once the user kills the program. The built-in max function cannot be used. The figure below is an example of what the command window should look like when the code is ran. First...
In Matlab, write a script which asks a user to input numbers until the user inputs 0. Then the script should print only the positive numbers entered by the user, in reverse order. For example, if the user inputs “4,-1,5,2,-3,-8,0” the script should print “2,5,4”.
MATLAB script 1) Prompt the user for their first name 2) Prompt the user for their last name 3) Prompt the user for their age Display a sentence that greets the user using their first and last name, and congratulates them for what will be their age on their next birthday. Example: Hello John Smith. Congratulations on turning 45 on your next birthday!
IN MATLAB Write a script that will prompt the user for strings and read them in, store them in a cell array (in a loop), and then print them out.
Write a script in matlab that prompts the user to input the day, month, and year; determine the day of the year (the number of days including the current day). Be sure to take leap year into account. Use a for loop Test your code on the following dates: February 28, 2015 April 9, 1976 October 12, 1887 Create a script that performs the same function as repmat. The only built-in commands you may use are input, size, and disp.
on a mac!!!!!! Write a script named copyfile.py. This script should prompt the user for the names of two text files. The contents of the first file should be input and written to the second file.
Write a MATLAB script that works like following Program User replies (for instance) Hi Hi What’s your name? John Smith What year were you born? 1995 Does that mean you are 20? Yes What’s your favorite team? Blues Good luck to your Blues. Buy. Buy. Have a nice day.
Write a C++ program that prompts the user to enter two numbers. Then prompt the user to select from the following options: a. Add the numbers. b. Multiply the numbers. c. Terminate the program Use the appropriate control structures (loops, if else, switch-case, etc) to make your program as short and efficient as possible. Minor syntax errors are forgiven in this exercise; just focus on the correct structure, declarations and sequence of instructions
PYTHON 3.6.1 write a script named copyfile.py. this script should prompt the user for the names of two text files. the contents of the first file should be input and written to the second file.