Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help, write in c program use if only for loops and nested for loops. Thank you For this lab you will write a small

Need help, write in c program use if only for loops and nested for loops. Thank you image text in transcribed
image text in transcribed
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 zig zag 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. Notes: 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 rurn. 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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago