Ask Question
12 February, 13:48

Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's numbers on one line, each number followed by one space. (2 pts)

Ex:Enter weight 1:236.0Enter weight 2:89.5Enter weight 3:142.0Enter weight 4:166.3Enter weight 5:93.0You entered: 236.000000 89.500000 142.000000 166.300000 93.000000

+2
Answers (1)
  1. 12 February, 14:11
    0
    See below in the explanation section the Matlab script to solve the problem.

    Explanation:

    prompt='enter the first weight w1: ';

    w1=input (prompt);

    wd1=double (w1);

    prompt='enter the second weight w2: ';

    w2=input (prompt);

    wd2=double (w2);

    prompt='enter the third weight w3: ';

    w3=input (prompt);

    wd3=double (w3);

    prompt='enter the fourth weight w4: ';

    w4=input (prompt);

    wd4=double (w4);

    prompt='enter the first weight w5: ';

    w5=input (prompt);

    wd5=double (w5);

    x=[wd1 wd2 wd3 wd4 wd5]

    format short
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's numbers on ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers