Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Question For Class...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Flikerator




PostPosted: Fri Oct 14, 2005 9:56 pm   Post subject: Question For Class...

We got a booklet of questions today and I finished them all in like 20 mins... There was a question that wanted to enter an unknown length of numbers from the user not a file. It then wanted the sum, average, highest, and lowest numbers.

I used a flexible array, it was very easy that way. How would you go about doing that? Help me get in your mind XD
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Fri Oct 14, 2005 10:36 pm   Post subject: (No subject)

What? Please rephrase that, because to me it made absolutely no sense Confused

You said you did it, and then you are asking how to do it??
Cervantes




PostPosted: Sat Oct 15, 2005 7:20 am   Post subject: Re: Question For Class...

Flikerator wrote:
We got a booklet of questions today and I finished them all in like 20 mins... There was a question that wanted to enter an unknown length of numbers from the user not a file. It then wanted the sum, average, highest, and lowest numbers.

I used a flexible array, it was very easy that way. How would you go about doing that? Help me get in your mind XD


Perhaps he's asking how to do it without using flexible arrays?

In that case, keep a running tally of the sum and the number of numbers inputted so far. Also have a variable called lowest and another called highest that begin at maxint and minint, respectively. If the number inputted is > lowest, make lowest equal to that number. Similarly for highest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: