Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » Basic While Loop Coding Help
Basic While Loop Coding Help [message #1130394] Wed, 09 October 2013 10:07 Go to next message
Justin Appave is currently offline Justin Appave
Messages: 1
Registered: October 2013
Junior Member
Hi, I'm just starting to learn basic coding in my Comp Sci class today and there are some basic coding questions that I'm answering but I'm kinda stuck on this one. I think I've gotten the basic skeleton down but not sure where to go next from there.

Here's the question.

Write a program that uses a while loop. In each iteration of the loop, prompt the user to enter a number positive or zero. Keep a running total of the numbers the user enters and also keep a count of the number of entries the user makes. The program should stop whenever the user enters "-1" to quit. When the user has finished, print the grand total and the number of entries the user typed.


Any help would be appreciated. Thank you!
Re: Basic While Loop Coding Help [message #1130469 is a reply to message #1130394] Wed, 09 October 2013 11:43 Go to previous message
Heiner Westphal is currently offline Heiner Westphal
Messages: 18
Registered: July 2009
Junior Member
Hello Justin,

this group is about the eclipse Test & Performance Tools Platform Project.

BTW. the best way to learn programming (or anything else for that
matter) is to try hard before searching the web. Otherwise you might
just learn how to look up answers...

Just my humble opinion which is still utterly unrelated to eclipse TPTP ;)

Regards and good luck,

Heiner

Am 09.10.2013 16:21, schrieb Justin Appave:
> Hi, I'm just starting to learn basic coding in my Comp Sci class today
> and there are some basic coding questions that I'm answering but I'm
> kinda stuck on this one. I think I've gotten the basic skeleton down but
> not sure where to go next from there.
>
> Here's the question.
>
> Write a program that uses a while loop. In each iteration of the loop,
> prompt the user to enter a number positive or zero. Keep a running
> total of the numbers the user enters and also keep a count of the number
> of entries the user makes. The program should stop whenever the user
> enters "-1" to quit. When the user has finished, print the grand total
> and the number of entries the user typed.
>
>
> Any help would be appreciated. Thank you!
Previous Topic:Memory analizer for secondary thread
Next Topic:Profiling and Logging
Goto Forum:
  


Current Time: Thu Jul 24 19:04:41 EDT 2014

Powered by FUDForum. Page generated in 0.01383 seconds