Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab Assignment: Implementing a 2D Electronic Text Billboard You all have seen electronic billboards where texts move from left to right, or right to left,

image text in transcribed

Lab Assignment: Implementing a 2D Electronic Text Billboard You all have seen electronic billboards where texts move from left to right, or right to left, right? Given they can show moving texts, they can show texts in much larger fonts and their appearance is more interesting than static bilboards. In this assignment, you will implement a 20 electronic billboard using a circular 2D array. The billboard has a dimension of 2 by 10. That is, it can show two rows of text and at a time can display 10 characters in each row. Interestingly, the text on the top row slides from right to left, and the text on the bottom row slides from left to right. You might wonder why this can be useful. For example, the top row can be English, and the bottom is Japanese/Arabic. Then it is natural to have two texts move in opposite directions. What you have to do is simulate that billboard using a 2D array whose horizontal dimension is circular. The program should have the following behavior. 1. It will take two lines of text as input, if any input length is greater than 10 characters then print "Invalid Input Size" 2. Then you will need to store the two inputs in the 2D array where the first letter of the first input will be stored in [0][0] index, the second letter of the first input will be stored in [0].1], and so on. If the input is less than 10 in length then later parts would be empty strings. Similarly. you will need to store the first letter of the second input at [1][0], the second letter of the second input at [1] [1] index, and so on. 3. Your input may contain any character, however, it will have exactly one Upper Case Letter (Assume your user wil always give input this way). That upper case letter index would be the starting index of that dimensions. After that print the array's each dimension's starting index and start index character. 4. Then within a loop. you ask for a user prompt. If the user enters any character other than Qq. you have to print the array in such a way that starts printing the top row from one position left and the bottom row from one position right. You keep printing in this manner as the user keeps entering any character other than O. 5. If the user presses Q/Q then you exit the loop. Then, print the array's each dimension's starting index and start index character. This will be exactly the same as the initial state because you are not allowed to change the structure and position of a value of the circular two-dimensional array. You can not create any new temporary array. You can not use any built-in functions except len(3, range() and ord(;)

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

How flying airoplane?

Answered: 1 week ago

Question

Make efficient use of your practice time?

Answered: 1 week ago