Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!t42g2000hsg.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: help with program PLEASE URGENT
Date: Wed, 22 Oct 2008 08:23:31 -0700 (PDT)
Organization: http://groups.google.com
Lines: 57
Message-ID: <04648252-431b-478c-a5a6-31e2bd7666a8@t42g2000hsg.googlegroups.com>
References: <27477259.1224684461338.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: 192.44.136.113
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1224689011 20660 127.0.0.1 (22 Oct 2008 15:23:31 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 22 Oct 2008 15:23:31 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: t42g2000hsg.googlegroups.com; posting-host=192.44.136.113; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
	CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
	3.5.21022),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
Xref: news.mathworks.com comp.soft-sys.matlab:496743


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