Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Purpose: More practice with control structures. For this lab, you will write a small program that prints a few shapes using asterisks. Your program will

image text in transcribed
Purpose: More practice with control structures. For this lab, you will write a small program that prints a few "shapes" using asterisks. Your program will prompt the user to select a shape by entering a number (square or triangle for B grade, add the zigzag for the A grade). It will then prompt for the size, and then if a square or triangle is selected it will prompt for "not filled" or "filled", and if a zig-zag is selected it will prompt for the number of repetitions. (See back for an example run). After printing a shape, your program will loop back and prompt again for another. One of the "shape selections" will cause the program to exit. For pre-lab. draw a flowchart of your code and make a serious attempt at writing it. Bring this to lab. It will be checked at the beginning of lab and will be a part of your total lab grade. Have your code behave exactly (and format exactly) as shown below for the sample run. Suggestion: work on how to draw a square first. Use "nested for loops" for this (one inside the other). For the unfilled square, substitute spaces for the asterisks on the "inside" (how do you know if a given location is "inside" the square?). The triangle code can be similar, but with a few small changes (mine had only two small changes)

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 Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

5. How do you expect to use active listening during the meeting?

Answered: 1 week ago