|
On Oct 22, 10:07=A0am, fada <djw...@live.com> wrote:
> I DON'T KNOW MUCH ABOUT MATLAB
> how do i write a program that performs a survey tally on beverages. the p=
rogram should prompt the user for the next person until a sentinel value of=
-1 is entered to terminate the program. each person participating in the s=
urvey should choose their favorite beverage from the following list:
> 1. coffee 2. tea 3. coke 4. orange juice
>
> sample run
>
> please input the favorite beverage of person #1: choose 1, 2, 3 or 4 from=
above menu or -1 to exit the program
> 4
>
> please input the favorite beverage of person #1: choose 1, 2, 3 or 4 from=
above menu or -1 to exit the program
> 1
>
> please input the favorite beverage of person #1: choose 1, 2, 3 or 4 from=
above menu or -1 to exit the program
> 3
>
> please input the favorite beverage of person #1: choose 1, 2, 3 or 4 from=
above menu or -1 to exit the program
> 1
>
> please input the favorite beverage of person #1: choose 1, 2, 3 or 4 from=
above menu or -1 to exit the program
> 1
>
> please input the favorite beverage of person #1: choose 1, 2, 3 or 4 from=
above menu or -1 to exit the program
> -1
>
> the total number of people surveyed is 5. The results are as follows:
>
> Beverage Number of votes
> ***********************************************
> coffee 3
> tea 0
> coke 1
> orange juice 1
>
> how is it that i write this program please may i get some help
> NEED SUM 1 TO SHOW ME HOW ITS WRITTEN PLEASE!!!
------------------------------------------------------------------
fada:
Type this on the MATLAB command line:
>> doc questdlg
Get their input string, convert it to a number, and use that number as
the index to a 1 by 4 array that contains the number of responses for
the various beverages.
Next time choose a better subject line and get an earlier start on
your homework so that it is not so urgent.
Good luck,
ImageAnalyst
|