70 likes | 186 Views
COMP2012H: OOP and DS (honors track) http://course.cs.ust.hk/comp2012h. Fast-paced High workload Learn many details on your own Therefore, you must be both good and hard-working to succeed COMP2012H challenges the best and the most independently minded!. Announcement. No lab in week 1
E N D
COMP2012H: OOP and DS (honors track) http://course.cs.ust.hk/comp2012h Fast-paced High workload Learn many details on your own Therefore, you must be both good and hard-working to succeed COMP2012H challenges the best and the most independently minded!
Announcement • No lab in week 1 • Want to skip all the labs: score them all before Mar 4! See courseweb for details.
Hello World! #include <iostream.h> using namespace std; int main() { cout << "hello, world!" << endl; return 0; } contains classes/objects useful for screen output e.g. cout
org 100h ; set video mode mov ax, 3 ; text mode 80x25, 16 colors, 8 pages (ah=0, al=3) int 10h ; do it! ; cancel blinking and enable all 16 colors: mov ax, 1003h mov bx, 0 int 10h ; set segment register: mov ax, 0b800h mov ds, ax ; print "hello world" ; first byte is ascii code, second byte is color code. mov [02h], 'h' mov [04h], 'e' mov [06h], 'l' mov [08h], 'l' mov [0ah], 'o' mov [0ch], ',' mov [0eh], 'w' mov [10h], 'o' mov [12h], 'r' mov [14h], 'l' mov [16h], 'd' mov [18h], '!' ; color all characters: mov cx, 12 ; number of characters. mov di, 03h ; start from byte after 'h' c: mov [di], 11101100b ; light red(1100) on yellow(1110) add di, 2 ; skip over next ascii code in vga memory. loop c ; wait for any key press: mov ah, 0 int 16h ret Who wants to write this … except COMP180 students ?!
What’s good about OOP? • Objects separate interface from implementation • In C++, interface is given by .h files, and implementation by .cpp files
Suggested Work Schedule for Project #1 • Due on Mar 8! • (14 days) work up to lab5. • Learn QT / some inheritance on your own • (14 days) work on project #1. • OOP allows you to implement the requirements readily by using QT classes • (4 days) backup • in case you fall short of the above schedule
Due dates and late penalty • Projects are due at 23:59:00 on the due date. You are permitted a total of five late days without penalty for the semester that may be used on any of the five programming projects. • See courseweb for details (or ask questions now!)