Welcome to IIT and cs 104 CS 104

  • Slides: 29
Download presentation
Welcome to IIT and cs 104!

Welcome to IIT and cs 104!

CS 104 - Secs. 001 -003 • Jon Hanrath – SB 112 B •

CS 104 - Secs. 001 -003 • Jon Hanrath – SB 112 B • Office Hours: – MW 7: 00 a. m. 8: 30 a. m. • 312 -567 -5701 • hanrath@iit. edu

 • Lecture: M, W 10: 00 a. m. – 10: 50 a. m.

• Lecture: M, W 10: 00 a. m. – 10: 50 a. m. • Labs (Section 01 or 02 or 03) 10: 00 a. m. – 10: 50 a. m.

CS 104 – Required Textbook and Lab Manual • Matlab by Example: Programming Basics,

CS 104 – Required Textbook and Lab Manual • Matlab by Example: Programming Basics, – Munther Gdeisat and Francis Lilley, Elsevier Science and Technology Books, Inc. © 2013, ISBN: 9780124052123. – Available in Books 24/7 online through the IIT Galvin Library http: //library. iit. edu/find/databases/all/b – choose "Books 24 x 7" and search for the book. If not on campus, logon. • Problem Solving Basics and Computer Programming – http: //www. cs. iit. edu/~cs 104/Problem. Solving. pdf

CS 104 - Quizzes/Exams & Grading • 2 Quizzes – Each 5% of Grade

CS 104 - Quizzes/Exams & Grading • 2 Quizzes – Each 5% of Grade • 2 Exams: – Exam I - Lecture - 10% – Exam II - Lecture - 25% • Final Exam - 35% • Labs - 20% • Must Take Final to Pass Course

CS 104 Labs • Labs Assigned in Handout • Lab Exercises Comprised of Pencil-and-Paper

CS 104 Labs • Labs Assigned in Handout • Lab Exercises Comprised of Pencil-and-Paper Exercises and Programming Exercises • Exercises Mirror What Will Be On Tests • Student Expected to Complete Labs *BEFORE* Lab Section Meets • Labs Graded Either 10 (complete attendence), 5 (partial attendence), or 0 (no attendence) • TA Will Cover Labs/Questions/Other Topics in Lab Session

Expectations • • • Attendance in Lectures and Labs Completion of Quizzes and Exams

Expectations • • • Attendance in Lectures and Labs Completion of Quizzes and Exams Four to Six Hours per Week on Homework Outside Help If Necessary No Cheating (Quizzes, Exams, Project) Have fun!!

Rules • No Swearing or Other Inconsiderate Behavior • Turn Off Cell Phones •

Rules • No Swearing or Other Inconsiderate Behavior • Turn Off Cell Phones • No Laptops, i. PADs, etc. • No Internet Browsing, emailing, etc. in Lab (C’mon, it’s only 50 minutes!) • Questions, Discussion, Ideas Welcome

Excuses If You Will Miss an Exam or Quiz, Make Arrangements **BEFORE** the Exam

Excuses If You Will Miss an Exam or Quiz, Make Arrangements **BEFORE** the Exam or Quiz Date Arrangements Must Be Made via Email Exam, Quiz Dates Already Posted If Emergency: • Doctor/Hospital Note • Family Problem: Contact Info for Parents

Unacceptable Excuses • • Slept Late Felt Sick I’m Just a Freshman Roommate Ate

Unacceptable Excuses • • Slept Late Felt Sick I’m Just a Freshman Roommate Ate My Alarm Clock/Textbook/Underwear Missed Bus Had a Game/Match/Practice Didn’t Know When Exam/Quiz Was If Any of Above Happen, Get to Class As SOON as Possible!!!

CS 105 - Ethics • Exams: – Closed Book, Closed Notes, Closed Everything –

CS 105 - Ethics • Exams: – Closed Book, Closed Notes, Closed Everything – Nothing in Ears (mp 3 players, cell phones, etc. ) • Labs Should Be Done Independently, But Working with Others Acceptable

CS 105 – Where to Get Help • Instructor Office Hours • TA’s Office

CS 105 – Where to Get Help • Instructor Office Hours • TA’s Office Hours, Lab Time - Any TA Can Answer Questions • ARC: Academic Resource Center Has Tutors Available (Northwest Corner of Hermann Hall) (http: //arc. iit. edu) • Internet • GET HELP EARLY RATHER THAN LATER!!!

Problem Solving • • Arrange a Deck of Cards by Suit and Rank How

Problem Solving • • Arrange a Deck of Cards by Suit and Rank How Would You Do This? How Would You Tell a Child to Do This? How Would You Tell a Computer to Do This?

Problem Solving • • A Program is a Problem Solving Tool Computers Follow Instructions

Problem Solving • • A Program is a Problem Solving Tool Computers Follow Instructions Given to Them Computers Do Not Have “Intuition” Computers Do Not Make Decisions “on Their Own”

Why Computers? Extremely Fast No Breaks No Raises No Vacations No Complaining

Why Computers? Extremely Fast No Breaks No Raises No Vacations No Complaining

Terminology • Program – instructions for a computer telling it what to do. •

Terminology • Program – instructions for a computer telling it what to do. • Programming Language – a particular way (syntax) for writing programs (Java, C++, C, Python, Mat. Lab) • Operating System – the large program that runs a computer when you start it (Microsoft Windows, Mac, Linux) • Designer – a person who makes a plan to solve a problem • Programmer/Coder – a person who write programs in a language • Tester – a person who tests programs

Basic Problem Solving with Programming (Design) Understand the Problem Create Steps to Solve Problem

Basic Problem Solving with Programming (Design) Understand the Problem Create Steps to Solve Problem Inputs – data received by a program or given to a program used to produce a result Process – taking input(s) and modifying it to produce a result Outputs – the resulting data after processing

Input-Process-Output (sequential processing) 1. What are the inputs? What format are they in? (e.

Input-Process-Output (sequential processing) 1. What are the inputs? What format are they in? (e. g. , integer, floating-point, character, or string) How do you get them? (e. g. , prompt user, argument when run the program, or read from file) 2. How do you get from inputs to the outputs you want (process)? What are the calculation steps? To follow these steps, what else do you need? Other variables, constants, conversion? (besides input and output variables) Libraries (e. g. , for calculations). 3. What are the outputs? What format are they in? How do you output them? (e. g. , on screen or to a file)

Decomposition – breaking down a problem into simpler steps. 1. 2. 3. 4. 5.

Decomposition – breaking down a problem into simpler steps. 1. 2. 3. 4. 5. Identify all of the nouns in the sentence. Eliminate redundant or irrelevant information. Identify all of the verbs in the sentence. Link you inputs, processes, and output Use external knowledge to complete your solution Example: Given the 3 dimensions of a box (length, width, and height), calculate the volume.

1. Identify all of the nouns in the sentence. Given the 3 dimensions of

1. Identify all of the nouns in the sentence. Given the 3 dimensions of a box (length, width, and height), calculate the volume. Once these nouns are identified, they should be grouped into one of two categories: • Input (items I either already know or am getting from the user) • Output (items that I find out by manipulating the input)

2. Eliminate redundant or irrelevant information. Information not needed to process problem.

2. Eliminate redundant or irrelevant information. Information not needed to process problem.

Input Dimensions - We don’t need the noun dimensions here because we already have

Input Dimensions - We don’t need the noun dimensions here because we already have length, width, and height. Length Width Height Box - We do not need the box to calculate volume if we know the dimensions, not needed. Them - Another word for dimensions, not needed. Output Volume

3. Identify all of the verbs in the sentence. The verbs in the problem

3. Identify all of the verbs in the sentence. The verbs in the problem specification identify what actions your program will need to take. These actions, known as processing are the steps between your input and your output. Given the 3 dimensions of a box (length, width, and height), calculate the volume.

4. Link your inputs, processes, and output This step is as simple as drawing

4. Link your inputs, processes, and output This step is as simple as drawing lines between the relevant information in your chart. Your lines show what inputs need to be processed to get the desired output Input Length Width Height Processing Calculate Output Volume

5. Use external knowledge to complete your solution Volume = length * width *

5. Use external knowledge to complete your solution Volume = length * width * height

Decomposition Problem You have a store that sells lemons and oranges. Oranges are $.

Decomposition Problem You have a store that sells lemons and oranges. Oranges are $. 30 each and lemons are $. 15 each. For a certain number of oranges and lemons, calculate the total bill.

Decomposition Problem You have a store that sells lemons and oranges. Oranges are $.

Decomposition Problem You have a store that sells lemons and oranges. Oranges are $. 30 each and lemons are $. 15 each. For a certain number of oranges and lemons, calculate the total bill. Inputs : number of oranges and lemons; price of oranges and lemons Processing : calculate (number of oranges times 0. 30 plus number of lemons times 0. 15) Outputs : total bill

More Advanced Problem Solving • The decomposition approach is fine for fairly simplistic input-process-output

More Advanced Problem Solving • The decomposition approach is fine for fairly simplistic input-process-output problems, but what happens when our problems are more involved? • “flow of control” models in programming – Sequential – Selection – Iteration – Functions

Possible Errors • Syntactic Errors – compiler/interpreter finds • Semantic Errors – logic or

Possible Errors • Syntactic Errors – compiler/interpreter finds • Semantic Errors – logic or formula errors, conversion errors, etc. • Thematic Errors – Not solving the correct problem!