Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

We were asked to design a program that prints an X 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. It comprises of the "=" character with every 10th column and row numbered. There should be an X created in the middle of the matrix comprised of "$" characters in the center of the matrix.

The X shape should be centered at row 13 and column 40.

The function must take a single integer as input. This will indicate how many "$" are in the X on either side of the middle "$".

The output should look exactly like the image below: image text in transcribedThe image below contains the instructions in details:

image text in transcribed

Example: if input is 5 (i.e. size OfX = 5), your program should produce EXACTLY the following output (note the "1" and "2" in the first column of row 10 and 20 respectively): =========1=========2=========3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= =========1==================3=========4=========5=========6=========7========= =========1=========2=========3====$====4====$====5=========6=========7========= =========1=========2=========3=====$===4===$=====5=========6=========7========= 1========1=========2=========3======$==4==$======5=========6=========7========= =========1=========2=========3=======$=4=$=======5=========6=========7========= =========1=========2=========3========$4$========5=========6=========7========= =========1==================3=========$=========5=========6=========7========= =========1=========2=========3========$4$========5=========6=========7========= =========1==================3=======$=4=$=======5=========6=========7========= =========1=========2=========3======$==4==$======5=========6=========7========= =========1=========2=========3=====$===4===$=====5=========6=========7========= =========1==================3====$====4====$====5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= 2========1==================3=========4=========5= =======6=========7========= =========1==================3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= =========1==================3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= =========1=========2=========3=========4=========5=========6=========7========= NOTE: For this problem, please make sure you write a "main" method that calls your code, and makes sure that it is producing the correct output. In your "main" method, please do NOT write code to read input from the console - you can simply write a "main" method that passes in the relevant required parameter/s. Print the Letter X on a Background Console Write a Class called ProblemA003 that output's the following shape (which is the letter X using "$" symbols on a background console): . . . . Simply output to the console (using system.out) Assume a console screen of 25 lines deep and 79 chars wide (see below for the console - it comprises "=" character, with relevant numbering for every 10th column and row. The shape must be centered on this console screen i.e. the middle "$" should be in row 13, column 40 Take as an input to the program a single int parameter (which you can name size OfX). This parameter will indicate how many "$" are in the X on either side of the middle "$". You can simply pass this parameter in via the "main" method. For a clearer description of the parameter size Ofx, see the example below when size OfX = 5 Note: parameter size OfX must only take on values of 1-9 (inclusive of 1 and 9). Of course, the bigger the value of size Ofx, the bigger the size of the X your program must produce. Try to stay calm and think clearly (do NOT panic if this takes you longer than you think it should) Above all, have fun!! . . SEE NEXT PAGE

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

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

During deposition, what posture should an expert witness display?

Answered: 1 week ago

Question

What is the role of the Joint Commission in health care?

Answered: 1 week ago