Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this... Original Template: #include // for std I/O (cin, cout) #include #include #include #include // to be able to use operator typeid

Need help with this...

Original Template: #include // for std I/O (cin, cout) #include #include #include #include // to be able to use operator typeid // Include here all the other libraries that required for the program to compile

using namespace std;

// Ignore this; it's a little function used for making tests inline void _test(const char* expression, const char* file, int line) { cerr

int main( ) { // Declares constant PI:3.141592

// Declares variable name that holds text

// Declares variables alpha,beta,sina,cosb, and total that hold double precision real numbers

// Prompts the user to "Please enter your full name: "

// Reads the full name from keyboard and stores it in the corresponding variable

// Prompts the user to "Please enter angle alpha: "

// Reads the value from the keyboard and stores it in the corresponding variable

// Prompts the user to "Please enter angle beta: "

// Reads the value from the keyboard and stores it in the corresponding variable

// Displays "Thanks ", name

// Calculates the sine of alpha and the cosine of beta, and stores the results in the corresponding variables

// Calculates the total as the addition of the sine and the cosine and stores it in the corresponding variable

// Formats the output to display the values in fixed format with three decimal digits

// Prints a message like the one below: // Using 23 columns displays "sine of alpha: ", using 6 columns displays sina

// Using 23 columns displays "+ cosine of beta: " , using 6 columns displays cosb

// Using 30 columns displays "-------"

// Using 23 columns displays "total: ", using 6 columns displays total system("pause");

// Do NOT remove or modify the following statements cout

My Attempt on the code:

image text in transcribedimage text in transcribed

int main() { // Declares constant PI:3.141592 const double PI = 3.141592; // Declares variable name that holds text string name; 17 Declares variables alpha, beta, sina, cosb, and total that hold double precision real numbers double alpha; double beta; double sina; double cosb; double total; // Prompts the user to "Please enter your full name: cout > alpha; // Prompts the user to "Please enter angle beta: " cout > beta; // Displays "Thanks ", name cout > alpha; // Prompts the user to "Please enter angle beta: " cout > beta; // Displays "Thanks ", name cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Power Bi And Azure Integrating Cloud Analytics For Scalable Solutions

Authors: Kiet Huynh

1st Edition

B0CMHKB85L, 979-8868959943

More Books

Students also viewed these Databases questions