Comparison of the computed and expected values

Assignment Help Basic Computer Science
Reference no: EM131860206

C Programming:

Assignment: an algorithms and a program to determine which of a sequence of integers is a "perfect number" and then compute the square root (√) of those perfect numbers. The calculation of the square root (√) will be done as the sum of an infinite series:

∞         

√S = ∑ xn+1 = 1/2(xn + S/xn)

n=0

where x0 is the initial "guess"

Use only the Babylonian method (above) for your square root (√), not the C math library function.

Output: Output will include all of the perfect numbers between [1-10000], along with a list of their factors to confirm the factors sum to the number. For each perfect number, the output will also include your computed value for the square root of that number, the expected value using sqrt(), and the number of terms (iterations) it took to reach sixteen decimal-place accuracy.

Results should be displayed so as to allow easy comparison of the computed and expected values. Labels should be included, where appropriate. Your output would look something like:

Perfect number: 6 = 1 + 2 + 3;

Expected sqrt() of 6     = 2.4494897...

Computed square root of 6 = 2.449489742783...

Reached in 8 iterations.

Note: output above is just an example...

Input: No user input.

Requirements

Efficiency should always be considered. Alway choose the most appropriate loop/decision structures and variable/constant types. Use of appropriate constants expected. Functions should focus on a single task and do it well - and use as many functions as dictated by your design. Main() should only be the high-level tasks.

Use allowed Standard C libraries as required - and document. You may also find DBL_EPSILON useful.

Reference no: EM131860206

Questions Cloud

What is preemption : 1) What is preemption? What is its purpose? 2) What is swapping? What is its purpose?
Draft a benefits and compensation plan for your organization : PLO WC (Written Communication) Constructs written communications that clearly articulates and promotes business ideas, arguments, or solutions.
Console in the developer tools : Use the Console in the Developer Tools in the Chrome browser to create the"function myNumber(s)" that converts a string into the number.
How would you incorporate diversity in designing a team : Think about how to build teams in terms of designing the task, selecting the people, and then, managing their relationships.
Comparison of the computed and expected values : Results should be displayed so as to allow easy comparison of the computed and expected values. Labels should be included, where appropriate.
Show expectations of growth and potential profit : You are applying for a managerial position at an innovative and rapidly growing company. This is a dynamic company that wants an individual who adds value.
Describe the process of conducting the dismissal meeting : Imagine that you are an office manager and you have been tasked with the job of coordinating and heading the dismissal meeting for an employee layoff.
Why did you select this as the most appropriate design : Why did you select this as the most appropriate design? What are the advantages, disadvantages, and contingencies of the redesign selected?
Evaluating a direct communication from a third party : "Confirmation is the process of obtaining and evaluating a direct communication from a third party in response to a request for information about a particular.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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