Computer People v.ADTHelp
#1
Computer People v.ADTHelp
:thinking: Okay, so we were taught how to do ADT definitions, yet I'm still totally confused by it. My book doesn't describe it at all and my teacher is out of the office for today.
Does anyone here know how to describe it for me? I'm really confused on what to do.
In my homework it says:
So they just basically told you two ways to assign 3 to arr[2].
Then:
Thats where I'm confused about even what they want and how to put it into ADT..
Anyone have any idea about what I'm talking about or that could help me out a little?
Does anyone here know how to describe it for me? I'm really confused on what to do.
In my homework it says:
Code:
// value of arr[2] is fetched from the array and multiplied by 3 x = arr[2] *3; arr[2] = 3; //3 is stored as the new value of arr[2]
Then:
Give an ADT representation of an array that described two versions of the [] operator, corresponding to the fetch and store operations. Give examples using array index notation arr[i] rather than the formal function prototype for the [] operator.
Anyone have any idea about what I'm talking about or that could help me out a little?
#3
But I need to put it into ADT definition. Heres an example:
But I'm not sure what operations there would be and all that bs.
Code:
ADT time24 DATA: hour is an integer (0-23) storing the current hour minute is an integer (0-60) storing the current minute OPERATIONS: getHour() returns current hour getMinute() returns current minute addTime(m) incrememnt time by m minutes pre: m >= 0 Post: current time is increased
But I'm not sure what operations there would be and all that bs.