Question
PROGRAMMING ENGINER C++, Please help me to write the code for this problem. Thanks Problem 1. Paste the code provided below into Excel, and expand
PROGRAMMING ENGINER C++, Please help me to write the code for this problem. Thanks
Problem 1. Paste the code provided below into Excel, and expand and enhance the program. Enhance this code by adding at least 8 decimals to the constants. Also, add the other constants shown in the comments sections by expanding the If statement with more ElseIf conditions. Paste your updated code into this document. Do not paste a screenshot.
Function Constant(x)
'this function is for returning values for common constants.
'The inputs are text, the output is a number
'input pi gives output 3.141...,
'input e gives output 2.718...,
'input phi gives output golden ratio 1.618...,
'input gam gives output gamma 0.577...,
'input c gives output the speed of light 2.998 x 10^8,
'input G gives output gravitational constant.
If x = "pi" Then
Constant = 3.141
ElseIf x = "e" Then
Constant = 2.718
Else
Constant = "No constant"
End If
End Function
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