Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mdjenkins86

Pages: 1 ... 9 10 [11] 12 13 ... 16
151
TI 68K / 89 Basic Tutorial
« on: June 17, 2005, 07:37:00 pm »
Chapter 2:  A closer look at input functions.

Online dating services are designed to match up the perfect guy with the perfect girl, or guy or whatever?anyway, when you go to such websites and fill out or input your information, you are asked certain question.  To these questions, there is only a certain amount of possible answers (for example: are you a girl, guy, cheese steak, meatball sandwich?are you seeking a girl, guy, cheese steak or meatball sandwich?).  If the dating program is any good, it will make sense of your desires and try to obtain more specific input.  Input is, according to answers.com something put into a system or expended in its operation to achieve output or a result. In the case of the dating service, the output would be your date, or sandwich.

In 89 Basic, there are several different ways to acquire input from the user.  The functions that will be explored in this chapter are Input and InputStr.  The Dialog Box input functions will be included throughout the variable chapters.

Enter the program editor and press 3 to create a new program. Name this program ?Inputut?.  Enter the program below as shown:

Inputut()
Prgm
Disp ?How good is this tutorial?, ?On a scale of 0 to 10?
Input ?Number?, x
DispHome()
Return
EndPrgm

Type in ?x? on the home screen without the quotes and you will how good you think this tutorial is.  Now type GetType(x).  This will return the type of variable x is.  Don?t worry so much about that right now. Just remember that whatever reply you supply for input is stored as a numerical expression. That means that only numbers, and words that are numbers, can be accepted using input.  If you wanted to get a response that wasn?t a number, such as a name or birthplace, you would use InputStr instead of Input:

Inputnm()
Prgm
Disp ?My name is Desmond Jenkins?, ?What is yours?
Inputstr ?My Name?, x
DispHome()
Return
EndPrgm

When you perform, GetType(x) you will notice that x is type ?STR?.  This means that the users input has been turned into a string.  A string is an array of characters.  In other words, a string is something in quotes.  A literal.

Focus: Expressions

In math x can be equal to a number.  Say 5.  X=5.  This means that x is an expression that is equal to 5.  Now y can be set to x.  This means that y=x=5.

In programming this is also true.  In the first example when you used Input ?Number?, x, the number that the user inputs is an expression (numerical value) from 1 to 10.  X is set to that input.  Therefore, x is equal whatever the person enters, say 5.  Variable X is now an expression, which is equal to 5.

Focus: Strings

In English, when you quotes someone, you use ?? quotation marks.  When you use quotation marks to quotes someone, you are repeating word for word what that person said.  You do this even when you quote yourself.

 Desmond said, ?Programming is fun?, but nobody believed him.  

?Programming is fun?, is an example of a literal because it is something that I literally said.  

When the processor looks at your code, it will inherently try to quantify everything try typing Disp Programming is fun see what kind of error you get.  You see without the quotes, the calculator thinks that Programming is a variable name and then discovers that it couldn?t be because the file name is too long.  Try typing Disp ?Programming is fun?.  This works because the calculator understands that Programming is fun is what you literally want to display, not some expression stored in a variable.

Chapter Review:
What is the difference between Input and InputStr?
What is a string?
What is an expression?

Definitions
Concept of Expression ?EXPR?   A mathematical variable or number.  On the 89 the ?Type? of variable that a number is or a variable that contains a number.

Concept of Strings ?STR?   A quote.  A literal. This is how you tell the calculator to display exactly what you want, without trying to quantify it.  Remember to use quotation.

GetType   Evaluates what type of system type a given variable is.  Try GetType(hellowd) GetType(45)

Input   Used to scan expressions from the user

InputStr   Used to scan strings from the user

DispHome   Return to the home screen, program is still active.

Return   The easiest and safest way to exit a program or function.
The executon will pick up where you left the previous program.  When you use this in a function, you can return values.

Stop   Full Stop.  End of code execution.  Dangerous.  Avoid at all costs.



Extra Program: Intermediate
Info()
Prgm
ClrIO
Disp ?My name is Desmond Jenkins?, ?What is yours?
Inputstr ?My Name?, x
Input ?How old are you?, y
ClrIO
Disp ?Okay?, ?Your name is ?, x, ?and you are ?, string(y)&? Years old.?

152
Miscellaneous / Update: I'm In!
« on: June 17, 2005, 06:13:00 pm »
I'm sorry, I'm not too keen on anything HTML execpt for the wonderful Microsoft FrontPage.

153
Miscellaneous / Update: I'm In!
« on: June 17, 2005, 06:42:00 am »
Congrats to you. :)smile.gif

154
Miscellaneous / Update: I'm In!
« on: June 17, 2005, 06:28:00 am »
Thanks, now everyone will understand why my game starts with a greyscale pic of the Drexel Dragon Logo.

I'm in heaven right now!

155
TI 68K / The Sword of Darkness
« on: June 17, 2005, 06:26:00 am »
Tomarrow I will try to post Meridian and Infinity Isle.

156
TI 68K / The Sword of Darkness
« on: June 17, 2005, 06:15:00 am »
I am fine-tuning the system.  I actually worked some more on the maps and I fixed those trees.

157
Miscellaneous / Update: I'm In!
« on: June 17, 2005, 06:06:00 am »
I just recieded notice that I have been accepted to Drexel!!!

158
Miscellaneous / I just can't take it anymore!
« on: June 14, 2005, 08:37:00 am »
If the suspense sends me into a seisure...do you think I can sue.,..lol

159
News / New file and link
« on: June 14, 2005, 07:32:00 am »
I started in 2000.
In the words of Kirk...
"It was...fun...oh my"

160
Miscellaneous / I just can't take it anymore!
« on: June 14, 2005, 07:05:00 am »
Sometime, before the end of the week, I will find out whether or not I am going to be accepted into Drexel University.  The suspense is pounding. :paf:tripaf.gif:dang:banghead.gif:paf:tripaf.gif

161
TI 68K / 89 Basic Tutorial
« on: June 14, 2005, 05:27:00 am »
I will continue to post my tutorial...

162
TI 68K / 89 Basic Tutorial
« on: June 14, 2005, 03:43:00 am »
This is super high level function in basic.  Basic is a high level language (Compared to C and 68k), but EPT is sky high.

163
Site Feedback and Questions / Omnimaga Goes Gold
« on: June 14, 2005, 03:39:00 am »
Very nice :bow:worship.gif:bow:worship.gif

164
Other Calculators / Why do you program for calcs?
« on: June 12, 2005, 04:35:00 pm »
So you say you want a revolution...something original.  Thats what TSOD is all about, A really deep story, tons of different maps, and an unusual battle system.  I am with you. The term Basic sounds a little demeaning...

165
TI 68K / The Sword of Darkness
« on: June 12, 2005, 01:25:00 pm »
I will work on those trees.

Pages: 1 ... 9 10 [11] 12 13 ... 16