| | |
array program, dont know where to even begin!
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2004
Posts: 5
Reputation:
Solved Threads: 0
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
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
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?
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?
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"...
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"...
![]() |
Similar Threads
- 2d Arrays e FUSSY - Store data in 1d area (C++)
- Array program (C++)
- my program dont run good...array of structures in c...i used dev-c++ (C)
- Is This an Array Program??? (C++)
Other Threads in the C Forum
- Previous Thread: How to broadcast and recieve a messaage in a Cluster?
- Next Thread: Problem with Socket program..
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures student suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h






