Source code:
fprintf('Welocme!!!\n');
fprintf('Choose option!\n');
fprintf('1.Compute
Grade\n');
%printing info
fprintf('2.Generate a number.\n');
fprintf('Enter -1 to
stop.\n');
% enter -1 to stop execution
var=input('Enter option number:');
while(var ~=
-1)
%to run program repeatedly
if var ==
1
%case 1
grade_1=input('Enter
grade 1:');
grade_2=input('Enter
grade 2:');
if grade_1>=50
&& grade_1<=100
%condition checking
if grade_2>=50 && grade_2<=100
%condition checking
avg=(grade_1+grade_2)/2;
if avg >= 75
fprintf('Averae grade:%d\n',avg);
fprintf('You PASS.\n');
else
fprintf('Averae grade:%d\n',avg);
fprintf('You FAIL.\n');
end
else
fprintf('Invalid grade
2.\n');
%printing info
end
else
fprintf('Invalid grade
1.\n'); %printing
info
end
var=input('Enter option
number:');
elseif var ==
2
%case 2
num=input('Enter a
number:');
%input from user
n=0;
i=0;
fprintf('The first %d
even numbers are:\n',num);
while(i < num)
fprintf('%d
',n);
%printing even numbers.
n=n+2;
i=i+1;
end
fprintf('\n');
var=input('Enter option
number:');
else
fprintf('Enter correct
choice.\n');
end
end
Sample output:
Need help with this problem. Need to write a MATLAB program with the following options/conditions attached...
Write a program in Python that will: Here are following requirements to completing Menu shapes: 1. Create a "MENU" with 4 - 5 options have the user click the option and thereafter ask the user to enter the amount of stars from 1 - 50. From there your "for loop" will create the shape. Menu options need to be: 1. Filled Triangle 2. filled Square 3. This can be any shape such as a Square, circle, a different angle of...
Need help with following C++ program: 3) Write a program in C++ with a menu. When the program executes it gives the user a list of choice to choose from. The user can input 1,2 or 3 only. For all other input, the message “Invalid Options” will be displayed. ****MENU**** 1) Convert length from feet to inches. 2) Convert length from meter to centimeters. 3) To quit the program
MATLAB EXPERT PLS HELP!!! SHORT AND SIMPLE QUESTIONS! Just write the code to do the following operations step by step please. You dont need background info on the question Prompt the user to enter x and if x is less than 2 or not an integer, use a while loop to display “Invalid!” and prompt the user to re-enter valid entries. Prompt the user to enter y as a vector of x elements. If the user did not enter in...
I need help to find out the MATLAB code to solve this equation.
Thanks
By using MATLAB program, Find the Gradient of Vi = 24Vocos(Ty/3) sin (2T1/3)
By using MATLAB program, Find the Gradient of Vi = 24Vocos(Ty/3) sin (2T1/3)
I need this MATLAB question answered ASAP!!! thanks in
advance!
10 Write a program which prompts the user for data and returns the mean. The code should execute the following steps: 1) Prompts the user to enter the number of observations 2) Use a FOR-LOOP to get data from user. At each iteration, the user is asked for value of the i-th observation 3) At each iteration, print the mean of the sample up to and including the i-th observation...
Write a program that stores the following data in a tuple: 54,76,32,14,29,12,64,97,50,86,43,12 The program needs to display a menu to the user, with the following 4 options: 1 – Display minimum 2 – Display maximum 3 – Display total 4 – Display average 5 – Quit Make your program loop back to this menu until the user chooses option 5. Write code for all 4 other menu choices using the python code and screenshot the python code for me. many...
yes you will need matlab software
Can someone please help me. attached is the exercise i am doing
in matlab. also attached is the exercise that i am suppose to be
doing.also attached is part a of my code and part b. also attached
is an error code i am getting. can someone please help me with
this. thanks. explain in detail what i am doing wrong and what i
need to do to fix it.
you use enogn polnts...
I need help with this. Thanks. Write a program in assemble to calculate the area of a trapezoid of the following parameters. - shorter side a=3, - longer side b=7, - height h=4. result= (a+b)/2 x h the whole code is not required. Just show how you would declare all variables that you would need to calculate the area of trapezoid (a, b, h).
MATLAB Practice Problem: Write a program which calculate the total profit/year by the end of each month in a year, given the variable P which stores profit/month for that year: P = [4 4 5 6 7 6 7 5 7 8 8 6]x1000 a) Set a loop up to calculate Ptotal(ii)=Ptotal(i-1)+P(i), to help decide about start/end conditions, use an iteration table. b) Set up a loop to calculate Ptotal(i+1)=Ptotal(i)+P(i+1).
Please use MATLAB
Vs 2. Identify the initial conditions. Write an m-file that does the following: 3. If Vs-12V, R-280Ω, L-10mH, C-0.9μF, use matlab solve the roots of characteristic equation, find the expression of vdt), choose proper time range to plot ve What type of damping is it? 4. What is the difference in response with both open and closed loop systems. Explain the differences
Vs
2. Identify the initial conditions. Write an m-file that does the following: 3. If...