Determine whether the user entered a valid number

Assignment Help Business Management
Reference no: EM132197638

Determining the Square Root of a Number Via Recursion For this programming project you will develop an recursive function to ?nd the square root of a number. The function should the number for which we are determining the square root and any other arguments you deem necessary. The recursion should terminate when the calculated square root produces a squared value within 0.001 of the value we are ?nding the square root of.

The following is required:

1. The user should be prompted to input a positive number.

2. The program should check to determine whether the user entered a valid number, i.e. -4.0 doesn't work.

3. The program should call a function called: recursive sqrt(argument, argument, ....) .

4. The recursive square root function should continue to call itself until the value calculated for the square root when squared is within 0.001 of the value for which we are calculating the square root.

5. Your calculated value of the square root should be printed to the screen.

6. The program should then use math.sqrt to calculate the value of the square root and display this as well.

7. How did your calculated square root compare to the value calculated with math.sqrt.

8. Submit your program within a ?le named: sqrt.txt.

Reference no: EM132197638

Questions Cloud

Explain how information is sent across the internet : Your computer is connected to the Internet. Briefly explain how information is sent across the Internet. Be sure to discuss TCP/IP and packets.
File exchange in your group on the blackboard : Your team will use Group Tools such as Group Discussion Board and File Exchange in your group on the Blackboard for this assignment problem.
Provide explanation that distinguishes information from data : Provide explanation that distinguishes information from data. Provide detail explanation about how data is made analytics ready and why this is important.
Lifelong learning is encouraging personal and professional : Determine the ways in which lifelong learning is encouraging personal and professional in the contexts of your life.
Determine whether the user entered a valid number : 1. The user should be prompted to input a positive number.
After covering word-excel and powerpoint : After covering Word, Excel, and PowerPoint. In which program do you feel you are strongest? What do you think you could do to bolster your strength in the other
Explain the meanings associated with the programming : Briefly explain the "meanings" associated with the programming language names C++, Lisp, Prolog.
What language supported data structure : Lists are also supported in Prolog. In C and C++, a list can be implemented using what language supported data structure?
What is the present value of the patent : A company is expecting sustained growth for the next 15 years due to a patent it has successfully defended. Next year the company is expected to bring.

Reviews

Write a Review

Business Management Questions & Answers

  Approach for increasing the amount of innovation

Create one innovative approach for increasing the amount of innovation within a large company. Describe this approach in detail and explain how companies.

  What is strategic value of companys corporate sustainability

How has corporate sustainability been incorporated in the company's competitive and supplemental strategies? What is the strategic value of the company's corporate sustainability efforts?

  Planning to set-aside to complete

A lower grade is the opportunity cost of increased leisure or increased income. Also identify your position point on the PPF, and indicate how many study hours you're planning to set-aside to complete your coursework in this class.

  Contingency plan around risk assessment

Would help a business to form a sound contingency plan around those risk.

  How would you define the activity level of a railroad

For purposes of the theory of accidents, how would you define the activity level of a railroad? An airline? For some activities, the level relevant.

  Impact of language on critical thinkingdescribe the impact

impact of language on critical thinkingdescribe the impact of language on critical thinking and decision making. what

  Explain what events could shift the demand of that labor

Develop presentation to be presented to CEO's executive committee that addresses how your chosen organization determines what quantity of labor to demand and what events could shift the demand and supply of that labor.

  Describe decision-making scenario using business experience

Describe a decision-making scenario using your business experience, personal decision making or cited journal article. Explain the incentives in this scenario.

  Concern for health administrators today

When you hear the term taxation, you might assume it is a concern for accountants, but it is also a concern for health administrators today.

  Select the model of organizational decision making

Select the model of organizational decision making that is most appealing to you and explain why. Apply it to a scenario that you have been a part of, or create a fictitious scenario in which you play a role

  Did your understanding of the writing process improve

Did your understanding of the writing process improve? How does this course apply to your professional life - and your non-professional life?

  Reply on stereotypes than to enter into a relationship

"Is it better to reply on stereotypes than to enter into a relationship with someone from another culture without any idea of what they believe in."

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd