COMP115 Lecture Notes - Lecture 6: Boolean Function

31 views1 pages

Document Summary

Functions enable us to group related code together (modularity) and reuse it easily (reusability) Code that is performed when function is called. The return type can be a type that has been defined, e. g. int or float. A return type of void means that the function doesn"t return anything. Given a ball at (x1, y1) with a radius r1 and another ball at (x2,y2) with a radius r2, write boolean function is collision, which returns true if the two balls collide, and false otherwise. hint: use function distance.

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