Today is Christmas Eve. I wrote a program for my friends and gave them blessings and happiness.

Source: Internet
Author: User
Today is Christmas Eve. Program Merry Christmas to my friends.
Code Copy it free Code
1 Using System;
2 Using System. Collections. Generic;
3 Using System. text;
4
5 Namespace Merrychristmas
6 {
7 Struct Study
8 {
9 Public   Int Everyclassscore;
10 Public Char themarkofmajorclass; // Don't be afraid to show off good results
11 Public   Int Averagescore;
12 }
13 Class Collegelife
14 {
15 String Yourname;
16 Private Study smooth_study;
17 Private String a_good_company; // If you need it, find Gg/mm to spend your college life with you.
18 Public Collegelife ( String Name, String Company)
19 {
20 Yourname = Name;
21 A_good_company = Company; // Find a good friend to spend the whole college life together. A good friend may not necessarily have friends between men and women.
22 Smooth_study.everyclassscore = Program. Ra. Next ( 70 , 100 ); // You only need to wait for each course.
23 Smooth_study.themarkofmajorclass =   ' A ' ; // After a professional course, you must have a good meal.
24 Smooth_study.averagescore = Program. Ra. Next ( This . Smooth_study.everyclassscore, 100 ); // Can the average score of all last courses be too low?
25 }
26 Public Collegelife ( String Name)
27 : This (Name, Null ) // Use this constructor if you are not using it.
28 {
29}
30 Public   Void Show_my_college_life ()
31 {
32 If (A_good_company ! =   Null )
33 Console. writeline ( This . Yourname +   " And "   +   This . A_good_company +   " Have a pleasant college life " );
34 Console. writeline ( " In college life, your scores in each course are " + This . Smooth_study.everyclassscore + " Above " );
35 Console. writeline ( " In addition, each Professional Course scored. " );
36 Console. writeline ( " The average score of university courses has reached "   +   This . Smooth_study.averagescore +   " Above \ n " );
37 }
38 }
39 Class Program
40 {
41 Static   Public Random Ra =   New Random ();
42 Static   Void Main ( String [] ARGs)
43 {
44 Sister collegelife = New Collegelife ( " Sister Xiao Yu " , " Samson day " );
45 Collegelife MOCA =   New Collegelife ( " Moca " , " Samson day " );
46 Collegelife Alan =   New Collegelife ( " Xiaolan " , " Samson day " );
47 Collegelife =   New Collegelife ( " Pears " , " Samson day " );
48 Sister Xiao Yu. show_my_college_life ();
49 Moca. show_my_college_life ();
50 Alan. show_my_college_life ();
51 Pear. show_my_college_life ();
52 Console. writeline ( " \ N Haha. Finally, I wish you a merry Christmas. --- Samson Product " );
53 Console. readkey ();
54 }
55 }
56 }
57

After running:

Scores are randomly generated, but the score is always 70 points. If the table is low, hit me. ^-^
Finally, I wish all of my friends a happy Christmas Eve and a safe and happy next year!

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.