Professor Ernesto Gomez
phone: (909) 537-5429
Class: T-Th 10 AM CS 122, Lab: T-Th 11:30 AM JB-359
mail lab code and assignments to: Sarjil Hasan firstname.lastname@example.org>/a>
This class will introduce you to computer science and the C++ language.
Syllabus - may change
Other references: UML
Linux.org - Information and links
Codepad - quick multilanguage interpreter
All labs must be turned in on or before the last day of the term. If you want to turn in an improved version of something already turned in, add "revised lab (number)" in the subject line. Send all labs in with screenshot showing the program working.
--1-- Hello world program
--2-- Calculator version 1 (loop, if statements, arithmetic) calculator
--3-- Calculator version 2 (statement as logical predicate, break statement)
--4-- Add vector of saved values to calculator - (details coming here)
You will need:
. vector declaration: "vector <double>>reg;" // create 10 double precision registers
. a "put" command P# // where # is a number 0 to 9 - P# saves current value of x to reg[#]
. a "get" command G# // copies value of reg[#] into y, instead of entering from keyboard
. a "read" command R# // displays te value in reg[#]
. a "set" command S#,value // reg[#] to value (may be 2 separate inputs)
Note that # stands for a register number 0 to 9. You will need to figure out where and how to input the above commands.
v1 v2 -- (option-extra credit) Lunar lander game.Dont panic! - How to read the code.
--5-- Bubble sort notes1 notes2
--6-- Upgrade bubble sort - use 2 swap loops, reversing directions through your vector. notes1 notes2
--7-- Add trig functions: sin,cos,tan; asin,acos,atan to your calculator program. The functions want angles in radians, the inverse functions (asin,acos,atan) return radians. Convert to and from degrees as needed. You will need #include
The following are my notes on the class: they are generally an annotated outline of material covered relating to each chapter in Horstmann.
You need SSH to login to your CS account from home.
SSH - official site
Open SSH - compatible freeware
SSH for Macintosh
Note that to log in, you must first connect to the gateway machine jbh3-1.csusb.edu. Once you are there, type "ssh (machine-name)", where (machine-name)is one of the computers in the lab.
Cygwin is a free Linux environment that runs under Windows. It includes the standard GNU tools and compilers.
Cygwin - Linux environment that runs under Windows
DJGPP is a version of the GNU C, C++ compilers and tools that runs in a Windows DOS box
DJGPP - GNU compilers and tools for Windows
Ghostview is a viewer for Postscript files - standard under Linux - Many computer science references on the internet are in Postscript format.
Ghostview - Poscript viewer
a bunch of old text based games in BASIC