Week 01: Getting Started

08/18/2020 video
  1. Unix
    Read: A few commands
    Make the C program pgm1.c

    Read: A little more

  2. The files p.c, ops.c, v.c, adr.c, a.c are program files in the ~sternfl/500 directory. Each file is written in the C language and that source code will be converted (compiled) to machine instructions in step c below. Right now we need to get copies into your home directory so you can work with them.

    1. Enter the command below to copy p.c:
          cp ~sternfl/500/p.c   ~
      
      Copy the other files the same way.

    2. Steps c and d are to be repeated for each of the files. Your goal is learn what each C statement does by observing the output on the screen when a.out is run. Note: Each time the compile is successful, there are new instructions in a.out. The old machine instructions are gone. Be prepared to discuss these in class.
      pico fileName.c    //look at the C statements
      gcc fileName.c     //compile to make a.out 
      a.out              //see what a.out does
      
    3. Enter the command below to edit file p.c.
          pico p.c
      
      The program has several printf statements in it. Compare the printf's with what happens when the program is run below.

    4. Compile and run each file. Enter each command below
          gcc p.c   
          a.out
      
      Do the same for the other files.

  3. Fake Quiz 1

08/20/2020
  1. Watch: for loops; nested for loops

  2. Nested Loop Problems
    Look at problem 1 in assessments x4, x7, and x8.
    Here: assessments
    In your home account write program files x4.1.c, x7.1.c, and x8.1.c   Solutions to problem 1 in x4, x7 and x8 respectively.

  3. Quiz 1