. NET entry-level Test Question 1: variables and expressions

Source: Internet
Author: User

Do it yourself. NET has been developing for three years. In the past three years, I have worked as a small website in my hometown, and I have been doing repetitive useless work. I came to Shanghai two months ago, and I have joined the company's foreign investment, I bought this C # entry-level Foundation and started reading it again. I have benefited a lot. Now I want to share the topic of every small chapter in this book. As your learning record.

(1) In the following code, how do I reference the name Great from the namespace fabulous code?

namespace fabulous{     //code in fabulous namespace      }namespace super{      namespace smashing      {             //great name defined      }}

(2) which of the following variables are invalid?

1. myVarableIsGood

2.99 Flake

3. _ floor

4. time2GetJiggyWidIt

5.wrox.com

 

(3) is the string supercalifragilistticexpialidocious too long to be placed in the string variable? Why?

 

(4) list the calculation steps of the following expressions based on the operator priority.

ResultVar + = var1 * var2 + var3 % var4/var5;

(5) Write a console application that requires you to enter int values and display their product. Tip: You can use the Convert. ToDouble () command to Convert the number you entered on the console to double. The command to Convert string to int Is Convert. IoInt32 ().

 

Well, the above is the question. Next, after a Huawei flash bullet, post the answer, which can be referred.

 

 

 

 

 

 

 

 

 

 

Flashing bullet

 

 

 

 

 

 

 

The answer is here:

(1): super. smashing. greate

(2): 99 Flask and wrox.com because the first one starts with a number and the second one has.

(3): theoretically, the length of a string is as long as the memory size is large, so this string can be placed in the string type.

(4): According to the operator priority, "*" "%" "/" is at the same level, followed by +, and finally "+ = ".

Two simple instances: resultVal + = (var1 * var2) + (var3% var4)/var5 ),

ResultVal + = (var1 * var2) + (var3% (var4/var5 ))

 

(5): Write down the pseudocode,

Int firtNum, secondNum, thiridNum, fourthNum;

1*2*3*4.

 

 

The above resources are from the C # Getting Started classic. Link attached:

Http://t.cn/zjO7kmp

 

 

 

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.