$10
Assignment 2
Intro to Software Systems
CSCI-C212/A592 – Intro to Software Systems
Instructions:
• Review the requirements given below and complete all three parts from below. Please
submit all files through Canvas.
• The grading scheme is provided on Canvas. Be sure that your code includes everything
required in the grading rubric.
Part 1:
1. Create a class that will have the following static methods as exercises.
a. Public static boolean isSorted(String s)
i. Checks whether a string is in alphabetical order. Each letter in the string
must not precede any letters that appear before it in the alphabet.
e.g., bdfjk is in alphabetical order
bdcfjk is not
ii. It would be a good idea to look at the String and Character API in the Java
docs for what methods to use. Specifically that Character.compare()
methods, and combine this with the String charAt() method.
b. public static void border(int N, int M)
i. Using a double nested for loop, print a NxM rectangle where the border
is filled with + symbol and the center has o. Rest of the rectangle is blank.
(Note: The spacing is not symmetrical in MS Word with line vs space
differences but it will be when just printing + symbols & spaces when
used in your Java program)
+ + + + + + + + + + + + +
+ +
+ o +
+ +
+ + + + + + + + + + + + +
c. public static void N (int n)
i. Using a double nested loop (a for loop and while loop), print an ‘N’
of asterisks where n is the height (or number of asterisks in vertical
direction). You can choose any appropriate value for width.