Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assessment question to test what you learned from your assignments. It is worth 1 point in total (partial credit will be given). Their grade will
Assessment question to test what you learned from your assignments. It is worth 1 point in total (partial credit will be given). Their grade will not affect your test grade but your assignments grades. For more details, review the "1380rubric.doc document with the Grading Criteria (available from Miscellaneous). Write a short Crprogram (include header files) that performs the following tasks: //insert header files //1. Declares a named constant called HALF that holds value 1/2 in it. // 2. Declares a variable named num2 and another named num1 that hold real numbers. //3. Prompts the user to "Enter a number and I will show its half: // 4. Reads the value from the keyboard and stores it in num1. //5. Calculates the half of num1 (using the named constant) and stores the result in num2 // 6. Formats the output to display the numbers in fixed format with only one decimal digit. // 7. Prints a message like the one below (N2 and N1 are the values corresponding to num2 and num1 respectively. N2, " is one half of ", N1 IMPORTANT: .you must choose the best data type for the named constant and variables so your answer is not truncated. For example, if the user enters 3, your program should display: 1.5 is one half of 3.0 .Be careful with the value assigned to HALF. . Use the named constant in step 5
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