Question: In c++ With my code please. int main() { int num; int num2; int num3; int low; int top; int low2; int top2; int totalOne;

In c++
With my code please.
 In c++ With my code please. int main() { int num;
int main()
{
int num;
int num2;
int num3;
int low;
int top;
int low2;
int top2;
int totalOne;
int totalTwo;
int count = 0;
int total = 0;
double avg;
cout
cout
num = getInt(1, 9000000, "Enter a positive integer number between 1 and 90\00000: " );
for(int i =1; i*i
{
low = i;
}
top = low + 1;
totalOne = top * top;
totalTwo = low * low;
top2 = abs(num - totalOne);
low2 = abs(num - totalTwo);
if(top2
{
cout
num2 = num % top;
while(num % top != 0)
{
count++;
num3 = num / top;
avg = (double)(num3 + top) / 2;
total = (avg * avg);
if(total != num)
3. squareRoot.cpp (20 points) Write a program that will find the square root of a positive integer number usin following website. If you used a different technique, you will receive a zero nique com son step Make your program display the information shown in the following sample runs. Requrement: Put all your code in the main function 0s). Test your program as the following You must use getInt(0 in input.h to reject bad inputs. Good inputs are from 1 through 9000000 (6 kslot teempress cs111 lec spr181$ /a.out Enter a positive integer number that you want to find the square root for: -5 Enter a positive integer number between 1 and 9000000: 0 Enter a positive integer number between 1 and 9000800: 9000001 Enter a positive integer number between 1 and 9000000: 8 Start at 3 The square root of 8 is 2 The square of the square root is 8 rejected by getIntO If num is 8, top 3 and bottom is 2. Top is closer therefore start calculation in step 2 with top. ks Lotteempress cs111 lecspr181 ./a.out Enter a positive integer number that you want to find the square root for: 10 Start at 3 The square roo The square of the square root is 10 If num is 10, top 4 and bottom is 3. Bottom is closer therefore start calculation in step 2 with bottom. kslot teempress cs111 lec spr181s ./a.out Enter a positive integer number that you want to find the square root for: 25 5 is the square root of 25 ks lot teempress cs111 lec spr181 /a.out Enter a positive integer number that you want to find the square root for: 777 Start at 28 The square root of 777 is 27.8747 The square of the square root is 777 [ks lot teempress cs111 lec spr181$ /a.out Enter a positive integer number that you want to find the square root for: 1 1 is the square root of 1 kslot taempress cs111 lec spr181s./a.out Enter a positive integer number that you want to find the square root for: 9000000 (6 0s) 3000 is the square root of 900000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!