Question: This assignment requires you to create a C program that prints digits 0 - 9 on the console using a 7 - segment display. The
This assignment requires you to create a C program that prints digits on the console using a segment display. The display is made up of three horizontal segments a g and d and four vertical segments f b e and c Each horizontal segment is represented by two rows of asterisks, and each vertical segment is represented by two columns of asterisks.
The program should start by asking the user to enter the length of the horizontal segments. The length should be between and If the user enters a length outside this range, the program should display an error message and ask the user to enter the length again.
After the user enters a valid length for the horizontal segments, the program should ask the user to enter the length of the vertical segments. Again, the length should be between and If the user enters a length outside this range, or if the length of the vertical segment is greater than twice the length of the horizontal segment or less than half the length of the horizontal segment, the program should display an error message and ask the user to enter the length again.
Once the user has entered valid lengths for both the horizontal and vertical segments, the program should ask the user to enter a positive integer. The program should then print the segment representation of that number. The program should continue to ask the user to enter a positive integer and print the segment representation of the number indefinitely. The user can end the program by pressing Ctrl D
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
