Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

prostuff1

macrumors 65816
Original poster
Jul 29, 2005
1,482
18
Don't step into the kawoosh...
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
 

prostuff1

macrumors 65816
Original poster
Jul 29, 2005
1,482
18
Don't step into the kawoosh...
GeeYouEye said:
Is the exam concepts, Java, or C++?

To be honest i dont know :eek:

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
 

macmanmatty

macrumors regular
Jul 10, 2005
237
0
(x,y)
prostuff1 said:
To be honest i dont know :eek:

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.
---------------------------------------------------------------------------------------



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














prostuff1 said:
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
---------------------------------------------------------------------------------------


One Possible Anwser said:
Sum_of_numbers( input parmeters: number1, number1 : real; output parmeter sum : real;)



prostuff1 said:
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




One possible anwser said:
..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
 

grapes911

Moderator emeritus
Jul 28, 2003
6,995
10
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.
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
grapes911 said:
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.
 

prostuff1

macrumors 65816
Original poster
Jul 29, 2005
1,482
18
Don't step into the kawoosh...
yellow said:
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!!
 

sushi

Moderator emeritus
Jul 19, 2002
15,639
3
キャンプスワ&#
grapes911 said:
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.
yellow said:
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
 

prostuff1

macrumors 65816
Original poster
Jul 29, 2005
1,482
18
Don't step into the kawoosh...
rjrufo said:
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.