Copyright © – Sudharsan Iyengar
CS – 234 Lab 12 4/22/2025
Write an application that requests, and takes in, an integer value representing an angle in degrees. It then outputs its sine, cosine, and tangent values. Write a class called Angle whose constructor takes an angle in degrees, stores this value within it.
It also has methods to return the sine, cosine, and tangent values for the angle stored. You must calculate the values (not use the Math routines sin, cos, and tan).
The sine of an angle x – in radians – can be calculated (approximately) using the formula
Sine(x) = x – x3/3! + x5/5! – x7/7! + x9/9! - …
The cosine of an angle x – in radians – is given as
Cosine(x) = 1 – x2/2! + x4/4! – x6/6! + x8/8! - …
You may stop the calculation to a resolution of 0.01.
Modify the application such that it requests repeatedly (until the user chooses exit) – to choose a Sine, Cosine or Tangent and an integer value for angle (in degrees) and performs the chosen calculation and outputs the result.
You need to format the output to 2 decimal places.