Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

undefined Create a method called heart that accepts an integer named size as a parameter. This method will print out an ascii heart using and

image text in transcribedundefined

Create a method called heart that accepts an integer named size as a parameter. This method will print out an ascii heart using and #. The widest part of the heart will have size * 2 #s. Each line underneath that will subtract a #from each side and replace it with a - Each line above that line will subtract a #from each side and subtract 2 #'s from the middle, replacing them all with -. Note the difference between when size is even or odd. It is recommended to create two new methods to create this, one for creating the top half, one for creating the bottom half. You can assume that size will be greater than or equal to 3. heart(6); -------- -****--***+- heart(5); -------- -***--***- ******* heart(4); -#--++- heart(3); ---- --##-- -----##

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions