Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 5 (10 MARKS) The String class is provided in the Java library. Provide your own implementation for the following methods (name the newclass MyString2):

image text in transcribed
image text in transcribed
QUESTION 5 (10 MARKS) The String class is provided in the Java library. Provide your own implementation for the following methods (name the newclass MyString2): public MyString2(String s); public int compare(String s); public MyString2 substring(int begin); publie MyString2 toUpperCase(); public char[] toChars(): public static MyString2 valueOf(boolean b); Write a test program to show that all your methods work properly. Assignment Marking Scheme 1/3 marks - Proper documentation and readability of the program - Header documentation includes: Course Name, Student name, Student number, Assignment number and date completed. - There must be a general description of the purpose of the method/function used. - Appropriate comments: where necessary, within the method function, there should be inline comment descriptions of declaration of variables, statements, control structures and etc. to improve the readability of the program. - Properly named variables: well-chosen descriptive variable names make it easier for readers or analysts to understand what the intent of the variable or what the system is doing. Example: payRate =5.0 as oppose to x=5. Properly named variable can also avoid naming collision. - Properly named method/function: method name should imply the intent of the method and what the method is doing. - All identifier names should follow standard naming convention in Java. - Proper indentation and spacing in program improves readability. 1/3 marks - Programming language knowledge and skills - Demonstrate the use of concepts in Java such as: object-orientation, interface, package, class, exception and etc., learnt in the class. - Demonstrate the use of basic programming concepts. - Use of features not presented in the class must be relevant and properly commented. - Program shows a clear understanding of programming concepts in general. - Good programming practices and skills 1/3 marks - Program compile and run with correct output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

Show the properties and structure of allotropes of carbon.

Answered: 1 week ago