Check05E (TS = 22)

Download the jar file typex.jar (the file has been updated on October 17, 8:30 am) and save it in the same directory as type.jar. typex.jar should already be part of your CLASSPATH.

Create the program named Check05E that prompts the user by printing

Enter an integer >= 4: 
The integer should be entered on the same line (see sample runs below). You may assume that the user always enters an integer.

As long as the user enters an integer smaller than 4, reprompt the user by printing

Enter an integer >= 4: 
again.

Print an N of height h, where h is the integer greater than or equal to 4 entered by the user (see sample runs below).

Here is a sample run (where the user has entered 6)

Enter an integer >= 4: 6
*    *
**   *
* *  *
*  * *
*   **
*    *

Here is a sample run (where the user has entered -1, 0, 3 and 4)

Enter an integer >= 4: -1
Enter an integer >= 4: 0
Enter an integer >= 4: 3
Enter an integer >= 4: 4
*  *
** *
* **
*  *

To check whether your code is correct, you can use eCheck. You are advised to use the offline mode first. Once your code is correct (worth 3 marks) and you are happy with your style (worth 2 marks), you can switch to the online mode and submit your solution. For style, you should adhere to the code conventions described in Appendix C of the textbook.