PDA

View Full Version : Need some advice!!

prostuff1
Nov 11, 2005, 12:05 PM
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

GeeYouEye
Nov 11, 2005, 02:20 PM
Is the exam concepts, Java, or C++?

prostuff1
Nov 11, 2005, 02:45 PM
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

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

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
Nov 12, 2005, 08:48 PM
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.
---------------------------------------------------------------------------------------

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

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

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

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

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

Sum_of_numbers( input parmeters: number1, number1 : real; output parmeter sum : real;)

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

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

mov ax, 0 ; set the number to zero
mov cx , 10 ; make the base 10
mov bx , 0 ;make the final number 0
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
negnum:
mov tick, 1

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

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
Nov 12, 2005, 08:52 PM
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
Nov 12, 2005, 08:55 PM
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
Nov 12, 2005, 09:59 PM
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
Nov 12, 2005, 10:25 PM
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.
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
- 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

rjrufo
Nov 13, 2005, 07:34 AM
I've found that O'Reilly (http://oreilly.com/) is a great source for books on programming and other computer related stuff. You may want to start there.

HTH

prostuff1
Nov 13, 2005, 08:41 AM
I've found that O'Reilly (http://oreilly.com/) 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.