01:198:111 Lecture 8: 10/1 - Procedures

142 views2 pages
Verified Note

Document Summary

Before writing a procedure analyze the problem. Output: the larger of the two numbers. Code: definitely using an operator like > to determine which number is larger. Procedures are made to solve larger problems that are more complicated than just using normal operators values. It also makes your code look cleaner as you can call upon procedures within different programs if you need. Return means to return to the main program again. Maxoftwo is the name of the program. Public double mypayment(double r, int n, double p);{ This returns the absolute value of a double value. This returns the natural log(base e) of a double value. This returns the value of the first double raised to the power of the second. E. g. pow(2,3) would return a value of 8 because it is 2 raised to the power of 3. This procedure does not take any values in but rather returns a random.

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