Intro to C Programming Midterm
Basic code?
#include <stdio.h> void main () { printf("My name is Ray Hummels\n"); return(0); }
What is a Computer Program?
-A computer program is a sequence of instructions written to perform a specified task with a computer. -A computer program is writing in specific language that a "computer" can "understand"
Main Components Of Computer Hardware?
-CPU: Central Processing Unit. -Memory -Secondary Storage -Input/Output Devices -Network -Bus
Software Development
-Development of a software product. It is the process or activity of writing and maintaining a computer program. -Software Development Company ---Requirements Analysis ---Design ---Implementation -------Programming ---Testing ---Documentation (how I did this) ---Training and Support (show clients how to use) ---Maintenance
Compilation Process?
-I, computer programmer, speak only java, C and Python. -Compiler translates from C to 0s and 1s so the computer can understand. -Object files and libraries are merged in a linker. -Program becomes an executable software.
Basic constructs of programming with examples?
1. Looping (do while) 2. Branching (if else and switch) 3. Sequential (printf)
What is a compiler?
A compiler converts high level language into machine language.
Bus
A component that connects all other components in computer hardware.
Difference between a do loop and a do-while loop.
A do loop always executes at least once, while a while loop won't necessarily.
What is stdio.h?
A library that makes it easier for us to code.
What is Machine Language?
A low-level language specific to that type of hardware (binary code, 0s and 1s).
What is a C library in general?
A set of functions/procedures already given to make it easier to program.
What is an algorithm?
A set of steps to solve a problem. An algorithm must be: --Clearly and unambiguously defined. --Effective, in the sense that its steps are executable. --Finite, in the sense that it terminates after a bounded number of steps.
What is an IDE and what did we use it for?
An integrated development environment. We used it for a compiler, an editor, and an environment to code in.
What is the Procedural Programming Paradigm?
C is based on procedures and functions. When you want to solve the problem, you have to think in terms of procedures (modules or units)
Memory
Main Memory is where programs and data are kept when the processor is using them.
How does a for statement execute?
Starts with the initial condition, go into loop, check the condition, i++.
CPU
The brain of the computer where calculations take place.
Network
The network component allows the computer to connect with other computers.
Secondary Storage
Where programs and data are kept on a long-term basis.
Input/Output devices
input and output devices allow the computer system to interact with the outside world by moving data into and out of the system (keyboard, mouse, screen). The user will input something (i.e. via keyboard or mouse) and the computer will output data (i.e. computer screen).