Test 1 study guide

Test 1 study guide - X = 4 % 3 , y++, X-- X = 0, y = 5 4)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Test 1 study guide: This is just a guide referring to major topics covered so far. 1) Scanf and printf use. Questions will be on finding errors and showing how the statement works: a. Cout << Num Errors: Cpital C, and missing ; b. What is printed: float num = 3.435654; cout << “Result = $“<< num; prints: Result = $3.435654 2) Declaring variables: a. What is an identifier? b. From the list : 1_jack, Jack_1, R2d3, K#1, which are valid identifiers ? 3) Evaluate arithmetic expression: for the following values X =3, y =4, a = 2.5; For each expression refer to the initial values. a. W = X /y++ * a++ ; W = 0.0, y = 5, a = 3.5 b. W = ++X / y++ * a++ ; W = 2.5, y = 5, a = 3.5, X = 4 ; c. a += ++X * y --; X = 4, a = 18.5, y = 3 d. X = y++ % X-- ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: X = 4 % 3 , y++, X-- X = 0, y = 5 4) Know how if and switch statements work, tracing problem. int alpha = 5, beta = 4 ; int X = 0 ; y = 6 ; switch (beta) if( X > 0) { if ( y > 5) case 3 : alpha += 3 ; cout << “ y is bigger than 5 “ ; case 4 : alpha += 4; else break ; cout << “ y is less than 5 “ ; default : alpha += 5 ; else beta++; cout << “ X is less than 0 “ ; break ; X is less than 0 } cout << beta << alpha ; 4 9 5) Write a detailed analysis/algorithm 6) Know the following definitions: a. Algorithm b. Software Engineering c. Software Life cycle (Development cycle) (Analysis, Design, Implementation,…) d. Purpose of Comments in a program e. Identifiers (variables,. .)...
View Full Document

This note was uploaded on 11/01/2009 for the course CS 101 at USC.

Ask a homework question - tutors are online