Instructions:
- Fork this repository to your GitHub account.
- Clone the forked repository locally to your machine.
- Create a new branch named Feature01.
Objective: Express computations more concisely using the "multadd" operation.
Instructions:
- Create a new program called
Multadd.javain the src directory. - Write a method called
multaddthat takes three doubles as parameters and returnsa * b + c. - Write a main method that tests
multaddby invoking it with a few simple parameters, like 1.0, 2.0, 3.0. - Also in main, use
multaddto compute the following values:$$\sin\left(\frac{\pi}{4}\right) + \frac{\cos\left(\frac{\pi}{4}\right)}{2}$$ $$\log_{10}(10) + \log_{10}(20)$$
- Write a method called
expSumthat takes a double as a parameter and usesmultaddto calculate:$$xe^{-x} + \sqrt{1 - e^{-x}}$$ - Hint: The method for raising ( e ) to a power is
Math.exp.
Expert Coder Tip: When writing a method that invokes another method you wrote, it is advisable to test the first method carefully before working on the second. Avoid debugging two methods simultaneously, which can be challenging.
Note: One of the purposes of this exercise is to practice pattern-matching: the ability to recognize a specific problem as an instance of a general category of problems.
Follow these steps for submission:
- Create a Feature01 branch of your code if you haven't already.
- Commit your working code and method implementations to your local copy/Feature01 branch.
- Push it to your Remote/origin branch (i.e., GitHub: Feature01 -> origin/Feature01).
- Issue a Pull request to my instructor repo.
- Make sure to COPY the Pull request URL and submit it for the lab/assignment in Canvas.