Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,232 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,806 people online right now. Registration is fast and FREE... Join Now!




need help

 
Reply to this topicStart new topic

need help, prgram c

silvert122
19 Mar, 2007 - 03:49 PM
Post #1

New D.I.C Head
*

Joined: 19 Mar, 2007
Posts: 17


My Contributions
im trying to write this code but i can t .


Write a C program (name it while.c) that prompts the user to enter a series of values (where each value is typed and then the Enter key is pressed) stopping only when the user enters the value of zero ( 0 ) followed by the Enter key. Your program should NOT ask the user if they have more values to enter. It should simply continue to accept values until the 0 is entered.
Instruct the user to enter float values.
Remember: The user determines the number of values to enter, not you.
Your program should calculate the sum and average of the numbers entered and print out the following:
number of values entered
sum of the values entered
average of the values entered
Note: For those of you who are "go getters" ... you cannot use arrays for this assignment.


can someone help me please.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Need Help
19 Mar, 2007 - 04:01 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,984



Thanked: 44 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Please post the code you have completed in your attempt to fulfill your assignment. We will be happy to help, but you must post your code.
User is offlineProfile CardPM
+Quote Post

ajwsurfer
RE: Need Help
20 Mar, 2007 - 11:14 AM
Post #3

D.I.C Regular
Group Icon

Joined: 24 Oct, 2006
Posts: 292



Thanked: 2 times
Dream Kudos: 50
My Contributions
What sort of data structure will you use to store the values? This will determine, for the most part, how you will go about this.

If you can use vectors, that would probably the easiest.

If you have to build your own data structure, use a stack. It is very easy to do.


User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 03:30PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month