


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Week 1
Reading:
Objectives:
Concepts:
Outline:
Reference:
1. Introduction A. Declarative vs. Imperative knowledge 1. Declarative: "What is true" knowledge 2. Imperative: "How to" knowledge 3. Programming: act of expressing "how to" knowledge B. Expressing imperative knowledge requires languages 1. Languages contain vocabulary (words), syntax, and semantics 2. Languages differ in a.Programming model b. Number of features c. Specificity C. Program complexity 1. Metric: Source Lines of Code 2. Complexity management techniques a. Abstraction b. Good coding conventions D. From recitation: UNIX commands 1. mkdir, cd, mv, cp, ls E. What is an Indentifier? 1. An identifier is used for any variable, function, data definition, etc. 2. An identifier is a combination of alphanumeric characters, the first being a letter of the alphabet or an underline 3. The remaining being any letter of the alphabet, any numeric digit, or the underline. 2. Programming Basics A. Number representation 1. Binary encoding of numeric values 2. Converting from binary to decimal, and decimal to binary 3. Base-n encoding 4. Converting from base-n to decimal, and decimal to base-n 5. Hexadecimal and octal representations 6. C syntax for binary, hex, and octal B. Basic program structure 1. Statements, main, declaration, #include, comments 2. Standard I/O library, and "stdio.h" header file 3. printf (), scanf() a. Formatting strings b. "%" placeholders c. "&" notation 4. Variables a. Declaration: type, name, and storage allocation. b. Initialization 5. "while" loops 6. Compilation
D. Boolean
Solutions:
1.void main() { printf (โ\n This is CS 351 Systems Programming\nโ); }
2.void main() { int a,b,c; printf(โ/n enter any two integer numbersโ); scanf(โ\n %d,%dโ,&a,&b); c=a+b; printf(\n The addition of two numbers is %dโ,c); }