Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 11, 2005, 12:05 PM   #1
prostuff1
macrumors 65816
 
prostuff1's Avatar
 
Join Date: Jul 2005
Location: Don't step into the kawoosh...
Need some advice!!

I am a freshmen ion college and i am trying to major in Computer Engineering. Well i am supposed to take a class spring quarter called CSE 221 and i have to pass an entrance exam to get into the class... and if i dont pass the exam i will have to take a Javaand/or C++ programming class.

What i need from you wonderful people is suggestions on how to teach myself some programing so i can pass this exam so i dont fall behind a quarter or two. I have about 10 weeks to teach myself (which should be interesting )

So any help would be greatly appreciated!!

P.S. if you want to know what is on the exam i have a sample exam i managed to get ahold of form my advisor.

Thanks
__________________
Vista: It's the blond version of OS's; pretty and fun, just... not functional for everything
prostuff1 is offline   0 Reply With Quote
Old Nov 11, 2005, 02:20 PM   #2
GeeYouEye
macrumors 68000
 
GeeYouEye's Avatar
 
Join Date: Dec 2001
Location: State of Denial
Send a message via AIM to GeeYouEye Send a message via Yahoo to GeeYouEye
Is the exam concepts, Java, or C++?
__________________
I bring order to chaos. You are in chaos Windows, you are the contradiction, a bug wishing to be an OS.
Visit Softyards Software
NEW DEFINITION OF GEEK
Like politics, free speech, computers, entertainment, and more? Join us at Wordforge.net
GeeYouEye is offline   0 Reply With Quote
Old Nov 11, 2005, 02:45 PM   #3
prostuff1
Thread Starter
macrumors 65816
 
prostuff1's Avatar
 
Join Date: Jul 2005
Location: Don't step into the kawoosh...
Quote:
Originally Posted by GeeYouEye
Is the exam concepts, Java, or C++?
To be honest i dont know

Anyway i can give you some examples of what is on the test:

1. Suppose thast you are using a programming language that provides the following data types: integer, real, boolean, character and string. For each data value describe below, give a variable name, and its type, for holding the described data.

EXAMPLE:

a) Data: The name of the town where you were born
Vabiable name: town of birth
Variable type: string

Question
Data: The number of students enrolled in a class
Variable name: ____________________________
Variable type: ____________________________

There are three types of question like that on the test.
---------------------------------------------------------------------------------------

Next is:

Give procedures or function headers for the following problems:

EXAMPLE:
Given: the co-ordinates (x1, y1) and (x2, y2) of two diagonal corner
points of a rectangle
To compute: the height and width of the rectangle
The procedure or function header:

PROCEDURE Height_And_Width (
input parameters x1, y1, x2, y2 : real;
output parameters ht, width : real
);

Question
Given: 2 integers x and y
To compute: the sum of the 2 numbers
The procure or function header:

And this is what i have to find out and study for

There are 2 types of this question
---------------------------------------------------------------------------------------

Last is:

Write a complete program, in a programming language of your choice, that prompts the user to enter two real numbers. The program should then output the smaller number. Program output should include appropriate user friendly headings.

And here is were i write the program.
---------------------------------------------------------------------------------------

Ok well that is what the test has on it from what i have been told. Unfortuantly i dont have a class i can take were i am now and main campus is about and hour and thirty mins away and i dont want to drive that far just for one class.

If anyone can point me in the right direction i would greatly appreciate it.

Thanks
__________________
Vista: It's the blond version of OS's; pretty and fun, just... not functional for everything
prostuff1 is offline   0 Reply With Quote
Old Nov 12, 2005, 08:48 PM   #4
macmanmatty
macrumors regular
 
Join Date: Jul 2005
Location: I have calculated my velocity so precisely that according to Heisenberg's Uncertainty Principle I could be anywhere in the universe
Quote:
Originally Posted by prostuff1
To be honest i dont know

Anyway i can give you some examples of what is on the test:

1. Suppose thast you are using a programming language that provides the following data types: integer, real, boolean, character and string. For each data value describe below, give a variable name, and its type, for holding the described data.

EXAMPLE:

a) Data: The name of the town where you were born
Vabiable name: town of birth
Variable type: string

Question
Data: The number of students enrolled in a class
Variable name: ____________________________
Variable type: ____________________________

There are three types of question like that on the test.
---------------------------------------------------------------------------------------


Quote:
Originally Posted by One Possible Anwser
Variable name: students (or what ever else you want)
Varaible type: Long, Word, Int, or others depending on lanugage













Quote:
Originally Posted by prostuff1
Next is:

Give procedures or function headers for the following problems:

EXAMPLE:
Given: the co-ordinates (x1, y1) and (x2, y2) of two diagonal corner
points of a rectangle
To compute: the height and width of the rectangle
The procedure or function header:

PROCEDURE Height_And_Width (
input parameters x1, y1, x2, y2 : real;
output parameters ht, width : real
);

Question
Given: 2 integers x and y
To compute: the sum of the 2 numbers
The procure or function header:

And this is what i have to find out and study for

There are 2 types of this question
---------------------------------------------------------------------------------------

Quote:
Originally Posted by One Possible Anwser
Sum_of_numbers( input parmeters: number1, number1 : real; output parmeter sum : real


Quote:
Originally Posted by prostuff1
Last is:

Write a complete program, in a programming language of your choice, that prompts the user to enter two real numbers. The program should then output the smaller number. Program output should include appropriate user friendly headings.

And here is were i write the program.
---------------------------------------------------------------------------------------

Ok well that is what the test has on it from what i have been told. Unfortuantly i dont have a class i can take were i am now and main campus is about and hour and thirty mins away and i dont want to drive that far just for one class.

If anyone can point me in the right direction i would greatly appreciate it.

Thanks



and in honour of the intel switch




Quote:
Originally Posted by One possible anwser
..model small
.586
.stack 100h


.data

input Db "please input two numbers", 10, 13 ,'$'
output Db "the larger number is ", '$'
count db 0
counter db 0
tick db 0
nums DW 0


Dispstr Macro string ; macro to display a string

mov dx, offset string
mov ah, 9h
int 21h
ENDM

Dispnum Macro num ; this a macro to display any number that you can think of
local loop
local done
local display
local pushl
local restl
local display1
local nnnum

push bx
mov cx, 0 ; makes cx 0 needed for some reason
cmp num, 0
jl pushl
jge restl
pushl:
mov tick, 1
neg num
inc counter
restl:
mov dx, 0 ; makes dx our remainder store cell 0
mov ax, num ; puts num in ax to be diveded
mov bx, 10 ; makes bx our divesor 10

loop:

mov dx, 0 ; makes dx our remainder store cell 0
div bx ; divids ax by bx maing the remainder a.k.a the first diget of our number 10.
add dx, '0' ; dx the the ascii value of dx.
push dx ; pushs dx for our number
inc counter ; ups the number of digets
cmp ax, 0 ; checks to see if you have reached the end of your number
jz display ; if yes go to display
jnz loop ; if no divide again

display:
cmp tick, 1 ; see if number is negative
jz nnnum
jnz display1
nnnum:
push "-" ; push the minus sign

display1:
pop ax ; pops the fist diget of the number into ax
mov dl, al ; puts al into dl to be displayed
mov ah, 2h ; display routine
int 21h ; calls the dos interrupt
dec counter ; downs counter
cmp counter, 0
jnz display1 ; if not zero go back to display
jz done ; if yes go to done

done:
mov tick, 0
pop bx
ENDM


.code
main proc
mov ax, @data
mov ds, ax
dispstr input

readstart:
mov ax, 0 ; set the number to zero
mov cx , 10 ; make the base 10
mov bx , 0 ;make the final number 0
readnums:
mov ah, 0h
int 16h
mov dl, al
mov ah, 2h
int 21h
cmp al, " "
jz storenum
cmp al, "-"
jz negnum
sub al, '0' ;makes al the diget value of al
mov ah, 0 ; make al a word
xchg ax, bx ; swap ax and bx
mul cx ; multiply or number by base 10
add bx, ax ; put the diget in our number bx
jmp readnums ; go back and read in a another char
negnum:
mov tick, 1
jmp readnums

storenum:
inc count
cmp tick, 1
jz makeneg
jmp store
makeneg:
neg bx
store:
mov [nums+si], bx
cmp count, 2
jz compare
inc si
jmp readstart

compare:
mov si, 0
mov [nums],ax
cmp ax, [nums+1]
jg num2
jl num1
num2:
mov dx, [nums+1]
jmp display


num1:
mov dx, [nums]
jmp display



display:

dispstr output
dispnum dx

mov al, 0
mov ah, 4ch
int 21h

Main Endp

end Main


if you need more coments i will post them
__________________
if (os==windows)
{ cout << "Get a TI-83 plus It's more stable than what your using";
}

Last edited by macmanmatty; Nov 12, 2005 at 09:31 PM.
macmanmatty is offline   0 Reply With Quote
Old Nov 12, 2005, 08:52 PM   #5
grapes911
Demi-God (Moderator emeritus)
 
grapes911's Avatar
 
Join Date: Jul 2003
Location: Citizens Bank Park
If you can't answer questions like this, I really encourage you to just take the class. By just learning enough to pass the test, you may fall behind even more in the long run.
grapes911 is offline   0 Reply With Quote
Old Nov 12, 2005, 08:55 PM   #6
yellow
Moderator
 
yellow's Avatar
 
Join Date: Oct 2003
Location: Portland, OR
Quote:
Originally Posted by grapes911
If you can't answer questions like this, I really encourage you to just take the class. By just learning enough to pass the test, you may fall behind even more in the long run.
I couldn't agree more. Sounds like it would behoove you to actually take a class or 2 on programming. Besides, you're a Frosh.. there's no rush.
yellow is offline   0 Reply With Quote
Old Nov 12, 2005, 09:59 PM   #7
prostuff1
Thread Starter
macrumors 65816
 
prostuff1's Avatar
 
Join Date: Jul 2005
Location: Don't step into the kawoosh...
Quote:
Originally Posted by yellow
I couldn't agree more. Sounds like it would behoove you to actually take a class or 2 on programming. Besides, you're a Frosh.. there's no rush.
Tis true!! But i still want to try to teach myself some of this so that i can have a heads up going into the class if and when i have to take it. cant hurt to learn on my own. Besides i dont have that many hours next semester and i could use the time to teach myself something.

So my question is were to start?? What language so you genius's suggest for a noob?? Any certain books/manual/CD's/movie's/etc??

You guys get the picture!!

And thanks for all your help!!!! i appreciate it!!
__________________
Vista: It's the blond version of OS's; pretty and fun, just... not functional for everything
prostuff1 is offline   0 Reply With Quote
Old Nov 12, 2005, 10:25 PM   #8
sushi
Moderator emeritus
 
sushi's Avatar
 
Join Date: Jul 2002
Location: キャンプスワンピー [Japan]
Quote:
Originally Posted by grapes911
If you can't answer questions like this, I really encourage you to just take the class. By just learning enough to pass the test, you may fall behind even more in the long run.
Quote:
Originally Posted by yellow
I couldn't agree more. Sounds like it would behoove you to actually take a class or 2 on programming. Besides, you're a Frosh.. there's no rush.
Wise words indeed.

As with any discipline, it is best to get a good foundation first before proceeding.

Here is a list of some currently used languages including some web based ones in no particular order:
- Assembly
- FORTH
- FORTRAN IV & 77
- Ada
- C
- C++
- Object C
- Pascal
- Object Pascal
- Modula
- COBOL
- BASIC (all kinds including Visual BASIC)
- SmallTalk
- Lisp
- Perl / PHP
- Java / Javascript
- Python
- APL
- HTML
- XML

One of my favorites ones is Pascal.

It all depends on what you want to do with the language. It is like a golfer who goes to his bag of clubs to pull out the one that will work the best for his current shot (situation).

Hope this helps.

Sushi
sushi is offline   0 Reply With Quote
Old Nov 13, 2005, 07:34 AM   #9
rjrufo
macrumors regular
 
Join Date: Sep 2002
Location: Boston
I've found that O'Reilly is a great source for books on programming and other computer related stuff. You may want to start there.

HTH
__________________
http://homepage.mac.com/rjrufo/
rjrufo is offline   0 Reply With Quote
Old Nov 13, 2005, 08:41 AM   #10
prostuff1
Thread Starter
macrumors 65816
 
prostuff1's Avatar
 
Join Date: Jul 2005
Location: Don't step into the kawoosh...
Quote:
Originally Posted by rjrufo
I've found that O'Reilly is a great source for books on programming and other computer related stuff. You may want to start there.

HTH
Thanks for the help!! After reading some of the other post it seems like a lot of people like the O'Reilly book and they are a good place to start.
__________________
Vista: It's the blond version of OS's; pretty and fun, just... not functional for everything
prostuff1 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Storage advice? (a lot of advice...) thefredelement Mac Pro 0 May 21, 2014 08:07 PM
Need advice! CammyMcGowan MacBook Pro 0 Sep 10, 2013 08:31 AM
need advice! m.alkraidees MacBook Pro 0 Jun 11, 2013 10:02 PM
iPad Mini: Advice please BLOND37 iPad 14 Nov 4, 2012 06:35 PM

Forum Jump

All times are GMT -5. The time now is 08:53 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC