CMSC 122 Lecture Notes - Lecture 21: Multiplication Table, Semicolon

71 views2 pages
Verified Note

Document Summary

Cmsc 122 lecture 21 oct 12. Examples: grid of asterisks, multiplication table, nested list. Trace tables: mechanism to keep track of values in a program, allows you to understand the program behavior, we could create a trace table for even numbers. Combination of statements: you can have any combinations of conditionals and iteration loop statements, for example, conditionals inside loops, conditionals inside conditionals, loops inside conditionals, loops inside loops. It computes the remainder when an integer x is divided by another integer y: an arithmetic operator commonly used in many applications, var r = x % y. If x = 9 and y = 4, answer will be 1. } while (condition): first execute the loop body then check condition, the difference to while loop is that do while loop is always executed at least once even if the condition is initially false.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents