Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Figure 2 : How digit 8 is represented using asterisks. In this example, the length of each horizontal segment is 1 6 asterisks and the

Figure 2: How digit 8 is represented using asterisks. In this example, the length of each
horizontal segment is 16 asterisks and the length of each vertical segment is 12 asterisks.
print a message stating that the length is not acceptable and the user must try entering the length
again. When user enters an acceptable length for the horizontal segments, then, the program prints
out the following message on screen:
Now, enter the length of vertical segments (from 3 to 40):
After the user enters the length of vertical segments using keyboard, your program will check the
entered length. If the length is less than 3 or greater than 40, the program must print a message
stating that the length is not acceptable and the user must try entering the length again. Also, if
the length of vertical segment is greater than twice the length of horizontal segment or less than
half of the length of horizontal segment, the program must print a message stating that the length
is not acceptable and the user must try entering the length again. When user enters an acceptable
length for the vertical segments, then, the program prints out the following message on screen:
Enter a positive integer:
After the user enters the positive integer, the program checks to see if the user input is a valid
positive integer. If the user input is not legal, the program must print out a message stating
that the user input is not acceptable and the user must try entering the positive integer again.
When user enters an acceptable input (a positive integer), the program prints out the seven-segment
representation of that number. Then, the program repeats this process (printing the message Enter
a positive integer: and printing out its seven-segment representation) indefinitely.
To end this infinite loop, user can simply presses Ctrl + D , which is a way to pass
EOF character to the program via standard input stream (keyboard).

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

Students also viewed these Databases questions