Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is for Java and needs the code to copy, thank you so much Due: 2/11/2019, 23:59 All submissions should be done on morbius through

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedthis is for Java and needs the code to copy, thank you so much

Due: 2/11/2019, 23:59 All submissions should be done on morbius through the turnin command. See @13 for more details To be completed individually Note: It is important to follow the instructions very closely Make sure you name the files and the classes as requested. The statements to be printed should look exactly like the ones provided. Pay attention to the use of capital letters, punctuation, spaces, etc Diamond Top Name your class DianondTop. Write a program that prints the top half of a diamond shape after receiving some input from the user. More specifically, the program asks for the size of the diamond top and the character that will fill the inside of the diamond area. The characters that will be used for the diamond borders are/and I. Refer to the following sample executions Sample Execution 1. User provides the characters: 9, nine-star.txt Sample Execution 2. User provides the characters: 15, S fifteen-dollar.txt Sample Execution 3. User provides the characters: 25, twentyfive-space.txt Note 1. Remember that in order to print the backslash character ,you need to use an escape sequence 2. Your program should print exactly the same output as that in the sample executions. Pay attention to spaces, capital letters, etc. Chain of Diamonds Name your class DianondChain. Building on the previous exercise, write a program that creates a chain of diamonds of size 3 according to the details described below. Sample execution five-star.txt shows an example of such a diamond chain In the DiamondTop program that you created, you used the maximum rows input from the user as the height of the top half of a diamond. Lets refer to that number as maxTopHeight In the DiamondChain program, you can assume that maxTopHeightil be an odd positive integer greater or equal to 5 The DianondChain program will first print a diamond whose top-half height is maxTopHeight-2. The next diamond will have a top-half height of maxTopHeight. The third diamond will have a top-half height of maxTopHeight 2. For instance, suppose that the naxTopHeight value is 11. Then, the top-half heights of the diamonds that will need to be printed in order will be: 9, 11, 9 Another example, if the naxTopHeight value is 5. Then, the top-half heights of the diamonds that will need to be printed in order will be: 3, 5, 3. Refer to the sample execution five-o.txt as an example .As shown in the samples, all diamonds are aligned around the same vertical axis. Top half of the diamond has a border pattern /and lower half has and/ Note Solutions that do not use repetition (loops) but manually print the desired outcome will not be considered Submission Maximum number of rows for top half of diamond: Character to display inside Maximum number of rows for top half of diamond Character to display inside /$$1 /$$$$S$ /$$SS$SS$ Maximum number of rows for top half of diamond: 25 Character to display inside

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

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions

Question

Language in Context?

Answered: 1 week ago