Question: Question 3 : [ 1 2 . 5 marks ] You are requested to write a python program that does the following: a . Create

Question 3: [12.5 marks]
You are requested to write a python program that does the following:
a. Create Computation class with an initializer that takes n as a parameter.
b. Create a method called Factorial() in the above class that takes n as a parameter, calculates
the factorial of n, and return n's factorial.
c. Create a method called Sum() in the above class that takes n as a parameter, calculates and
returns the sum of the first n integers 1+2+3+dots+n.
d. Instantiate the class after prompting the user to enter an integer, n, and write the necessary
statements to test the above two methods.
 Question 3: [12.5 marks] You are requested to write a python

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!