{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lec26

# Lec26 - THE FINAL LECTURE Fifty Minute Review PIC 10A Todd...

This preview shows pages 1–5. Sign up to view the full content.

1 THE FINAL LECTURE: Fifty Minute Review PIC 10A Todd Wittman A Look Back... square6 Take a moment to reflect on all you’ve accomplished this semester. HW1 : Cash register HW6 : Triangle Class HW2 : Ratio calculator HW7 : War Game HW3 : Tic-tac-toe HW8 : Blackjack HW4 : Valentine's cartoon HW9 : Elvish Translator HW5 : Interactive Map square6 Be sure to send your .exe files to your family!

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Final Exam square6 Sunday March 15th square6 3:00-6:00 square6 Young Hall 76 square6 The final exam is worth 30% of your grade, same weight as 2 midterms. square6 Length is also roughly 2 midterms (2 hrs). square6 Very similar in style to practice exams and midterms. square6 Half short-answer, half long-answer. square6 Exam cover Ch. 1-10 + Sec 12.1 square6 Emphasis on material covered since last exam. square6 Remember to bring your student ID. Ch. 1: The Simple Program square6 Recall the first C++ program you wrote: #include <iostream> using namespace std; int main ( ) { cout << "Hello Middle Earth!\n"; return 0; }
3 Ch.2: Data Types square6 In C++, you can't use a variable until you declare its type. int x=-10; double y=3.2; char c = 'h'; square6 You can temporarily change a type by casting. square6 Remember casting a double to int chops the decimal. int a = 2; int b = 3; double c = (double) a / b; //Stores z = 0.666667 int d = (int) c; //Stores d=0. square6 You have to be comfortable with arithmetic operations. + - * / % square6 Remember dividing integers gives an integer. square6 The mod operator % gives the remainder after division square6 Other operations in <cmath> : sqrt, pow, sin, cos Ch. 2: Input/Output (I/O) square6 Our console I/O is defined in <iostream> . square6 Basic output: cout << x; Basic input: cin >> x; square6 Watch the arrows! square6 Remember the basic escape characters. box2 \n new line \t tab box2 \\ backslash \" double quote square6 Remember spaces won't show unless you put them there square6 We can chain the push/pulls. cin >> x >> y >> z; cout << " 2+2 = " << 2+2 << "\n"; square6 Get an entire line in string s: getline(cin,s); square6 Get one character in char c: cin.get(c); //Used in HW9.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Ch. 2: I/O Formatting square6 The <iomanip> library has functions for formatting your output.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 10

Lec26 - THE FINAL LECTURE Fifty Minute Review PIC 10A Todd...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online