# [Tegan and Sara] The First [Program...]

Page 1 of 1

## 5 Replies - 1687 Views - Last Post: 01 June 2009 - 07:12 PM

### #1 monkey_05_06

• D.I.C Head

Reputation: 1
• Posts: 105
• Joined: 26-August 06

# [Tegan and Sara] The First [Program...]

Posted 17 May 2009 - 05:59 PM

I don't know if anybody else listens to Tegan and Sara but it's unrelated. They do have a song titled The First but that's not what this thread is about.

This thread is actually about the first program you've ever written. I of course am referring to something other than a "Hello World!" program; I'm thinking more along the lines of the first program you ever wrote for yourself based on what you'd learned to do. I've been programming actively for over 5 years now and I don't know that much about mainstream programming to be honest since the majority of my work is done with a game engine that has its own language. I do know some C++ and php. Enough to get me by anyway.

I was just thinking last night about the first program that I ever wrote. It was when I was in 9th grade and I wrote a program for my TI-83 graphing calculator. It was a pretty basic concept involving the slope-intercept mathematical formula which reads as:

```y = mx + b
```

Given this formula, taking the basic principles of algebra we can also solve these:

```m = (y - b) / x
x = (y - b) / m
b = y - mx
```

Given these four equations with any 3 known variables it would be a simple matter to solve for the fourth and final unknown.

One question that was posed to me by a teach later on that stumped me at the time but occurred to me as I was thinking back on it was, "How can you solve for the slope with only one point?"

Of course looking at the above formulas if X == 0 then there would be a divide by zero error so we can assume a point at (0, as well as at (X, Y) which gives the two points needed for the validity of the formula to solve for slope.

So anyway, I just rewrote the program since I no longer had it. Here's the full source:

```ClrHome
Disp "	 Y=MX+B","","SOLVES THE SLOPE","	INTERCEPT","   FORMULA FOR","A SINGLE UNKNOWN"
Pause
Lbl W
ClrHome
Menu("WHICH UNKNOWN?","Y",Y,"M",M,"X",X,"B",B)
Lbl Y
ClrHome
Prompt M,X,B
ClrHome
MX+B→Y
Disp "Y=",Y
Pause
Goto A
Lbl M
ClrHome
Prompt Y,X,B
ClrHome
If X=0
Then
Disp "   X MUST BE","	NONZERO","","PLEASE TRY AGAIN"
Pause
Goto M
End
(Y-B)/X→M
Disp "M=",M
Pause
Goto A
Lbl X
ClrHome
Prompt Y,M,B
ClrHome
If M=0
Then
Disp "   M MUST BE","	NONZERO","","PLEASE TRY AGAIN"
Pause
Goto X
End
(Y-B)/M→X
Disp "X=",X
Pause
Goto A
Lbl B
ClrHome
Prompt Y,M,X
ClrHome
Y-MX→B
Disp "B=",B
Pause
Goto A
Lbl A
Menu("AGAIN?","YES",W,"NO",E)
Lbl E
ClrHome
Return
```

Anyway, I thought it would be interesting to see what some of you wrote as your first useful program. I looked around and didn't see anything like this so sorry if I overlooked it.

This post has been edited by monkey_05_06: 18 May 2009 - 12:11 PM

Is This A Good Question/Topic? 0

## Replies To: [Tegan and Sara] The First [Program...]

### #2 NickDMax

• Can grep dead trees!

Reputation: 2255
• Posts: 9,245
• Joined: 18-February 07

## Re: [Tegan and Sara] The First [Program...]

Posted 17 May 2009 - 10:01 PM

Lets keep programming topics out of the caffeine lounge please.
Was This Post Helpful? 0

### #3 firebolt

• D.I.C Lover

Reputation: 93
• Posts: 5,561
• Joined: 20-February 09

## Re: [Tegan and Sara] The First [Program...]

Posted 18 May 2009 - 06:34 AM

Why not place this in the tutorials?
Was This Post Helpful? 0

### #4 Bort

• Ill-informed Mongoloid

Reputation: 450
• Posts: 3,114
• Joined: 18-September 06

## Re: [Tegan and Sara] The First [Program...]

Posted 18 May 2009 - 08:51 AM

My first program was a random number generator (aka, a Dice Roller)

And, it can be seen in all it's glory here.

This post has been edited by Bort: 18 May 2009 - 08:51 AM

Was This Post Helpful? 0

### #5 monkey_05_06

• D.I.C Head

Reputation: 1
• Posts: 105
• Joined: 26-August 06

## Re: [Tegan and Sara] The First [Program...]

Posted 18 May 2009 - 12:07 PM

NickDMax, on 17 May, 2009 - 09:01 PM, said:

Lets keep programming topics out of the caffeine lounge please.

Sorry I didn't think it belonged in the programming help forum simply because I wasn't asking for programming help. I did read over the "NO PROGRAMMING QUESTIONS" but I still thought it was the best forum for the topic as it is a programming discussion not a technical question... My mistake.
Was This Post Helpful? 0

### #6 papuccino1

• His name was Robert Paulson.

Reputation: 63
• Posts: 1,121
• Joined: 02-March 08

## Re: [Tegan and Sara] The First [Program...]

Posted 01 June 2009 - 07:12 PM

This topic is in the right place I think.

My first actual useful program I built was a movie torrent searcher. I just typed in the movie name and the DVDRip torrent would download. Actually I just made it two weeks ago so it hasn't really been that long.
Was This Post Helpful? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }