Lecture 0 Course information Computer environment Algorithms and - - PowerPoint PPT Presentation

lecture 0
SMART_READER_LITE
LIVE PREVIEW

Lecture 0 Course information Computer environment Algorithms and - - PowerPoint PPT Presentation

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:


slide-1
SLIDE 1

Lecture 0

Course information Computer environment Algorithms and programming

slide-2
SLIDE 2

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)
slide-3
SLIDE 3

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.

slide-4
SLIDE 4

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

slide-5
SLIDE 5

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).
slide-6
SLIDE 6

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.

slide-7
SLIDE 7

Webreg

  • Important to register to a lab group.

– Before the first lab session (this afternoon)

  • Link on the course webpage
slide-8
SLIDE 8

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.

slide-9
SLIDE 9

Sendlab

  • System to send in labs
  • More info on the first lab session
slide-10
SLIDE 10

Stone

  • Introduction to Unix/Linux system

– Do on your own time. – No examination – Help during lab session

slide-11
SLIDE 11

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!
slide-12
SLIDE 12

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.

slide-13
SLIDE 13

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.

slide-14
SLIDE 14

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.

slide-15
SLIDE 15

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.)
slide-16
SLIDE 16

First main

  • Starting point for the operating system
  • Only one main per program
slide-17
SLIDE 17

Output

  • cout
  • operator <<
  • string literal
  • includes
  • comments for human reader
slide-18
SLIDE 18

Simple example

#include <iostream> using namespace std; int main() { cout << “hello world” << endl; }

slide-19
SLIDE 19

Input

  • cin
  • operator >>
  • variable
  • type
slide-20
SLIDE 20

Simple example

#include <iostream> using namespace std; int main() { int x; cin >> x; cout << x << endl; }