Answered step by step
Verified Expert Solution
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 : How digit is represented using asterisks. In this example, the length of each
horizontal segment is asterisks and the length of each vertical segment is 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 to :
After the user enters the length of vertical segments using keyboard, your program will check the
entered length. If the length is less than or greater than 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 sevensegment
representation of that number. Then, the program repeats this process printing the message Enter
a positive integer: and printing out its sevensegment 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started