| | |
array program, dont know where to even begin!
![]() |
•
•
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..
Views: 8185 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C
api array arrays binary binarysearch c++ c/c++ char character cheating code coke command console conversion convert copy database decimal directory download dude duplication dynamic ebook error exec factorial fgets file fork function functions getlasterror givemetehcodez grade graphics hardware homework i/o input insert int integer lazy line linked linkedlist linux list lists loop malloc matrix memory multi mysql no-effort numbers output path pointer pointers problem process program programing programming programs read recursion recursive recv recvblocked reverse scanf sdl shape single socketprograming socketprogramming sockets sorting spoonfeeding stdin string strings strtok structures student system systemcall turbo-c txt unix user variable visualstudio voidmain() windows






