Intelligence Podcast. NET training Employment class Entrance test questions

Source: Internet
Author: User

2, the student's completion test performance evaluation, the request in the console prompts the user to enter the student examination result, writes a method, according to the user input result, returns a rank;
90 points above A grade, 80~90 B grade, 70~80 grade C, 60~70 B grade, 60 points below C class.


using system;using system.collections.generic;using System.Linq;using            System.text;namespace consoleapplication1{class Program {static void Main (string[] args) {            Console.WriteLine ("Please enter your test results:");            int score =convert.toint32 (Console.ReadLine ()); Switch (SCORE/10) {case 10:console.writeline ("very good!")                ");                Break                Case 9:console.writeline ("excellent");                Break                Case 8:console.writeline ("excellent");                Break                Case 7:console.writeline ("good");                Break                Case 6:console.writeline ("Pass");                Break Default:Console.WriteLine ("the inferior lattice!                ");            Break        } console.readline (); }    }}

3, in the console prompts the user to enter an age, if the user enters the age is more than 18 years old, prompts the user "can view", if is less than 10 years old, prompts the user "cannot view", if is between 10 years old to 18 years old, prompts the user   "whether continues to view?" (yes/no), if the user enters Yes, the prompt can be viewed, otherwise the prompt cannot be viewed.

:

using system;using system.collections.generic;using System.Linq;using            System.text;namespace consoleapplication1{class Program {static void Main (string[] args) {            Console.WriteLine ("Please enter your Age:");            int Age =convert.toint32 (Console.ReadLine ()); if (age>=) {Console.WriteLine ("Can be viewed!            ");                } if (age < x && age >=) {Console.WriteLine ("See Please enter Y, do not look at input n");                String str = Console.ReadLine ();                if (str = = "Y" | | str = = "Y") {Console.WriteLine ("Force View");                } else {Console.WriteLine ("88");            }} if (age <) {Console.WriteLine ("Too Young to view");        } console.readline (); }    }}

4. In the console, prompt the user to enter a year, and then prompt the user to enter a month, depending on the year and month entered by the user to output the number of days of the month (need to determine whether it is leap years).

:
 

Using system;using system.collections.generic;using system.linq;using system.text;namespace ConsoleApplication1{            Class Program {static void Main (string[] args) {Console.WriteLine ("Please enter an annual");            int year = Convert.ToInt32 (Console.ReadLine ());            Console.WriteLine ("Please enter the month");            int month = Convert.ToInt32 (Console.ReadLine ()); if (month = = 2) {if (year% 4 = = 0) {Console.WriteLine ("{0} years {                1} months with 29 days ", year, month);                                }} else {int[] arr = new int[] {1, 3, 5, 7, 8, 10, 12}; if (Array.indexof (arr, month)) = =-1) {Console.WriteLine ("{0} year {1} month 3                0 days ", year, month);                } else {Console.WriteLine ("{0} years {1} months have 31 days", year, month);     }} console.readline ();   }    }} 

Intelligence Podcast. NET training Employment class Entrance test questions

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.