Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!