Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 2 ( 4 0 marks ) For this task, you are to write a code that uses nested for loops to output the shape

Task 2(40 marks)
For this task, you are to write a code that uses nested for loops to output the shape like the one below. Allow the user to specify how high the shape should be.
Instructions
The user must specify the height of the shape and then print the shape based on the specified height.
Requirements
To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements:
Appropriate data types must be used for all user inputs.
You must not use any conpcets not covred yet
Run 3
Enter the height: 3
x**x
**x**
x**x
Run 4
Enter the height: 5
x******x
**x**x**
****x****
**x**x**
x******x
Run 5
Enter the height: 7
x**********x
**x******x**
****x**x****
******x******
90
Run 6
Enter the height: 10
x****************x
**x************x**
****x********x****
******x****x******
********xx********
********xx********
******x****x******
****x********x****
**x************x**
x******************x
To check for correctness, ensure that your program gives the same outputs as in the examples, as well as trying it with other inputs.
image text in transcribed

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

what is quantum computing?

Answered: 1 week ago

Question

Define facework and identify three primary facework strategies

Answered: 1 week ago