Computer Small white Learning software development-c# Choice statement, exception capture, offensive programmer

Source: Internet
Author: User

Write code also to read, love the whole stack, more love life. Daily update of original it programming techniques and daily practical videos.

Our goal is: To play with the server Web development, to understand the mobile side, the computer client is a cinch.

I have to say that the language of C # is the best language. Its beautiful syntax, the most humane new features, and the invincible development tools intoxicating. have been exposed to a lot of languages, but have been remembering to write the state of C #.

I think that the current C # is more suitable for the introduction of the language, the most small white, keen on the development of computer programming people, it is a big benefit.

No matter how many Chinese language tutorials have been written, the C # Tutorial is so rich in emotion. In order to complete our full stack dream, as the server side, the public number, for the time being used. NET to learn to explain.

This tutorial is a basic tutorial for anyone who is interested in learning software development. Of course, because of the coherence of technology, it is recommended to view in order.

Previous article: C # Getting Started Tutorial (iii) – Receive user input, escape character, type conversion-build C

Total List of articles: http://blog.sina.com.cn/s/blog_6ab069310102wpj6.html

To review, create a project flow:

    1. Open Visual Stdio.

    2. To create a console project:

    3. Here we write the code:

SELECT statement: According to the school inside the good intermediate examples to explain this knowledge point.

As we all know, school grades can be divided into the following:

More than 1.90 points----excellent

2.80 points or more 90 points below----good

3.70 + 80 or less----medium

4.60 points or more 70 points below----pass

----Fail below 5.60 points

Five levels, we implement a console program that calculates the score level directly from the user's input score.

If statement:

Grammar explanation: If can be understood as if the meaning. If followed by parentheses, the parentheses represent the condition. When the condition is established, the contents of the curly braces after the parentheses are executed.

For example, the process is roughly:





Else indicates that the above conditions do not establish the code to execute else.

&&: Indicates and

|| : Indicates or

Effect:

Please write the above code three times and above in vs.

Switch syntax:

switch is not very useful in comparison with If. For example:

Switch can only differentiate between different individual items. Determine what the value of S is and then execute the corresponding code,

So we're dividing the score by 10 to take its quotient as a switch project

Break: Rep: Stop executing the switch code. If you don't add it, you're going to execute the following code.

Default means that if the above code does not execute, the

Exception capture:

Exceptions are errors that occur during the execution of a program. Like the type of conversions we've learned. If the type conversion fails, an exception is generated.

To catch the exception code:

If we enter a non-integer, an exception is thrown:

This lesson code: HTTPS://GITHUB.COM/SHELLCHENG/CSHARPCOURSE04

Write code also to read, love the whole stack, more love life. Daily update of original it programming techniques and daily practical videos.

Public platform: Do the full stack siege lion

Computer Small white Learning software development-c# Choice statement, exception capture, offensive programmer

Related Article

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.