In the morning, I gave a brief lecture on the basics of C # language to several new colleagues in the company. The manager gave me some questions and gave them to everyone. I found it from the Internet, and it was not very suitable. Now I have compiled one. I think the difficulty is quite moderate. Maybe I will use all the exercises and pen questions in the future. The record is as follows:
Write a simple graphic printProgram. You can print triangles, squares, and rectangles in the DOS window.
Basic requirements:
Supported input parameters: Image type, image size, hollow/solid, used to splice line string characters
Output: Specifies the size, type, and use of the specified characters to represent a hollow or solid image.
For example, if you want to use a to implement a hollow square with a size of 5, the display effect is as follows:
Aaaaa
A
A
A
Aaaaa
Intermediate requirements:
Multiple images can be displayed in one row.
Note: The height of all vertices is required. The vertical distance difference between the leftmost vertex and the rightmost vertex of the previous graph is an English character.
For example, a hollow square spliced with a size of 5 and an entity triangle spliced with a size of 3 are displayed:
Aaaaa @
A @@@
A @@@@@
A
Aaaaa
Advanced requirements:
1. Nesting of hollow Images
Note: The implementation of this requirement must be based on the implementation of Intermediate requirements, that is, when multiple images are displayed in one row, other images can be nested inside a hollow image.
2. All images can be scaled up or down"
Note: after the program runs, the console prompts the user to enter the starting parameter, and then displays the corresponding graph. Next, by entering commands such as "Enlarge" on the console, you can zoom in all the images (you can also define the zoom in size using parameters). You can also zoom in and zoom in.
Or the reduced image can be re-displayed and waiting for further instruction input.
Other Instructions:
1. programmers design their own parameter input methods. The simpler the better.
2. the scalability of the program should be as strong as possible, and the problem should be handled in an OO way as much as possible
3. Make full use of the input parameter's unreasonable input range (for example, the length of the DOS console is exceeded, for example, the size of the embedded image exceeds the size of the peripheral image) and handle the problem accordingly.
4. Try to use as many existing types as possible in the. NET class library.