Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 6- A Triple String Class Understand the Application The assignment is to first create a class called TripleString. TripleString will consist of three private
Assignment 6- A Triple String Class Understand the Application The assignment is to first create a class called TripleString. TripleString will consist of three private member Strings as its basic data. There will be few instance methods to support that data. Once defined, we will use it to instantiate TripleString objects that can be used in our main0 method. In a later assignment, the TripleString class will help us create a more involved application. TripleString will contain three private member Strings as its main data: string1, string2, and string3. We will also add a few public static member such as final int MAX_LEN and MIN_LEN. These represents the maximum and minimum length that our class will allow any of its strings to be set to. We can use these static members in the TripleString method whose job it is to test for valid strings (see below). The Program Spec Class TripleString Spec Private Class Instance Members: String string1 String string2 String string3 All legal strings should be between 1 and 50 characters. As stated in the modules, we never want to see a literal in our methods. So the class should have static members to hold values for the limits described above, as well as default values for any field that is construct-ed using illegal arguments from the client. These are put in the public static section Public Class Static Constants (declare to be final): MIN LEN-1 MAX LEN-50 DEFAULT-STRING = " (undefined)
Step 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