943,806 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1597
  • C RSS
Mar 22nd, 2005
0

desperate! having serious issuses

Expand Post »
how the hell do you do this?!
please help asap!
a. This problem is similar to the problem in your last assignment. However, this time you will need to keep track of all integers input by the user.
b. Create a program that will read a series of ten (10) positive integers (entered one at a time) from the user. Once all integers have been entered, display the following statistics on the data:
i. the sum of all integers
ii. the average of the integers
iii. the smallest integer
iv. the largest integer
v. a list of the integers in reverse order from the order in which they were entered
c. For an additional challenge, add the following functionality:
i. If the user types in a negative integer, continue to prompt them until they enter a positive integer. When they do enter a positive integer, it will count as one of the 10 integers requested.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ibmackin is offline Offline
1 posts
since Mar 2005
Mar 22nd, 2005
0

Re: desperate! having serious issuses

>how the hell do you do this?!
Start by learning from the previous assignment, as this assignment suggests. We don't do homework for you, show an attempt or you'll encounter nothing but stoney silence.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Mar 23rd, 2005
0

Re: desperate! having serious issuses

Hi,

If you are completely lost with it, try some psuedo code to help you out.

Function to read in 10 numbers
--> Don't forget error checking

Function to add them up

Function to average them

Function to find smallest

Function to find largest

Function to list in reverse

Main program to manage the calling of the functions.

Now, you are going to need to fill in the functions with what needs to happen. How do you find the largest? How do you list them in reverse?

You are going to need to choose some storage data types... Perhaps an Array, perhaps a double-linked list. You are going to need some variables.

And it is your assignment, so please get some ideas on paper, and come back if you have some syntactical questions, such as the difference between an assignment, and an equal comparison.

Christian
Team Colleague
Reputation Points: 121
Solved Threads: 57
Posting Virtuoso
kc0arf is offline Offline
1,629 posts
since Mar 2004
Mar 23rd, 2005
0

Re: desperate! having serious issuses

try putting the 10 ints into an array ? Then getting the array populated from the user? Then performing the maths after ???
Reputation Points: 12
Solved Threads: 5
Posting Pro
Acidburn is offline Offline
510 posts
since Dec 2004
Mar 23rd, 2005
0

Re: desperate! having serious issuses

ibmackin have you tried any code at all, if so post it. The forum rules say we dont do homework for you, but we will have a go at fixing mistakes in homework you HAVE ALREADY DONE! |
Reputation Points: 16
Solved Threads: 6
Posting Pro in Training
1o0oBhP is offline Offline
445 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Input for a solution to matrix problem
Next Thread in C Forum Timeline: matrices





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC