Question

Python 2.7.14 Programming Assignment Shape Drawing With Notepad++(PLEASE READ AND FOLLOW THESE INSTRUCTIONS THOROUGLY AS THIS ASSIGNMENT IS FOR PYTHON 2.7.14. ONLY AND I REALLY NEED THIS TO WORK!!! ALSO PLEASE HAVE THE CODE PROPERLY INDENTED, WITH WHATEVER VARIABLES DEFINED, WHATEVER IT TAKES TO WORK FOR PYTHON 2.7.14. I feel like nothing I do is working and I'm trying everything I can think of. ):

In this assignment, the student will create a Python script that implements a series of functions that draw scaling shapes on the output console. When completing this assignment, the student should demonstrate mastery of the following concepts:

Functions

Loop Syntax (While Loops, For Loops)

Lists Used As Iterators

Variable Scope

Function Inputs

Algorithm Design – Nested Loops

Assignment Instructions(PLEASE READ AND FOLLOW THESE INSTRUCTIONS THOROUGLY AS THIS ASSIGNMENT IS FOR PYTHON 2.7.14. ONLY AND I REALLY NEED THIS TO WORK!!! ALSO PLEASE HAVE THE CODE PROPERLY INDENTED, WITH WHATEVER VARIABLES DEFINED, WHATEVER IT TAKES TO WORK FOR PYTHON 2.7.14. ):

In this assignment, you will be using loops to draw a variety of geometric shapes on the console screen. In all cases, the shapes should be drawn with asterisk (*) symbols. While writing the functions keep in mind that when the ‘print’ keyword in Python is used, a newline will automatically be generated. You will most likely need to suppress this behavior for drawing. This can be accomplished by adding a comma after the last item being displayed by ‘print’

Example

print ‘This displays with a newline.’< span>

# this will cause a newline to be displayed after the

# period at the end of the sentence

print ‘This displays without a newline.’,

# this will suppress the newline behavior

Although the comma suppresses the newline, keep in mind that an additional space will be added after the natural display. This can be used to help re-create the type of drawings provided in the examples below (notice that each asterisk in the drawings is followed by a single space). The space also helps to give the shapes a proportional appearance.

The functions are described below:

Function #1 – Drawing a Rectangle

This function should take two arguments. The first one contains the width of the rectangle and the second one contains the height of the rectangle (in asterisks). When writing the Rectangle function, only use "FOR" loops to create the display.

Function #2 – Drawing a Triangle

This function should take a single argument for the height of the triangle in asterisks. The display should produce a right isoceles triangle with the right angle appearing at the bottom-left corner of this display. When writing the Triangle function, only use "WHILE" loops to create the display.

Function #3 – Drawing a Pyramid

This function should take a single argument representing the base radius of the pyramid. The base radius represents half the length of the base of the pyramid. You should include a single column of asterisks going down the center of the pyramid that do not count towards the base radius. Consider the example below:

*

* * *

* * * * *

* * * * * * *

The base radius of this triangle is 3. That is because there are 3 asterisks to the left and right of the center column of the Triangle. If we replace the center column with C’s, this becomes apparent.

C

* C *

* * C * *

* * * C * * * <= notice 3 asterisks to the left and right of the bottom of the pyramid

Please keep in mind that although the pyramid appears to be a triangle, the logic needed to properly draw it is more complicated than the logic used to draw the triangle in the previous function. You will need to develop some sort of technique to pad the left and right side of each row in the pyramid’s display to create the centering effect. When writing the Pyramid function, you can use any type of loop that you wish.

For the sake of simplicity, you can hard-code the values that are passed into each function. However, the logic of each function must operate in a completely abstract manner and handle any realistic input values that would generate a shape that fits on the standard console screen.

I REALLY NEED THIS TO WORK!!! ALSO PLEASE HAVE THE CODE PROPERLY INDENTED, WITH WHATEVER VARIABLES DEFINED, WHATEVER IT TAKES TO WORK FOR PYTHON 2.7.14. THIS PROGRAM HAS TO OUTPUT THE FOLLOWING, NO EXCEPTIONS:

Displaying a 10 x 10 rectangle. Displaying a triangle with height = 8. Displaying a pyramid with base radius7

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1 def rectangle(width, height): Draw rectangle of width x height for h in range(height): # Loop over height for w in rangeSpython main.py 8 8k

Add a comment
Know the answer?
Add Answer to:
Python 2.7.14 Programming Assignment Shape Drawing With Notepad++(PLEASE READ AND FOLLOW THESE INSTRUCTIONS THOROUGLY AS THIS...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5.13 Program: Drawing a half arrow (Python 3) This zyLab activity is the traditional programming assignment,...

    5.13 Program: Drawing a half arrow (Python 3) This zyLab activity is the traditional programming assignment, typically requiring a few hours over a week. The previous section provides warm up exercises intended to help a student prepare for this programming assignment. This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width. (1) Modify the given program to...

  • Python 3: Please follow the respective rubric for the following function definition. Rubric: Rectangle Shape You...

    Python 3: Please follow the respective rubric for the following function definition. Rubric: Rectangle Shape You should implement the following functions to print a rectangle shape. • print_rectangle(length, width, fillChar, hollow). This function will use draw_shape_line() function to print a rectangle shape with the given length and width, If the hollow is true, the shape will be hollow rectangle, otherwise a filled rectangle. This function must not interact with the user. For example, the call print_rectangle(5, 10, '*', False) should...

  • Hi. Please help me solve this in python using only while loops, if statements. Can't use...

    Hi. Please help me solve this in python using only while loops, if statements. Can't use for loops and lists. In this programming assignment, you will be writing a program that prints out several shapes via text. In this PA, you will be required to use functions and parameters. This is both to reduce redundancy and to make your code clean and well-structured. Name your program shaper.py Your program should have the capability to print out three different shapes: An...

  • Programming Assignment 6: A Python Class, Attributes, Methods, and Objects Obiectives .Be able to...

    I need some help with programming this assignment. Programming Assignment 6: A Python Class, Attributes, Methods, and Objects Obiectives .Be able to write a Python class Be able to define class attributes Be able to define class methods .Be able to process input from a text file .Be able to write an application using objects The goal of this programming assignment is to develop a simple image processing application. The application will import a class that creates image objects with...

  • Please use C++ and Please do all file separate separately. And also I need output too....

    Please use C++ and Please do all file separate separately. And also I need output too. thanks. Please do it complete work. ShapeNodePoly.cpp Avaliable from: Wednesday, July 27, 2016, 10:20 AM Requested files: Point.h, Point.cpp, Shape.h, Shape.cpp, Polygon.h, Polygon.cpp, Ellipse.h, Ellipse.cpp, ShapeNodePoly.cpp, ShapeNodePoly_test.cpp (Download) Type of work: Individual work In this assignment, you will create a class that can behave as any of the shapes listed below. You will use object inheritance to enable all shapes to be managed using...

  • need help with python program The objectives of this lab assignment are as follows: . Input...

    need help with python program The objectives of this lab assignment are as follows: . Input data from user Perform several different calculations Implement conditional logic in loop • Implement logic in functions Output information to user Skills Required To properly complete this assignment, you will need to apply the following skills: . Read string input from the console and convert input to required numeric data-types Understand how to use the Python Modulo Operator Understand the if / elif /...

  • C++ programming For this assignment, write a program that will act as a geometry calculator. The...

    C++ programming For this assignment, write a program that will act as a geometry calculator. The program will be menu-driven and should continue to execute as long as the user wants to continue. Basic Program Logic The program should start by displaying a menu similar to the following: Geometry Calculator 1. Calculate the area of a circle 2. Calculate the area of a triangle 3. Quit Enter your choice(1-3): and get the user's choice as an integer. After the choice...

  • Please help me with the following question. This is for Java programming. In this assignment you...

    Please help me with the following question. This is for Java programming. In this assignment you are going to demonstrate the uses of inheritance and polymorphism. You will create an Animals class and a Zoo class that holds all the animals. You should create a general Animalclass where all other classes are derived from (except for the Zoo class). You should then create general classes such as Mammal, Reptile, and whatever else you choose based off of the Animalclass. For...

  • I need help with this assignment. It's due Tuesday at 8 AM. Please follow the instructions thorou...

    I need help with this assignment. It's due Tuesday at 8 AM. Please follow the instructions thoroughly as to not use any advanced material we may not have gone over in class. The instructions let you know what all should be used. Thanks! Use only what you have learned in Chapters 1 - 7. Use of "advanced" material, material not in the text, or project does not follow the instructions, will result in a GRADE OF 0% for the project....

  • Please help me to do my assignment it should be python. Thank you Write a menu-driven...

    Please help me to do my assignment it should be python. Thank you Write a menu-driven program for Food Court. (You need to use functions!) Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!) Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs. Keep asking the user until he/she chooses...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT