Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Array program is destroying my head...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JLChow




PostPosted: Thu Dec 17, 2015 12:42 am   Post subject: Array program is destroying my head...

What is it you are trying to achieve?
Write a program that performs various transformations on the values within an array of
integers. The maximum size of the array is 20. Allow the user to enter the start and
ending of the array. Your program should be menu-driven so that a user can select a
transformation to apply to the array similar to the one below. In addition, you are to
design one new transformation and add them to the existing menu and provide a
description of its functionality in your internal documentation.

Please select an option:

0 – exit

1 – initialize

2 – square

3 – halve

4 – accumulate

5 – transpose

6 – shift

7 – reverse

8 – under construction

Suppose the array starts at 1 and ends at 20 then:

Input: 1

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Input: 2

Output: 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400

Input: 1

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Input: 3

Output: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10

Input: 4

Output: 0 1 3 5 8 11 15 19 24 29 35 41 48 55 63 71 80 89 99 109

Input: 1

Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Input: 5

Output: 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19

Input: 6

Output: 19 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20

Input: 7

Output: 20 17 18 15 16 13 14 11 12 9 10 7 8 5 6 3 4 1 2 19


What is the problem you are having?
Problem I'm having, I don't completely understand how to use arrays in this scenario, or anything in that sense.


Describe what you have tried to solve this problem
Did a bunch of googling on arrays and trying to put something together but it doesn't work...even tried just making a version that doesn't require arrays...

Anyone who is willing to help, if you would kindly message me your Skype/Facebook/any other chat based service! So I can finish this thing once and for all!


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Don't have any as I deleted them after realizing what a failure I am. All of them were far from working anyways.

Turing:


N/A



Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
TokenHerbz




PostPosted: Thu Dec 17, 2015 5:06 am   Post subject: RE:Array program is destroying my head...

First off, no ones a failure, it is just a chance to learn some more. If you don't like learning, app dev might not be up your ally.

Here is a really good array tutorial to get you started.

If you have a more Specific question, I could assist, but as for how to go about using/manipulating arrays i think this link is a good stepping stone.

http://compsci.ca/v3/viewtopic.php?t=14333

GL
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: