Write a program to print the diamond shape using user-specified character and size, where the size should
Fantastic news! We've Found the answer you've been seeking!
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 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
Related Book For
Thermodynamics An Engineering Approach
ISBN: 978-0073398174
8th edition
Authors: Yunus A. Cengel, Michael A. Boles
Posted Date: