0% found this document useful (0 votes)
51 views2 pages

Syllabus Mid Term Exam - PF

This document covers topics in C++ including input/output statements, data types, variables, expressions, operators, control flow, and functions. It discusses using cout and cin, variable declaration and assignment, precedence rules for expressions, logical and relational operators, if/else conditional statements, switch statements, and provides examples for currency conversion and cable billing programs.

Uploaded by

Ibrar Hussain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views2 pages

Syllabus Mid Term Exam - PF

This document covers topics in C++ including input/output statements, data types, variables, expressions, operators, control flow, and functions. It discusses using cout and cin, variable declaration and assignment, precedence rules for expressions, logical and relational operators, if/else conditional statements, switch statements, and provides examples for currency conversion and cable billing programs.

Uploaded by

Ibrar Hussain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Chapter 2

Compilation vs Execution, variations in Compilers version


Use of cout statement
display of plain messages
display of variables contents
to change the insertion pointer
cascaded cout statement
Use of Cin
Library Files
Use of Comments
single line and multiple lines
Declaration Statement
data types (short, int and long , float and double, char)
set of values
unsigned/signed data types
overflow and underflow of variables
Rules of Identifiers
variables and constants
reserved words
Assignment Statement
simple assignment statement,
nested expression in assignment statement
r-value / l-value
Arithmetic Assignment Statement (+=, -=, *= and /=)
cascaded assignment statement (right to left associativity , a=b=c=d=34;)
declaration and initialization in one statement
Expressions
Simple expression
Nested Expression
Evaluation order of +, -, *, / , ( )
Precedence Rules
Associative Rules (L to R, R to L)
Unary, Binary and Ternary Operators
Post/Pre Increment and Decrement ++, - -
/ and % operators
Mixed Expressions
Type casting:
implicit Type Casting
Explicit Type Casting

String Type
Const vs Variable
Escape Sequences
Problem Solving Process, Analysis
Program #1 Length Conversion (feet and inches to centimeters conversion)
Program #2 Currency Change (cents to dollars, dimes, nickels and pennies)

Chapter 4
Control Structures
Sequence , Selection , Repetition
Logical Expression and Relational Operators (==, != , < , <= , > , >=)
Relational Operators and Simple Data types
Relational Operators and String Data types
Logical Operators and Logical expression (! Not , && and , || or)
Order of Precedence
int Data Type and Logical (Boolean) Expressions
bool Data Type and Logical (Boolean) Expressions
Selection: if and if...else
One-Way Selection (if statement)
Two-Way Selection (if else)
Compound (Block of) Statements
Multiple Selections: Nested if
Comparing if...else Statements with a Series of if Statements
Short-Circuit Evaluation
Comparing Floating-Point Numbers for Equality: A Precaution
Associativity of Relational Operators: A Precaution ( if (0 <= num <= 10) )
Avoiding Bugs by Avoiding Partially Understood Concepts and Techniques (else
belongs to nearest if)
Confusion between the Equality Operator (==) and the
Assignment Operator (=)
Conditional Operator (?:)

Switch Structures
Avoiding Bugs by Avoiding Partially Understood Concepts and Techniques
(Revisited)
Terminating a Program with the assert Function
PROGRAMMING EXAMPLE: Cable Company Billing

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy