Question: / / CAB 3 0 1 - Assignment 2 / / Tool ADT specification using System; using System.Text; / / Invariants: Name = ! null
CAB Assignment
Tool ADT specification
using System;
using System.Text;
Invariants: Namenull and Number
public interface ITool
get the name of this tool
string Name get the name of this tool
get;
get the number of this tool currently available in the tool library
int Number
get;
check if a person is in the borrower list of this tool is holding this tool
Precondition: nil
Postcondition: return true if the person is in the borrower list; return false otherwise. The information about this tool remains unchanged.
bool IsInBorrowerListstring personName;
add a person to the borrower list
Precondition: the borrower is not in the borrower list and Number
Postcondition: the borrower is added to the borrower list and New Number Old Number
bool AddBorrowerstring personName;
remove a borrower from the borrower list
Precondition: the borrower is in the borrower list
Postcondition: the borrower is removed from the borrower list and and new Number old Number
bool RemoveBorrowerstring personName;
Compare this tool's name to another tool's name
Precondition: anotherTool null
Postcondition: return if this tool's name is less than another tool's name by alphabetical order
return if this tool's name equals to another tool's name by alphabetical order
return if this tool's name is greater than another tool's name by alphabetical order
int CompareToITool anotherTool;
Return a string containing the name and the number of this tool currently in the tool library
Precondition: nil
Postcondition: A string containing the name and number of this tool is returned
string ToString;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
