Starting from:
$35

$29

Project 10 MyString Class Solution

Purpose: The purpose for this project is to reinforce the knowledge from Chapter 10 of the textbook.




The students will learn how to write a user defined class.




Project Objectives:




Apply UML design on user definedclass



Write overloaded constructors of a class
Write customer methods of the class (Other than get and set methods)



Problem description:




The String class is provided by java library. Write your own String class based on the following UML diagram. No built-­‐in String, StringBuffer related classes are allowed.







MyString

-­‐data: char[]




+MyString(chars: char[])

+charAt(i: int) : char

+length() : int

+substring(begin: int, end: int) : MyString

+toLowerCase() : MyString

+equals(other: MyString) : Boolean

+valueOf(i: int) : MyString




All methods have the same functionality as the corresponding methods in String class. You shall provide a main function to test all methods in MyString class.




Due date will be announced on Blackboard.

More products