Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We were asked to design a program that prints a diamond to the console in Java. Please assist me with the code for this Java

We were asked to design a program that prints a diamond to the console in Java. Please assist me with the code for this Java program. These are the instructions:

Print a matrix of chars with 25 rows and 79 columns with parameters x and y. It comprises of the "=" character with every 10th column and row numbered. There should be a diamond created in the middle of the matrix comprised of "$" characters in the center of the matrix.

The diamond shape should be centered at row x and column y.

The function must take 3 integers as input: the size of the diamond, x and y. This will indicate the size of the diamond and the position of the central "$".

The output should look exactly like the image below:

image text in transcribed

The image below contains the instructions in detail:

image text in transcribed

11 11 iii llll!! Test1 For sizeofShape = 6, xCentre = 30, yCentre = 9, your program must produce the following output EXACTLY (note the "" and "2" in the first column of row 10 and 20 respectively): iiiiiiii iiiiiiiiiiii II !!!!! iiiiii IIIIIIIIII HHHH Il !!!!!! iiiiiiiiiiii ====2======= ====2=========3========= ====2=========3========= ====2=========$========= ====2========$3$========4 ====2=======$=3=$======= ====2======$==3==$====== =2=====$===3===$===== ====2====$====$====$==== =2=====$===3===$===== =2======$==3==$====== 2=======$=3=$======= =======$3$======== ========$========= ======3======== =====3===== ==== ====== ======= ========3========= =====3= =5=========6======== =5=========6========= ====5=========6========= 7= =====5=========6=========7== =====5=========6=========7= =====5=========6=========7== ====6=========7 = =5=========6======== =5=========6=========7 = =5=========6========= =5=========6======== +5=========6======== =5=========6========= =5=========6======== -5=========6======== =5=========6======= -5=========6======== =======6======== =5=========6======== !!!!!!!!!!!!!! II !!!!!!!!!! iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii IIII!!!!!!!!!!!!!!!!!!!!!! ii I ii iiiiiiiiiiiiiiii !!!!!!!!!!iiii!!iiiiii lllllllllllllllllllllllIlIlIlIlIllllllllllll .. !!!!! NNNNNNNNNNN iiiiiiiiiii !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!! iiiiii II IN iiiiiiiiiiii iii !!!!!! IT !! !! !! !! !! !! !! !! !! !! iiiiiill iiiiiiiiiiii Iiiiiiiiiiiiiiiii i liilll!!!! !!!!!!!!!!! iiiiiiii II liii iiiiiiii III liiiiiiiiiii iiiiiiiiiiii II III lllllllliiiiiiiiiiii iiiiiiiiiiiiiiii II !!!!!!!! illllllllllllliiiiiiiiii ========9======= ========9============= =======9======= iiiiiiiiiiiiiiii 1 ====2= =3= ======3= =5=========6=========7= ==6======= -=6====== iiii SEE NEXT PAGE FOR ANOTHER TEST Problem ALG005b: Print Diamond on Background Screen Write a Class called ProblemALGO05b to do the following: Inputs 1. Your program must take in 3 parameters: int sizeofShape (>= 2 and = 1 and = 1 and

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

The nature and importance of the global marketplace.

Answered: 1 week ago