Lecture 0 Course information Computer environment Algorithms and programming
TDDD33 at a glance • Course Leader: Sam Le • Assistant One: Alexander Johansson • Assistant Two: Lars Backman • Course code: TDDD33 • Homepage: www.ida.liu.se/~TDDD33 • Book: C++ Primer by Lippman, Lajoie, Moo • Credits: 6hp (1+3+2) • Workload: 160 hours (about 30 hours/hp)
Timeline • This week: – TODAY: Register! – Lab 0 – STONE (individual). – Find lab partner (collaborative). Who is ideal? • Week 36-41: – Lectures, Lessons (collaborative) and Labs (work in pairs). • Week 42-43: – Break for examinations in other HT1 (autumn 1) courses.
Timeline • Week 44-51: – Lectures, Lessons (collaborative) and Labs (work in pairs). • Week 52-1: – Merry and Happy days before Examination. • Week 2 in 2017: – Exam
Important events • Week 37-42: Bonus deadlines for labs. – Reward: More time for higher grade on exam! • Week 46-51: Bonus deadlines for labs. – Reward: More time for higher grade on exam! • Week 3: Computer exam (first chance).
Events during Jan-Aug • Jan – Mars: – Course is sleeping like a bear during winter. Do not wake it up. • Eastern: – Bear wake up briefly to take a leak. Computer exam (second chance). • Apr – Aug: – Course is sleeping like a bear during winter. Do not wake it up. • August: – Bear wake up for new year. Computer exam (third chance). Course start next year.
Webreg • Important to register to a lab group. – Before the first lab session (this afternoon) • Link on the course webpage
Lab demonstrations • Require both participating students attending and ready to answer questions about the lab. • Require a complementary code hand-in after successful demonstration. • Are accepted between first and about one week past the last lecture.
Sendlab • System to send in labs • More info on the first lab session
Stone • Introduction to Unix/Linux system – Do on your own time. – No examination – Help during lab session
Computer examination • You solve ”real” problems on real computers using real tools (lab environment equivalent) • Your grade depend on number of assignments solved completely with quality in given time. – 1 assignment in 4 hours for grade 3 – 2 assignments in 4 hours for grade 4 – 3 assignments in 4 hours for grade 5 (or 2 in 2.5h) – bonus from labs give extra time • ”Live” correction, you can rework problems!
Lecture vs Lesson vs Lab • Lecture: – I talk. You try to answer my questions. You ask lots of questions that I answer. • Lesson: – Assistant present a problem. You solve it together, interactively, by telling assistant the next step to do. • Lab: – We provide requirement specification. You learn how to write programs that fulfil the spec. • Exam: – We provide requirement specification. You demonstrate that you learned.
Programming (small perspective) Problem solving! 1. Write pseudo-code: – Divide large problems in smaller problems... – ... figure out an algorithm for each... – ... and conqer. 2. Write C++-code: – Translate the pseudo-code to valid C++. 3. Compile and test: – Verify your code work as required by spec.
Work process (in theory) • Problem solving : create pseudo-code. • Translate your pseudo-code to C++. • Compile the program. • Run the program. • It works! DON’T do it for the entire program at once. Do it for one small subset first and move on to the next subset only when the first works.
Work process (in practice) 1. Problem solving : create pseudo-code. 2. Translate (yet another) part of your pseudo- code to C++. 3. Compile the program. Errors occur. Restart. 4. Run the program. Errors occur. Restart. 5. It does not work to spec. Restart. 6. Assistant find flaws. Restart. 7. (You want to learn more. Restart.)
First main • Starting point for the operating system • Only one main per program
Output • cout • operator << • string literal • includes • comments for human reader
Simple example #include <iostream> using namespace std; int main() { cout << “hello world” << endl; }
Input • cin • operator >> • variable • type
Simple example #include <iostream> using namespace std; int main() { int x; cin >> x; cout << x << endl; }
Recommend
More recommend