Computers and Technology
For the following code and using the help() function of the Atm_Moon class, what method(s) are inherited from Planet?class SolarSystem: def __init__(self, name): self.name = 'Sun' def show_ss_name(self): return f'The only star in our solar system is the {self.name}' class Planet(SolarSystem): def __init__(self, name): self.name = name self.orbits_a_star = True self.mass_enough_to_form_a_sphere = True self.cleared_neighborhood_around_orbit = True def show_name(self): return f'I am planet {self.name}' class Atm_Moon(Planet): def __init__(self, name, atm_type, num_Moons): super().__init__(name) self.moons = num_Moons self.atmosphere = atm_type def show_moons(self): return f'I have {self.moons} moons' def show_atmosphere(self): return f'My atmosphere is mostly {self.atmosphere}' P4wAM = Atm_Moon('Mars', 'carbon dioxide',2)A) self.moons = num_Moons self.atmosphere = atm_typeB) __init__(self, name, atm_type, num_Moons)C) __init__(self, name, atm_type, num_Moons) self.moons = num_Moons self.atmosphere = atm_typeD) show_name(self)
Assign finalPopulation with the population size given an initial population, population growth rate, and number of years. The population growth is calculated by: Final population = Initial population* (1 + Rate of growth)Number of years Your Function B Save C Reset I a MATLAB Documentation 1 % Create a function name "CalculatePopulation (O" to calculate the population. 3 function final Population = CalculatePopulation (initialPopulation, growthRate, numberYears ) 5 % Assign final Population with the population size given an 7 % initial population, population growth rate , and number of years 9 finalPopulation = initiatPopulation * ((1 + growthRate).numberYears); 10 11 12 13 % Call the function "calculatePopulation()" to findd the final population. 14 15 S=sprintf('Final population = f ", CalculatePopulation (10000, 0.06, 20) ); 16 17% Display the final population. 18 19 disp (S) 21 % Call the function "calculatePopulation()" to findd the final population. 23 S=sprintf('Final population = f ", CalculatePopulation (10000, 0.40, 10)); 25 % Display the final population.