Question: Write a program to print the diamond shape using user-specified character and size, where the size should be an even number greater than or equal
Write a program to print the diamond shape using user-specified character and size, where the size should be an even number greater than or equal to 6. The program will keep asking the user for a valid size. Using a while loop and nested for loop. For example:
Enter a letter: A
Enter a size (even number no less than 6): 5
Enter a size (even number no less than 6): 9
Enter a size (even number no less than 6): 6
AA
AAAA
AAAAAA
AAAAAA
AAAA
AA
Compile command
javac PrintCustomizedDiamond.java -Xlint:all -encoding utf-8
We will use this command to compile your code
Step by Step Solution
3.40 Rating (156 Votes )
There are 3 Steps involved in it
To solve this problem we need to create a Java program that continually prompts the user for a valid ... View full answer
Get step-by-step solutions from verified subject matter experts
