Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE READ We are working on making simple C++ programs using Putty I need help understanding how to do the problem below so that I
PLEASE READ We are working on making simple C++ programs using Putty I need help understanding how to do the problem below so that I can do others like it on my own. We have been working on using switch, break and bool this week. Thank you in advance! Here is the problem given: We are going to make a series of programs that will lead to calculation of the square root of an integer number. As part of this assignment, we are going to make a small piece that will go inside a big program later. Think about the square root of 10. The square root of 10 is between 3 and 4. The user will enter those three numbers (e.g. num (10), top (4) and bottom (3)). Between top and bottom, which number is closer to the square root of num? If num is a perfect square, top has the square root of num. See the example for the square root of 16 on the next page. You may NOT use sqrt(num) (the square root function) in cmath.h. You are preparing to create this function frorm scratch. Test your program using the following 4 test cases Num- 8 Top 3 Bottom -2 The user inputs these three values. Top is closer to the square root of 8. blank line Num- 10 Top 4 Bottom -3 Bottom is closer to the square root of 10. Num = 25 Top 5 Bottom 4 Top is closer to the square root of 25 Num = 777 Top 28 Bottom 27 Top is closer to the square root of 777
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