array program, dont know where to even begin!

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2004
Posts: 5
Reputation: curly3top is an unknown quantity at this point 
Solved Threads: 0
curly3top curly3top is offline Offline
Newbie Poster

array program, dont know where to even begin!

 
0
  #1
Dec 8th, 2004
Write a program that reads in an array of type int. Provide facility to either read
this array from the key board or from a file, at the user's option. If the user chooses
file input, the program should request a file name. You may assume that there are fewer than
50 entries in the array. Your program determines how many entries there are. The output is
to be a two-column list. The first column is a list of the distinct array elements; the
second column is the count of the number of occurrences of each element. The list should be
sorted on entries in the first column, largest to smallest.

For the array

-12 3 -12 4 1 1 -12 1 -1 1 2 3 4 2 3 -12

the output should be

N Count

4 2

3 3

2 2

1 4

-1 1

-12 4
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,456
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 251
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: array program, dont know where to even begin!

 
0
  #2
Dec 8th, 2004
dont know where to even begin!
Well, then you'll have to help us out there too.

>Write a program that reads in an array of type int.

Do you know what an array is?
Do you know how to create an array of int?

>Provide facility to either read this array from the key board or from a file, at the user's option.

Do you know how to read integers from the keyboard?
Do you know how to read integers from a file?
Do you know how to query the user?

>If the user chooses file input, the program should request a file name.

Do you know how to read a string from the keyboard?

>You may assume that there are fewer than 50 entries in the array.

Do you know how to use this hint?

>Your program determines how many entries there are.

Do you know how to use this hint?

>The output is to be a two-column list.
>The first column is a list of the distinct array elements;

Do you know what this means?

>the second column is the count of the number of occurrences of each element.

Do you know what this means?

>The list should be sorted on entries in the first column, largest to smallest.

Do you know how to sort?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: array program, dont know where to even begin!

 
0
  #3
Dec 8th, 2004
sounds to me like you have instructions there which detail every single thing your application needs to do and the exact order it needs to do them in.

If that's not enough to create a small program I wonder how you're ever going to write something large based on requirements no more precise than "make a program that does XXX"...
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 4
Reputation: syarolazuan is an unknown quantity at this point 
Solved Threads: 0
syarolazuan syarolazuan is offline Offline
Newbie Poster

Re: array program, dont know where to even begin!

 
0
  #4
Apr 10th, 2009
can someone give me this programming code?
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 1,669
Reputation: jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of 
Solved Threads: 123
jephthah's Avatar
jephthah jephthah is offline Offline
Posting Virtuoso

Re: array program, dont know where to even begin!

 
0
  #5
Apr 10th, 2009
Originally Posted by syarolazuan View Post
can someone give me this programming code?
no.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 6
Reputation: smeezekitty is an unknown quantity at this point 
Solved Threads: 0
smeezekitty smeezekitty is offline Offline
Newbie Poster

Re: array program, dont know where to even begin!

 
0
  #6
Apr 10th, 2009
its not as hard as you think
just give it a shot
as long as you know how to use scanf fscanf fopen printf your
are good
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC