Question: Write the code to ask the user to enter a 2 x 1 vector that contains positive values in the command window, and store the

Write the code to ask the user to enter a 2 x 1 vector that contains positive values in the command window, and store the vector they input as the variable Q. Check to make sure that the user did enter a 2 x 1 vector and that both values were positive and if not, warn the user and ask the user to enter it again. Continue to re-ask the user until they correctly enter a vector or three tries have occurred. If the user still has not entered a correctly sized vector with positive values on the third input, terminate the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!