Question

Using MATLAB, prompt the user to enter a vector containing 3 elements that correspond to the...

Using MATLAB, prompt the user to enter a vector containing 3 elements that correspond to the scores a student received in three exams. Compute the average of the scores. If the average is less than 60, send a message to the command window telling the user that the student did not pass the course. Otherwise, send a message to the command window telling the user that the student has passed the course.

Homework Answers

Answer #1
v = input("Enter vector of 3 values: ");
if mean(v) < 60
    disp("You did not pass the course.");
else
    disp("You passed the course.");
end

The above code in matlab takes the input from user in form of vector and calculates the mean of the vector. If the mean is less than 60, then it displays You did not pass the course else it displays You passed the course

OUTPUT 1:

Enter vector of 3 values: [60 80 61]
You passed the course.

OUTPUT 2:

Enter vector of 3 values: [40 60 50]
You did not pass the course.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The following program allows the user to enter the grades of 10 students in a class...
The following program allows the user to enter the grades of 10 students in a class in an array called grade. In a separate loop, you need to test if a grade is passing or failing, and copy the grade to an array to store passing or failing grades accordingly. A passing grade is a grade greater than or equal to 60. You can assume the use will enter a grade in the range of 0 to 100, inclusive. ...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT