CMPS 200
Assignment 2
Problem 1: Method Repitition
Write a program that prints the below output, but make sure you use proper methods creation,
full grade will be given based on methods creation and usage.
Output:
=== Start of Messages ===
This is message number 1: 2
This is message number 2: 4
This is message number 3: 6
This is message number 4: 8
This is message number 5: 10
=== End of Messages ===
Problem 2: Scalable Rectangle Using Constants and Methods
Write a program that prints the below resizable rectangle, but make sure you use proper methods
and class constants.
Output: (for width = 8, height = 4)
********
********
********
********
Problem 3: Scalable Triangle with Class Constant
Write a program that prints the below resizable triangle, but make sure you use proper class
constants.
Output: (for size = 5)
*
**
***
****
*****
Problem 4: Number Pyramid
Write a program that prints the below resizable pyramid, but make sure you use proper class
constants and methods.
Output: (for size = 5)
1
121
12321
1234321
123454321
Problem 5: Scalable Hourglass
Write a program that prints the below resizable hourglass, but make sure you use proper class
constants and methods.
Output: (for size = 4)
*********
*******
*****
***
*
***
*****
*******
*********
Problem 6: Double Triangle Pattern
Write a program that prints the below resizable double triangles, but make sure you use proper
class constants and methods.
Output: (for size = 4)
*
*
**
**
***
***
********