I got a C # pen question.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.