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

Username:   Password: 
 RegisterRegister   
 "Navigation" table
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
VapeLord




PostPosted: Wed Mar 02, 2016 12:53 pm   Post subject: "Navigation" table

Hello COMPSCI.CA

I am currently working on a project which includes 5 separate programs, ranging from receipt generators to table generation which outputs inputted information.
I want to 'combine' all the separate programs into one single turing file, and have a 'navigation' based command where when ran, the program will ask the user for a value, ranging from 1-5,
and when prompt, turing will run the program corresponding to the value inputted.

ex. "Please select a value from 1-5"
1 -> First Program
2 -> Second Program
3 -> Third Program
and so on and so forth.

I want it set up so that when a certain number is inputted, it will prompt the program to skip x amount of lines so that the program can begin on the line where 1 of the 5 programs will start.
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Wed Mar 02, 2016 3:11 pm   Post subject: Re: "Navigation" table

An if or case statement will allow you to control what happens based on your user's input.

You may also find the include command useful
VapeLord




PostPosted: Wed Mar 02, 2016 8:51 pm   Post subject: Re: "Navigation" table

Dreadnought @ Wed Mar 02, 2016 3:11 pm wrote:
An if or case statement will allow you to control what happens based on your user's input.

You may also find the include command useful


Could you provide an example of how the 'if' or 'case' statement would be used?
I understand that it would have to be "if ___ = ___ then..." but no idea what would follow.
Thanks
Dreadnought




PostPosted: Thu Mar 03, 2016 10:46 pm   Post subject: Re: "Navigation" table

VapeLord wrote:
Could you provide an example of how the 'if' or 'case' statement would be used?
I understand that it would have to be "if ___ = ___ then..." but no idea what would follow.


Here's a nice tutorial on if statments http://compsci.ca/v3/viewtopic.php?t=14656.

In your case, you could say if the user enters 1 then do what program 1 does (...) .
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  [ 4 Posts ]
Jump to:   


Style:  
Search: