Question
Please help me code this C++ programming challenge. Trig Function Table 1.Program Objective Write a program that asks the user to enter two angles in
Trig Function Table 1.Program Objective
Write a program that asks the user to enter two angles in degrees and then generates a table displaying the two angles and the cosine, sine, hyperbolic cosine, and hyperbolic sine of these two angles. Read ALL of this CAREFULLY.
Program Specifications Your program must use variables of type double and with appropriate names. Note that angles may be real numbers and may be positive or negative. Remember to convert angles from degrees to radians before calculating their cos, sin, etc. Use acos(-1.0) to assign a value to your constant for PI. Dont forget to add the appropriate preprocessor directives to use math functions and output manipulators. You are NOT required to use a loop (repetition structure) in your program. Your program must interact with the user and produce output exactly as follows (note the spaces and spelling, more details below). The example below shows program output if the user enters a first angle of -180 degrees and a second angle of 180 degrees.
Enter an angle between -360 and 360 degrees: -180 Enter an angle between -360 and 360 degrees: 180 Angle (degrees) cos sin cosh sinh -180.0 -1.00 -0.00 11.59 -11.55 180.0 -1.00 0.00 11.59 11.55
Construct the first line of the table asfollows: print Angle (degrees)in a field 15 characters wide print each of cos, sin, cosh, sinh in a field 9 characters wide and right justified Print the angles in the second and third rows of the table with one decimal place, in a field 15 characters wide, and left justified. Print each of the cos, sin, cosh and sinh values in the second and third rows of the table with two decimal places, in a field 9 characters wide, and right justified Note: You MUST use output format manipulators to format your output. Do NOT simply print a certain number of spaces between values in your table. Your code will be tested with various input angles that may result in trig values with varying numbers of significant figures. Using output format manipulators correctly will ensure that your programs output will be correct whereas simply printing spaces will not
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started