CST8110 Lab Exercise 6 – for statement

$30.00

Category: Tags: , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (5 votes)

Write a program (method main) to solve the following problem: We want to
display a box of stars of a given length and width.
BONUS: add editing so that only length of 0-20 can be entered, and width
can only be 0-20. (Don’t need to add handling for alphabetic entry yet).
Example 1: (blue is entered by user)
Enter the length: 6
Enter the width: 4
****
****
****
****
****
****
Example 2:
Enter the length: 21
Invalid – enter length between 1 and 20: -1
Invalid – enter length between 1 and 20: 1
Enter the width: 21
Invalid – enter width between 1 and 20: 2
**