CP104 Lecture 12: Cp104 lesson 12

8 views2 pages
School
Course
hayjayshay and 38575 others unlocked
CP104 Full Course Notes
2
CP104 Full Course Notes
Verified Note
2 documents

Document Summary

Computer languages use punctuation to: o indicate where a line of code ends o group lines of code together. Python uses very little punctuation: python groups lines of code together using indentation, used for control structures and functions, all lines in a control structure or function are indented by the same amount. Note: it is considered good programming style to use indentation even with punctuation heavy languages. 2) if condition is true, execute statements in body. 3) then continue with code that follows. Boolean expressions evaluate to true or false; boolean is a type like int, float, string. Work for number and strings: mixing number and string is unpredictable; not a good idea. Write a program to prompt for an employee"s salary, their sales amount and the sales target. For the month, if sales exceeds the target, add a bonus of to the salary.

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