Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CIS 251 Exam 1 Study Guide Your first exam will have 50 questions (technically 4

ID: 3746442 • Letter: C

Question

CIS 251 Exam 1 Study Guide Your first exam will have 50 questions (technically 41, but one is a fill in the blank program with 10 blanks). Each question will be worth 2 points. The majority of questions are multiple choice. Chapter 1 What is a named memory location that holds a piece of information called? What is an algorithm? What type of memory is volatile and used for temporary storage? What is the CPU’s job (3 things)? What is the purpose of a memory address? What are the two methods used to C++ write programs? What are the two main parts of the CPU? What is the name for the set of rules that must be followed when writing a program? What is source code? What do compilers do? What are the definitions for the following parts of a program: operators, punctuation, key words, and programmer-defined identifiers? What is a statement? What are the three primary activities that a program performs (IPO)? What does an operator do? Which programming step uncovers syntax errors in your program (editing, linking, compiling, or execution)? What is hardware? Be familiar with the various types of hardware covered in class. Chapter 2 What is the difference between a character literal and a string literal? What does a preprocessor directive start with? What is variable scope? How do you assign a value of “Jane” to a string variable called name that has already been declared? What does every complete C++ program have to have? What object is used in C++ to display things to the screen? Be able to recognize print statements in code. Know how to print spaces, new lines, and variable values to the screen. Given cout statements, be able to determine what will print to the screen. What symbols are used to define single and multi-line comments in C++? What are two ways to print a new line to the screen? What is a string literal? What does it look like in code? Which preprocessor directive is used to insert the contents of another file into your program? Know how integer division differs from floating point division. Be able to determine what is printed to the screen with an expression like: cout << (6 + 2) * (7/ (5 - 3)) << endl; Know what the % operator does and be able to determine the result of calculations used with it. Given variable definitions and cout statements, be able to determine the output from lines of code. Which datatype only needs one byte of data to be stored? Be able to identify valid and non-valid programmer-defined identifiers. Which header file do you need in order to use the cout and cin objects? Which header file do you need to create string variables? Be able to recognize the correct syntax to define a constant. Be able to recognize the correct syntax to store a character in a char variable. What must you have for every variable you use in a program? Program Given a program, be able to fill in missing blanks with preprocessor directives, namespace statement parts, function definition, punctuation, constant and/or variable names/types, cout/cin statements and return statements. If you can write a complete basic program at this point, you should be good to go.

Explanation / Answer

What is a named memory location that holds a piece of information called?
Answer: variable
Explanation: variable is used to store information, which has a name
What is an algorithm?
Answer: an algorithm: is a step by step strategic process to solve a problem
What type of memory is volatile and used for temporary storage
Answer: RAM
explanation: Random access memory is volatile memory which is used by cpu to store information
temporarily
What is the CPU’s job?
Answer:the main job of cpu is find and execute the program and write information to disk
What is the purpose of a memory address?
Answer: the main purpose is to access the data
What are the two methods used to C++ write programs?
Answer: 1: main() method used to initialize program and standard I/O methods
and iostream is the header needed for standard input and output
what are the two main parts of the CPU?
Answer: Arithmetic logic unit and control unit