2330 : Introduction to Programming in C

June 20th - Time to Code

We have quite a lot on schedule to cover for today. Let's get rolling.
What does it mean to program
A brief talk on what programming is, what does it mean to program, what sort of things do you do with programming, and what you need in order to program. Pay attention to this lecture because if you aren't even very sure about what programming really is, you will have no idea what you are doing, and programming becomes boring, and you will always only be programming "because you need to" (for homework). You can't do something without knowing what it really is first!
Variables and data types
Today we will introduce you variables. Variables are one of the most important things in programming, without variables you can't do much, or anything at all. You should know what variables are by now, having done the reading of the textbook, but we will also cover it. We will also introduce you several different basic data types, how to declare variables and assign values to them.
Work time
You will have in-class assignments (as well as a homework programming assignment for the weekend) on the topics you learn today. They will all be announced in class. You will have a lot of time coding in class today. The homework programming assignment will be posted here on this page by the end of class.

Note: To include the genlib.h and simpio.h libraries, use these lines instead of the ones from the book:
#include "/home/cc/atdp4/su03/staff/atdp4-tc/genlib.h"
#include "/home/cc/atdp4/su03/staff/atdp4-tc/simpio.h"

Homework programming assignment

Write a program that does the following.

Ask a student (user) for his/her name, and ask for his/her score for the following three categories: Homework, final exam, participation. You will need to do this three times, for three different students. At the end of the program, print out their grade in percentage (*). Please use only what we have covered on Friday's lecture, that is, variables, and the get-input functions.

Below are the weight for each of the grading category, for your calculation purpose in this program:

Programming Assignment - 50% of grade - 500 points possible
Final Exam - 50% of grade - 500 points possible
Participation - 5% extra credit - 100 points possible

* Hint: in order to print out a percentage sign (%) in your output text, you will have to type %% inside a printf("") function, as the % character is otherwise reserved for use with %d, %f, etc.