Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem F3 Provied a loop with a menu. Repeat until the user selects quit. Prompt the user to select one of the menu items. Test

Problem F3

Provied a loop with a menu. Repeat until the user selects quit. Prompt the user to select one of the menu items. Test for numbers that are not in the menu, provide an error message, and then continue. The menu shall contain:

1. Square pattern 2. Triangle pattern 3. Diaginal pattern 4. Reverse diaginal pattern 5. Quit 

After the user selects a pattern, allow them to specify the size. If the size is smaller than 1 or larger than 9, give them an error message and repeat the specification of the size.

Once the user has correctly selected a pattern and a size, print the pattern using the size specified.

Pattern 1 is a square. Example for size 4:

4444 4444 4444 4444 

Pattern 2 is a triangle. Example for size 5:

5 55 555 5555 55555 

Pattern 3 is a square with a diaginal of numbers in stars. Example for size 6:

6***** *6**** **6*** ***6** ****6* *****6 

Pattern 4 is a square with a reversed diaginal of numbers in stars. Example for size 7:

******7 *****7* ****7** ***7*** **7**** *7***** 7****** 

Test the program once using each of these values in order: Pattern 9; when that is rejected try: Pattern 1, size 11; when that is rejected use: Pattern 1, size 3 Pattern 2, size 4 Pattern 3, size 5 Pattern 4, size 6 Quit

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 Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago

Question

What is loss of bone density and strength as ?

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago