COP 3223C Lecture Notes - Lecture 14: Increment And Decrement Operators, Vending Machine, Glossary Of Ancient Roman Religion

56 views3 pages
28 Sep 2016
School
Course
Professor

Document Summary

Can be written as pre x to variable or as a post x. It is used with a variable to mean 1 plus the value. Can be written as pre x or post x also. Means minus 1 from value of variable. - -num = num - 1; (pre x) Num - - = num - 1; (post x) In pre x mode (++val, - -val) the operator increments or decrements, then returns the value of the variable. In post x mode (val++, val - -) the operator returns the value of the variable, then increments or decrements. Limitations of program (so far) intro to loops. Our programs can only run on one set of data. We want to change the input, we actually need to run the code again. For example with coin counter, if we needed to add up multiple different sets of user input, we would need to run the program each time.

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

Related Questions