Question: Write a python module with the following functions. Note: you do not need to write the exceptions file, you only need to raise the exceptions
Write a python module with the following functions. Note: you do not need to write the exceptions file, you only need to raise the exceptions where it tells you to. Name of the exceptions is provided. See below image for how to proceed with this question.

from CurveADT import *
from SeqServices import *
class Data:
MAX_SIZE = 10
S = []
Z = []
def init():
Data.S = []
Data.Z = []
def add(s,z):
if len(Data.S) == Data.MAX_SIZE:
raise Full("Maximum size exceeded")
Data.S = Data.S + [s]
if (len(Z) > 0 && z
raise IndepVarNotAscending("Independent variable not ascending")
Data.Z = Data.Z + [z]
Access Routine Semantics Data init transition: S, Z :=, . exception: none Data add(s,z) . transition : S, Z := SI , Zll . exception : ere:= (IS|-MAXLSIZE Full I IZl > 0ha-21Zl-1 IndepVarNotAscending) Data getC(i) output: out Sli . exception: ere:-(-(0 , . exception: none Data add(s,z) . transition : S, Z := SI , Zll . exception : ere:= (IS|-MAXLSIZE Full I IZl > 0ha-21Zl-1 IndepVarNotAscending) Data getC(i) output: out Sli . exception: ere:-(-(0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
