Your first miniquest - Schrodinger's cata In the file called Draw_Cat.cpp, complete the function with the following sign
Posted: Fri Jul 01, 2022 5:34 am
Your second miniquest - Limerick Consider the following poem: except where noted as permitted) is a good start A dozen, a gross and a score and three times the square root of four divided by seven plus five times eleven is nine squared and not a bit more. Suppose I don't know how much a dozen, a gross or a score is. I'm going to use a function you create to discover values for these variables such that the above poem is true. In a file called Limerick.cpp, flesh out the function: double eval_limerick (int dozen, int gross, int score); It should calculate the left hand side (LHS) of the above poem using the supplied values for dozen, gross and score and return the result. The LHS is all the terms before the "is". Thus your function should return the quantitative result of the calculation: . dozen + gross + score + 3 sqrt (4) / 7+ 5 11 But before you jump the gun, make sure to calculate it by hand and confirm that you correctly get the RHS (81). Use parentheses in the above expression to make sure you get the operand groupings that make the poem come true. You are allowed to use the math library function, sqrt (). Note: Yes. I know that you can implement the function using non-intuitive values for these quantities and still pass the test. Just use common sense values. It's more fun that way. Your third
+ Your third miniquest - Etox In a file called Etox.cpp, implement the following function: double etox_5_terms (double x); Page 3 of 7 It should return the value of e' back to its caller. This value should be calculated as the sum of exactly the first five terms in its expansion below. +x²/21 + x²/3! + . where n! is the factorial of n, which is the product of all positive integers at most equal to n. You would therefore return the result of the calculation: 1+*+ *²/21 + x²/3! * *²/4! Keep it simple and don't overcode. No need to write a function for calculating factorials. Simply use numeric literals in their place. In your main() function, prompt the user as follows: 10
Enter a value for x: There must be one space after the colon and no newline. You must accept console input on the same line as the prompt. Now read the user's response into a variable, calculate e' using the function you first defined, print the value on the console followed by a single newline. How well you do in this quest depends a lot on your ability to pay attention to the small details of what is being asked. That's all. As I said, this week's quest is relatively easy. Hopefully you can solve it quickly and move on to the next one. But don't be in a hurry to face the main boss yet. Stri