CSC 1060 Week 04 IPO Sequence Programs PDF
Document Details
Uploaded by DivineZebra9695
Red Rocks Community College
Tags
Summary
This document contains lecture notes for a computer science course, CSC 1060, on IPO sequence programs. The course covers various C++ programming concepts like programming ethics, sequence programs, input/output, and more. It includes examples and activities.
Full Transcript
CSC 1060 IPO SEQUENCE PROGRAMS OBJECTIVES AGENDA: WEEK 04 To understand the C++ program- 1. Programming Ethics development cycle. 2. What is a program? Declare variables using the 3. What is a sequence program? correct data t...
CSC 1060 IPO SEQUENCE PROGRAMS OBJECTIVES AGENDA: WEEK 04 To understand the C++ program- 1. Programming Ethics development cycle. 2. What is a program? Declare variables using the 3. What is a sequence program? correct data type. 4. Streams Write a simple C++ program that 5. Input, Output, and Assignment incorporates input, process and output instructions using a variety 6. Example of Sequence Program of data types. 7. Increment and Decrement Operators Apply coding standards to a 8. Operator Chaining program for conventional 9. TODO & Resources for Help programming style. PROGRAMMING ETHICS Read and complete the activities within the tutorial: 1.3. Problem Solving, Interactivity & Ethics WHAT IS A PROGRAM Read and complete the activities within the tutorial: 1.3. What is a Program? WHAT IS A SEQUENCE PROGRAM? Provide your own definition of what a sequence program is to you. IO STREAMS Streams move data IN and OUT of your program The library file defines the standard input/output stream objects: o std::istream moves data from the keyboard to a variable in your program using the std::cin object (identifier for console input) o std::ostream moves data from your program to the console window using the std::cout object (identifier for console output) Complete the tutorial and answer the 2 quiz questions at the end C++ INPUT (CPLUSPLUS) All variables, MUST be declared FIRST before being used! int num = 0; // declaration of variable type int Input is extracted >> from the keyboard using std::cin std::cin >> variable; Generally, all inputs require an input prompt: std::cout > num; IMPORTANT NOTE: Input for all datatypes, except char, reads the data entered until whitespace (space, tab or newline: enter key). Data remaining after whitespace is left in the input stream for the next input (this is a vulnerability) C++ OUTPUT (CPLUSPLUS) All variables, MUST be declared FIRST before being used! int num = 0; // declaration of variable type int Output is inserted