help for a turing program!!
Author |
Message |
nat.bebz
|
Posted: Tue May 17, 2011 5:16 pm Post subject: help for a turing program!! |
|
|
This is the question for the program. But I dont know how to do it. Anyone help? Thank you!
2. [Table.t] (Moderate) Write a program which allows the user to create, store, and retrieve values in an array. The program will first ask the user for the length of the array (make sure you check if the length is an integer). Then, you will display a menu for the user to make modifications to the array. The commands are ?set?, ?get?, ?count?, and ?replace?:
Menu
1. Set value
2.Get value
3.Count frequency of value
4.Replace value
Case 1: Set value. Ask the user for a value (any value), and an index (make sure it is an integer) to store that value into. Reprint the array using braces and commas, for example: {1, 2, 3, 4}
Case 2: Get value. Ask the user for an index (make sure it is an integer), and output the value in the array at that index.
Case 3: Count frequency of value. Ask the user for a value, and output how many times that value appears in the array.
Case 4: Replace value. Ask the user for a value to replace, and a value to replace it. Your program will replace any and all instances in the array with the new value. Reprint the array using braces and commas, for example: {1, 2, 3, 4} |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue May 17, 2011 5:17 pm Post subject: RE:help for a turing program!! |
|
|
Please make this post in the Turing Help forum, and fill out the template. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|
|