CS%20101%20 - PowerPoint PPT Presentation

About This Presentation
Title:

CS%20101%20

Description:

Title: PowerPoint Presentation Created Date: 1/1/1601 12:00:00 AM Document presentation format: On-screen Show (4:3) Other titles: Times New Roman Arial Wingdings ... – PowerPoint PPT presentation

Number of Views:98
Avg rating:3.0/5.0
Slides: 11
Provided by: fur115
Learn more at: http://cs.furman.edu
Category:
Tags: nouns | types

less

Transcript and Presenter's Notes

Title: CS%20101%20


1
CS 101 Oct. 5
  • Computer problem solving
  • Chapter 6 read pp. 148-174
  • Problem-solving procedure
  • Structure of a solution
  • Examples!

2
Review what is CS ?
  • The study of how we
  • Solve problems
  • Represent information
  • In problem solving, wed like
  • Find systematic ways of going about solution
  • Correct, quick and informative solutions.
  • Information can be
  • Different types numbers, text, images, sound,
    the software itself
  • The input and output to a computer program

3
Why create software?
  • Computational power
  • Excel is limited to so many rows/columns
  • Can convert data to images
  • Can create games and useful applications
  • With one language, can solve virtually any
    problem.
  • Built-in features of languages
  • Many common calculations are pre-defined for you
    such as sorting, opening files, surfing the Web,
    creating a button, etc.

4
Software
  • Powerful!
  • We get to tell the machine exactly what we want.
  • Sometimes, existing programs like Excel or
    Photoshop are not enough.
  • Program sequence of instructions for CPU to
    obey.
  • Works like a recipe.
  • A recipe has ingredients, steps, and result is
    food!
  • A program has input, calculations, output. ?
  • When we start to look at programs, be on the
    lookout for these 3 parts.

5
Recipes
  • Cooking may be a good analogy, because its
    solving a specific problem Im hungry. ?
  • What do we see in recipes? Heres one
  • Brown the beef 15 min. Drain grease.
  • Dice carrot, celery, onion (aka mirepoix)
  • Cut up and boil 6 potatoes until soft.
  • Mash potatoes
  • Add flour, spices, sauce, mirepoix to beef.
  • Put meat mixture into casserole, top with
    potatoes.
  • Bake in oven at 400 for 30 minutes.

6
Recipes (2)
  • A computer program has some of the same elements
    as a recipe
  • In recipes we see
  • Ingredients (the nouns of the problem)
  • Steps to perform (the verbs)
  • In some steps, we continue/wait for something
  • Although its not obvious, sometimes we check
    things
  • Are potatoes fully mashed?
  • Should I add more _____ to the mixture?

7
Recipes (3)
  • But we dont eat the same stuff every day. Once
    we know a few recipes, we can put together a menu
    for choices.
  • if (have all ingredients), make Shepherds pie.
  • if (no potatoes), just make soup instead.
  • if (no veggies), make hamburger.
  • if (no beef), make pasta.
  • When you view a whole menu as a program, then
    making soup becomes a sub-program.
  • A large program is composed of several parts.
  • In industry, sometimes each part implemented by
    different people. A kitchen may have many chefs.

8
Problem-solving
  • Understand problem inputs and outputs
  • Write solution in English pseudocode
  • Write code in a programming language
  • Compile
  • Run and test
  • When program works, can refine.

9
Problems
  • The earliest problems given to a computer were
    mathematical.
  • Sometimes there is no clean formula
  • Many equations cant be solved analytically. For
    example, cos(x) x. Need to solve numerically.
  • Ex. Heat equation is a partial differential
    equation (PDE). Most PDEs have to be solved
    numerically.
  • Ex. Calculating a square root.
  • And even if there is a clean formula, a computer
    can help you automate the calculations.

10
Problems (2)
  • Mathematical problems may at first sound
    boring. But they include many useful
    applications
  • Ex. Finding directions
  • Other kinds of problems for the computer
  • Games
  • Record keeping, managing investments,
  • Networking, communication
  • Multimedia (e.g. image processing)
  • Of course, much more!
Write a Comment
User Comments (0)
About PowerShow.com