TAILIEUCHUNG - Lecture Computing for management - Chapter 27

After studying this chapter you will be able to understand: The basic components of a C++ program, including functions, special symbols, and identifiers; explore simple data types; discover how to use arithmetic operators; examine how a program evaluates arithmetic expressions; | Iteration Lecture 27 5/14/2020 5:41:16 AM Summary of Previous Lecture In the previous lecture we have been learnt Boolean Type int as Boolean Boolean expressions Boolean Operators Precedence Common mistakes Today’s Lecture while statement for statement break statement Nested loops The while Statement Implements the repetition in an algorithm Repeatedly executes a block of statements Tests a condition (Boolean expression) at the start of each iteration Terminates when condition becomes false (zero) Example: Read in numbers, add them, and print their sum and average set sum to 0 set count to 0 input totalNumbers while (count NOTE: the last statement could cause a division by 0 Read in numbers, add them, and print their sum and average set sum to 0 set count to 0 input totalNumbers while (count /**********************************\ Read in numbers and add them up Print out the sum and the average \**********************************/ int main() { return 0; } Read in numbers, add them, and print their sum and average set sum to 0 set count to 0 input totalNumbers while (count /**********************************\ Read in numbers and add them up Print out the sum and the average \**********************************/ int main() { float nextNum, sum = ; int count = 0, totalNumbers; return 0; } Read in numbers, add them, and print their sum and average set sum to 0 set count to 0 input totalNumbers while (count Summary of Previous Lecture In the previous lecture we have been learnt Boolean Type int as Boolean Boolean expressions Boolean Operators Precedence Common mistakes Today’s Lecture while statement for statement break statement Nested loops The while Statement Implements the repetition in an algorithm Repeatedly executes a block of statements Tests a condition (Boolean expression) at the start of each iteration Terminates when condition becomes false (zero) Example: Read in numbers, add them, and print their sum and average set sum to 0 set count to 0 input totalNumbers while (count NOTE: the last statement could cause a division by 0 Read in numbers, add them, and print their sum and average set sum to 0 set count to 0 input totalNumbers while (count < totalNumbers) { input nextNum add .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.