Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Create a program to code the bisection method. Use the example f(x) = x3 – 3x – 4 with your left starting value of 1 and your right starting value of 3. Your program should end when |fmid|

1 answer below »
Create a program to code the bisection method. Use the example f(x) = x3 – 3x – 4 with your left starting value of 1 and your right starting value of 3. Your program should end when |fmid| < TOL where TOL = 0.01. Count how many times it took for the bisection to run before it finishes with your answer.To evaluate f(x) you must use a function call.

For this week's discussion, please write a runnable example code showing inheritance and explain your code.
Example (For reference, doesn't have to be similar.)
CODE
class Dog:
  def __init__(self, first_name, fav_place="Doggy Park"):
    self.first_name = first_name
    self.fav_place = fav_place
  
  def bark(self):
    print("WOOF WOOF!!!")
class Puppy(Dog):
  def __init__(self, first_name, fav_place="Living Room", fav_food="puppy snack"):
    self.first_name = first_name
    self.fav_place = fav_place
    self.fav_food = fav_food
    
  def bark(self):
    print("woof woof")
spot = Puppy("Spot")
print(spot.first_name + " says ", end="")
spot.bark()
champ = Dog("Champ")
print(champ.first_name + " says ", end="")
champ.bark()
OUTPUT
Spot says woof woof
Champ says WOOF WOOF!!!
EXPLANATION
Dog is the parent class and Puppy is the child class. The parent class is passed as a parameter into the child class.
Puppy class is ove
iding bark method from the parent class to have smaller barks. 
spot is our Puppy object. champ is our Dog object.
When printed, spot barks with lower cases and champ barks with all caps.
How will this be graded?
If you submitted something before the due date: +2
If you included the runnable example code: +4
If you included an explanation of what's happening in your code: +2
If you commented on 2 other student's posting: +2
Out of a total of 10 points.
Answered 16 days After Jul 23, 2021

Solution

Rajashekar answered on Aug 09 2021
158 Votes
For this week's discussion, please write a runnable example code showing inheritance and explain your code.
Example (For reference, doesn't have to be similar.)
CODE
class Dog:
  def __init__(self, first_name, fav_place="Doggy Park"):
    self.first_name = first_name
    self.fav_place = fav_place
  
  def bark(self):
    print("WOOF WOOF!!!")
class Puppy(Dog):
  def __init__(self, first_name, fav_place="Living Room", fav_food="puppy snack"):
    self.first_name = first_name
    self.fav_place = fav_place
    self.fav_food = fav_food
    
  def bark(self):
    print("woof woof")
spot = Puppy("Spot")
print(spot.first_name + " says ", end="")
spot.bark()
champ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here