01:198:111 Lecture 8: 10/1 - Procedures
01:198:111 verified notes
8/28View all
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.