Enable a user to enter the number of values to be used

Assignment Help Computer Engineering
Reference no: EM132095262

Please find the required program and output below: Please find the comments against each line for the description:

import math # This will import math module

def calculate_pi(): # function that return value of m(i) for input i
sum = 0
for j in range(0,12): #iterate loop till 12 times
sum = sum + (math.pow(-1,j)/((2*j)+1)) #summation of the Leibniz series
pi = 4 * sum
return float(pi) #return number

#print the output
print ("pi = ", calculate_pi())

Modify the program above program so that it contains a class related to the Leibniz formula.

Add additional methods to the class for doing calculations based on the pi attribute.

Divide your program into two modules - one which contains your class and another which demonstrates the class methods.

Enable a user to enter the number of values to be used in the pi calculation.

Be sure your program contains exception handling and has been debugged. It should also launch and be usable under Windows 10 as described in class.

Reference no: EM132095262

Questions Cloud

Consider selling the rights to the product : What must the selling price be for the company to consider selling the rights to the product? If required, round your answers to 2 decimal places.
Draw a communication diagram of a captive portal : Draw a communication/collaboration diagram of a Captive portal that will focus on the ability to: add a device, remove a device, detect a device.
Making a bad decision at work : Tell about a time you knew you were making a bad decision at work and which step of the six steps you started to fail.
Draw the er diagram to show the relationship : The Grand Bay Family Fun organization (GBFF) wants a system to help it manage a series of cutting-edge road-rally events.
Enable a user to enter the number of values to be used : Divide your program into two modules - one which contains your class and another which demonstrates the class methods.
How long should the algorithm take to execute : How long (in seconds) should the algorithm take to execute on a parallel machine made of 8 2.6 GHz processors?
Write an open frameworks program to generate a random : Write an open frameworks program to generate a random each to walk. At step, toss a coin determine if you move right/left or up down.
What are the maximum and minimum real numbers can be : What are the maximum and minimum real numbers can be represented by IEEE 754 double precision number?
Consider a clinic management system : Considering a clinic management system. Patient can make and cancel appointment, doctor can request medication for patient.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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