Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

having trouble finding someone to help me with the requirements of this specific problem. The answers I keep getting seem to be copy and pasted

having trouble finding someone to help me with the requirements of this specific problem. The answers I keep getting seem to be copy and pasted from somewhere else, filled with errrors, and does not focus on the exact problem/requirements I am seeking help for at all....
I am asking if you don't know the answer or you are just going to copy/paste an answer to this problem without actually reading it... to leave it for someone who can answer it (sorry, I am just frustrated I keep getting the same copy and pasted wrong answer every time I try to get a solution to this specific problem).
That being said, in the below pics (1-3) is the program I wrote (java).
The 4th pic is the feedback I got from the instructor about how to rewrite the program.
The last pics below are the actual assignment. Please note, the butterfly design is supposed to be "pinched" in the middle, and the lower half of the butterfly is half the size of the top.
Can I please see the whole program written out correctly, as explained in the assignment and taking into account the feedback I got from my instructor??
Thank you sooo much!!!
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
I would just like to see the below program written in java, taking into account the directions my instructor gave me that are in the top pic:
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Assignme import java.util.Scanner; // defining a public class Butterflyassignment public class Butterflyassignment { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); int rows; int count = : 0; String choice; // printing the starting message to the screen System.out.println( "I will draw a butterfly for the size you enter."); System.out.println("Afterward, if you want another, answer Y or y." ); // making the code draw butterflies as long as the user // enters y or Y to the question asked after drawing each // one do { count++; System.out.print("Enter desired butterfly size: "); rows = keyboard.nextInt(); // taking the size continuously until the user does not // enter the size as 4 or more while ( rows = :--) { System.out.print(""); for (int k = 1;k = 1; I--) { System.out.print(""); } System.out.println(); } } } The middle line should be directly constructed to be "pinched" on each side. The bottom part should count from the size - 2 down to zero by 2, then for even sizes, add the display of the last line with single stars on each end. Try to implement this without the drawButterfly method. Let me know if this helps. Programming Assignment Repetition In this project you will write an application that will display a butterfly according to the requirements below. All of the butterfly shapes displayed by the program must be geometrically similar shapes, i.e., uniformly scaled, and match those shown in the requirements and described in the paragraphs below. While there could be endless ways to actually "draw" a butterfly, all shapes drawn by your application must resemble the ones shown below exactly as described and shown. First, you should make sure you know how to draw using nested for-loops that display one character per print statement. To bolova.understand The butterfly drawing application will display an introduction (see examples of execution below) and then ask the user for the size of the first butterfly to be drawn. The minimum size is four (4). The application MUST use a while loop to continue asking the user for the size as long as the entered size is less than the minimum (see examples of execution below). As you learned from the two examples above, an input like the butterfly size gives you all of the information you will need to calculate the numbers of asterisks and spaces needed for each line. The input also drives the number of lines in the figure: each butterfly has size lines from the top line through the indented or "pinched" line, then size/2 lines after that. If you did not do so, study the above examples to see how they determine numbers of characters, spaces, and lines using just one input or named constant After accurately drawing the butterfly, After accurately drawing the butterfly, the program must ask the user if they want another butterfly to be drawn. Accept a string as input using the Scanner's next() method (NOT nextLine()). The user must indicate the desire to draw another butterfly by entering either Yor y - either case should be allowed by the application. Any other input will be considered a negative answer and the program will then terminate by printing the termination message shown in the example executions below. Note well that the termination message must include the number of butterflies that were drawn for the user during the entire execution of the program. Note that the word, butterfly, is displayed in its singular when the number drawn was one (1), otherwise the word is displayed in the plural. (Hint: the conditional operator is good for getting this done!) Also, note that your code should be able to display as many butterflies the user chooses, many butterflies as the user chooses, and any sizes, including large and small sizes not shown in these example executions. Here are two separate executions of your program. Make sure your output is identical to the following when the sizes are the same. When the sizes entered are different, the drawn shapes should be geometrically similar. EXECUTION EXAMPLE #1: -- GRASP exec: java Butterfly I will draw a butterfly for the s ize you enter. Afterward, if you want another, a nswer Y or y. Enter desired butterfly size: 3 Error: Size must be 4 or greater. Enter desired butterfly size: 4 * * *** ** *** *** ***** *** *** -JGRASP exec: java Butterfly I will draw a butterfly for the s ize you enter. Afterward, if you want another, a nswer Y or y. Enter desired butterfly size: 3 Error: Size must be 4 or greater. Enter desired butterfly size: 4 * ** ** *** **** ** Want another butterfly? (Y/y for another): y Enter desired butterfly size: 12 * ** ** *** *** **** **** ***** ***** ***** Want another butterfly? (Y/y for another): Y Enter desired butterfly size: 7 * ** *** **** ***** ***** ***** *** | * Want another butterfly? (Y/y for another): y Enter desired butterfly size: 9 * ** ** *** *** ****** *** ***** Want another butterfly? (Y/y for another): n Hope you enjoyed your 4 butterfli es. -- GRASPS oneration comnlete Want another butterfly? (Y/y for another): n Hope you enjoyed your 4 butterfli es. ----;GRASP: operation complete. EXECUTION EXAMPLE #2: ---J GRASP exec: java Butterfly I will draw a butterfly for the si ze you enter. Afterward, if you want another, an swer Y or y. Enter desired butterfly size: 8 * ** *** ***** ** ***** ***** *** * * Want another butterflv2 LY/y for a First get rid of the method, drawButterfly, since we have not yet covered other methods (ch. 5). Not sure why you did this. The middle line should be directly constructed to be "pinched" on each side. The bottom part should count from the size - 2 down to zero by 2, then for even sizes, add the display of the last line with single stars on each end. Try to implement this without the drawButterfly method. Let me Programming Assignment Repetition In this project you will write an application that will display a butterfly according to the requirements below. All of the butterfly shapes displayed by the program must be geometrically similar shapes, i.e., uniformly scaled, and match those shown in the requirements and described in the paragraphs below. While there could be endless ways to actually "draw" a butterfly, all shapes drawn by your application must resemble the ones shown below exactly as described and shown. First, you should make sure you know how to draw using nested for-loops that display one character per print statement. To heln vou..nderstand The butterfly drawing application will display an introduction (see examples of execution below) and then ask the user for the size of the first butterfly to be drawn. The minimum size is four (4). The application MUST use a while loop to continue asking the user for the size as long as the entered size is less than the minimum (see examples of execution below). As you learned from the two examples above, an input like the butterfly size gives you all of the information you will need to calculate the numbers of asterisks and spaces needed for each line. The input also drives the number of lines in the figure: each butterfly has size lines from the top line through the indented or "pinched" line, then size/2 lines after that. If you did not do so, study the above examples to see how they determine numbers of characters, spaces, and lines using just one input or named constant After accurately drawing the butterfly, After accurately drawing the butterfly, the program must ask the user if they want another butterfly to be drawn. Accept a string as input using the Scanner's next() method (NOT nextLine()). The user must indicate the desire to draw another butterfly by entering either Yor y - either case should be allowed by the application. Any other input will be considered a negative answer and the program will then terminate by printing the termination message shown in the example executions below. Note well that the termination message must include the number of butterflies that were drawn for the user during the entire execution of the program. Note that the word, butterfly, is displayed in its singular when the number drawn was one (1), otherwise the word is displayed in the plural. (Hint: the conditional operator is good for getting this done!) Also, note that your code should be able to display as many butterfliece the car chooses, many butterflies as the user chooses, and any sizes, including large and small sizes not shown in these example executions. Here are two separate executions of your program. Make sure your output is identical to the following when the sizes are the same. When the sizes entered are different, the drawn shapes should be geometrically similar. EXECUTION EXAMPLE #1: ---| GRASP exec: java Butterfly I will draw a butterfly for the s ize you enter. Afterward, if you want another, a nswer Y or y. Enter desired butterfly size: 3 Error: Size must be 4 or greater. Enter desired butterfly size: 4 * ** ** *** *** ***** *** jGRASP exec: java Butterfly I will draw a butterfly for the s ize you enter. Afterward, if you want another, a nswer Y or y. Enter desired butterfly size: 3 Error: Size must be 4 or greater. Enter desired butterfly size: 4 ** ** *** *** ***** ** Want another butterfly? (Y/y for another): Y Enter desired butterfly size: 12 ** *** *** ***** **** ***** ***** ***** Want another butterfly? (Y/y for another): n Hope you enjoyed your 4 butterfli es. ----; GRASP: operation complete. EXECUTION EXAMPLE #2: ---J GRASP exec: java Butterfly I will draw a butterfly for the si ze you enter. Afterward, if you want another, an swer Y or y. Enter desired butterfly size: 8 * ** *** **** **** ***** * * Want another butterfly2 LY/y for a Want another butterfly? (Y/y for another): y Enter desired butterfly size: 7 * ** *** *** **** ** ***** *** * Want another butterfly? (Y/y for another): Y Enter desired butterfly size: 9 * ** ** *** ***** ** *** *** * Want another butterfly? (Y/y for another): n Hope you enjoyed your 4 butterfli es. - GRASP oneration comnlete

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

Database And Expert Systems Applications Dexa 2022 Workshops 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 In Computer And Information Science 33

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Alfred Taudes ,Atif Mashkoor ,Johannes Sametinger ,Jorge Martinez-Gil ,Florian Sobieczky ,Lukas Fischer ,Rudolf Ramler ,Maqbool Khan ,Gerald Czech

1st Edition

3031143426, 978-3031143427

More Books

Students also viewed these Databases questions