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:-(-(0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started