Introduction
Lecture 1
Spring 2025
CS1004 - Spring 2025 1
,Lecture Contents
• C++ Programming basics
• Control structures
• Arrays
CS1004 - Spring 2025 2
, Programming Style
• C++ is a free-format language, which means that:
• Extra blanks (spaces) or tabs before or after identifiers/operators are ignored
• Blank lines are ignored by the compiler just like comments
• Code can be indented in any way
• There can be more than one statement on a single line
• A single statement can continue over several lines
CS1004 - Spring 2025 3
, Programming Style (cont. )
• In order to improve the readability of your program, use the following conventions:
• Start the program with a header that tells what the program does
• Use meaningful variable names and Camel notation
• Document each variable declaration with a comment telling what the variable is used for
• Place each executable statement on a single line
• A segment of code is a sequence of executable statements that belong together
• Use blank lines to separate different segments of code
• Document each segment of code with a comment telling what the segment does.
4
CS1004 - Spring 2025