Quantcast

Maximum PC

It is currently Sat Dec 20, 2014 7:24 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Online Course notes/thoughts
PostPosted: Wed Jan 30, 2008 3:29 pm 
Northwood
Northwood
User avatar

Joined: Sun Jul 15, 2007 6:37 pm
Posts: 2261
Location: No. 1 Thread Killer
Okay, I've been taking this online class for basic programming (literally BASIC) for about 3 weeks now and I want to keep notes here so that I can be critiqued by you and post my questions about the QuickBasic language here, if no one has any issues with it.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 3:43 pm 
Northwood
Northwood
User avatar

Joined: Sun Jul 15, 2007 6:37 pm
Posts: 2261
Location: No. 1 Thread Killer
First off: I DO NOT EXPECT YOU TO TELL ME HOW TO WRITE THE PROGRAM.

(I'm a big boy)


My current assignment is to write a really ultra simple program to do stats for 3 players on a team.

I know the Tags:

Code:
REM, LET, PRINT, COLOR, CLS, END



I also know how to make numeric variables, alpha-numerics, equations, variable equations

' means the same thing as REM in QBASIC


Quote:
The coed 3-player basketball team needs to keep track of some simple statistics. Your job as the team statistician is to write a program that will neatly display the team's scoring information in a table format. Here are the details you will need to write this program.

1. The title above the table should be The Binary Bandits.
2. There should be column headings for Player, 2-Pts., 3-Pts, FTs, and Total.
3. There should be three rows of data, one for each player.
4. All alphanumeric and numeric data must be assigned to variables.
5. Use several colors to enhance the appearance of the table.
6. The actual data you will use represent the number of 2 point baskets made, the number of 3 point baskets made, and the number of free throws made. These statistics for each player are shown in the table below.
7. From this you will calculate the total number of points made by each player. The general formula to use for total points is:

Total = (No. of 3-Pointers x 3) + (No. of 2-Pointers x 2) + Free Throws

EX output:

Binary Bandits

Player 3-Pts 2-Pts FT Total
Atwill 2 6 5 23
Putney 5 3 4 25
Jordan 2 4 3 17


I must do pseudo code first!

I will not post the assignment I turn in (for mischievous children) however I will post snippets of code.

Code:
         pt  =  # of Free Throws

  Ex of how it is used with players:

   Jordan made 4 Two-pointers:
         jpt2 = 4

REM The letter at the front of all "pt" variables is the first letter of the name of the player
   

   
Processing
   
      Most processing for this is the total.

     (pt3 x 3) + (pt2 x 2) + (pt) = total#


EDIT: I have Googled many of these phrases, and came up with nothing. If you have found any search engine that links to this thread, please tell me.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 4:27 pm 
Coppermine
Coppermine

Joined: Wed Jul 07, 2004 11:07 am
Posts: 666
Location: Woodland Hills, CA
Good for you that you are taking the initiative to learn a programming language. Bad for you that noone is interested in BASIC.

If you want active participation, I would suggest learning a language that is interesting. Perl is a good one. Perl is artistically elegant (but you won't see that until you have been a coder for a while) and has some very interesting features.

And don't worry if you think the language is "hard". That term is ill conceived. There is no "hard" language to learn, it's what you first expose yourself to.

C is good, because it forms a nice low level base that you can compare to with most other languages. But that may be a different case for you and your perception of programming.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 4:49 pm 
Northwood
Northwood
User avatar

Joined: Sun Jul 15, 2007 6:37 pm
Posts: 2261
Location: No. 1 Thread Killer
kkith wrote:
Good for you that you are taking the initiative to learn a programming language. Bad for you that noone is interested in BASIC.

If you want active participation, I would suggest learning a language that is interesting. Perl is a good one. Perl is artistically elegant (but you won't see that until you have been a coder for a while) and has some very interesting features.


#1
It's more for an intro to simple programming (and it raises my gpa) than anything else.

#2
The class is called Computer Programming but I didn't think that it would literally be BASIC.

I tried to learn BASH, that didn't work out so well.

I never really thought of learning Perl.

I am in the output section of the simple program


Code:
INPUT:
REM Jordan's point count
jpt = 3
jpt2 = 4
jpt3 = 2

REM PROCESSING

' Atwill

LET atotal = (apt3 * 3) + (apt2 * 2) + (apt)

REM OUTPUT
'




I am almost done with this program, and will post the results soon.


Top
  Profile  
 
 Post subject:
PostPosted: Thu Jan 31, 2008 11:57 pm 
Coppermine
Coppermine

Joined: Wed Jul 07, 2004 11:07 am
Posts: 666
Location: Woodland Hills, CA
Dwood15 wrote:
kkith wrote:
Good for you that you are taking the initiative to learn a programming language. Bad for you that noone is interested in BASIC.

If you want active participation, I would suggest learning a language that is interesting. Perl is a good one. Perl is artistically elegant (but you won't see that until you have been a coder for a while) and has some very interesting features.


#1
It's more for an intro to simple programming (and it raises my gpa) than anything else.

#2
The class is called Computer Programming but I didn't think that it would literally be BASIC.

I tried to learn BASH, that didn't work out so well.

I never really thought of learning Perl.

I am in the output section of the simple program


Code:
INPUT:
REM Jordan's point count
jpt = 3
jpt2 = 4
jpt3 = 2

REM PROCESSING

' Atwill

LET atotal = (apt3 * 3) + (apt2 * 2) + (apt)

REM OUTPUT
'




I am almost done with this program, and will post the results soon.


Oh sorry. I re-read the original post. I had perceived that "taking an online class" had a looser definition, like you were doing some online tutorial. I had not thought of it being for an actual class class! :)


Top
  Profile  
 
 Post subject:
PostPosted: Fri Feb 01, 2008 1:29 pm 
Northwood
Northwood
User avatar

Joined: Sun Jul 15, 2007 6:37 pm
Posts: 2261
Location: No. 1 Thread Killer
kkith wrote:
Oh sorry. I re-read the original post. I had perceived that "taking an online class" had a looser definition, like you were doing some online tutorial. I had not thought of it being for an actual class class! :)


It's okay. No offense taken. I wouldn't be hiding so much of my code if it weren't an actual online class class.

And don't worry, I do hope to move on to other languages, just getting my feet wet, per se.

Anyways. here is my program.

Image

Here is a sampling of the Table's code:

Code:
LET jtotal = (jpt3 * 3) + (jpt2 * 2) + (jpt)

REM OUTPUT  displaying data

' Table format


PRINT ; tm$; , ; ""
PRINT ""
COLOR 27, 9
PRINT ; scrs$; , ; pt3$; , ; pt2$; , ; pt$; , ; ttl$; ""


I know: simple!


Top
  Profile  
 
 Post subject:
PostPosted: Fri May 02, 2008 7:21 am 
Northwood
Northwood
User avatar

Joined: Sun Jul 15, 2007 6:37 pm
Posts: 2261
Location: No. 1 Thread Killer
Hmmm... I am in a slight pickle here.

Code:
LET wage = 6.25
COLOR 10, 0
REM Input
CLS
INPUT "How many hours did the employee work"; hrs
CLS


REM Calculation Section
IF hrs <= 40 THEN
  LET overt = 0
  LET overtp = 0
  PRINT "This employee does NOT qualify for over time"

SLEEP 5

ELSE
  LET overt = hrs - 40

  LET overtp = wage * overt * 1.5

  PRINT "This employee qalifies for overtime pay"

SLEEP 4

END IF

[b] pay = overtp + wage * (hrs - overt)[/b]





You see the issue?

if the person works, say 90 hours, the person will be earning into the negatives!

EDIT: I got the right answer but it feels like sloppy coding.

Instead of:

pay = overtp + wage * (hrs - overtp)

It's now

pay = overtp + ((hrs * wage) - overtp/1.5)


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© 2014 Future US, Inc. All rights reserved.