CS 101 Problem Solving and Structured Programming in C - PowerPoint PPT Presentation

About This Presentation
Title:

CS 101 Problem Solving and Structured Programming in C

Description:

Class web page. http://www.mtholyoke.edu/courses/srollins/cs101/ Assignments. Reading Chapter 1 ... A specific set of instructions. An algorithm to make a PBJ ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 13
Provided by: David6
Category:

less

Transcript and Presenter's Notes

Title: CS 101 Problem Solving and Structured Programming in C


1
CS 101Problem Solving and Structured Programming
in C
  • Sami Rollins
  • srollins_at_mtholyoke.edu
  • Spring 2003

2
Introduction
  • What is computer programming?
  • What is this class about?
  • Who should take this class?

3
Administrative Information
  • Class web page
  • http//www.mtholyoke.edu/courses/srollins/cs101/

4
Assignments
  • Reading Chapter 1
  • Homework 0 due Monday

5
Computer Hardware
  • Main memory
  • Secondary memory
  • CPU
  • Input devices
  • Output devices

6
Computer Software
  • Operating system
  • Examples?
  • Applications
  • Examples?
  • How is a new application developed?

7
Computer Programs
  • At the lowest level machine instructions
  • 00000111000
  • One step up assembly language
  • ADD A
  • More user friendly high level languages
  • C A B
  • Examples?

8
Translation
  • High level language must be translated into a
    language the computer can understand

High-level Code
Compiler
Machine Instructions
9
Writing Programs
  • Understand requirements
  • Write an algorithm
  • Implement your algorithm
  • Test your code

10
What is an algorithm?
  • A specific set of instructions
  • An algorithm to make a PBJ sandwich?

11
Hello World
  • /
  • Name Sami Rollins
  • Source file name hello.c
  • My first "hello, world" program in C.
  • /
  • include ltstdio.hgt
  • //the main function
  • int main (void)
  • //print the phrase
  • printf("Hello, world!")
  • return(0)

12
Errors
  • You WILL have errors in your programs
  • Syntax Errors
  • Compiler doesnt understand code
  • Ex. printf(Hello, world!)
  • Sometimes error messages dont match problem
  • Logic
  • Program runs, but doesnt do what you want
  • Ex. printf(Hell, world!)
  • Can be hard to track down
Write a Comment
User Comments (0)
About PowerShow.com