Question
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
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:
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
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