Monday, October 5, 2015

Math Operations Program

I decided to tackle this assignment after work tonight, and a few syntax errors, and hours later, I finally succeeded! This assignment 's objective is to learn how to create functions, and methods, and to pass, and receive variables from them. I created four static functions that performs various math operations (*/+-) in the mainModule source file. The mainModule is the class that contains Main() and the four functions. I used no Console code in the functions, so therefore I had to pass and receive variables by passing in parameters and returning the result. The functions have two parameters ( values that the user will perform math operations on ) and is programmed to return the result. I used various custom numeric format specifiers to determine how many digits should be printed to the right of the decimal. I decided to use double as the floating-point value. These functions have been tested in Main and the following are the results of the calculations:




No comments:

Post a Comment