Question: 1 . 9 : Diamond Write an application that prints the following diamond shape. Don't print any unneeded characters. ( That is , don't make
: Diamond
Write an application that prints the following diamond shape. Don't
print any unneeded characters. That is don't make any character
string longer than it has to beYou may need to scroll to see everything.
SAMPLE RUN #: java Diamond
:::
public class Diamond
public static void mainString args
int ;
First half of diamond
for int ;; i
Print spaces on left side of each row
for int ;;
System.out.print;
Print stars on each row
for int ;;
System.out.print;
System.out.println;
Second half of diamond
for int ; ; i
Print spaces on left side of each row
for int ;;
System.out.print;
Print stars on each row
for int ;;
System.out.print;
System.out.println;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
