C# для школьников - ответы
Количество вопросов - 118
class Person { public string name; public int age; public Person(string n, int a) { name = n; age = a; } public void PrintName() { Console.WriteLine("Name: "+name); } void PrintInfo() { Console.WriteLine("Name: " + name + " Age: " + age); } } class School { static void Main(string[] args) { Person Ivanov = new Person("Ivan Ivanov",15); // вызов метода Console.ReadLine(); } }
class School{ int number = 0; public School(){ number = 33; } public School(int n){ number = n; } static void Main(string[] args){ School s43 = new School(43); }}
void ViewPerson(string Name, string Family){ Console.WriteLine("Премию получит: " + Ivan + " " + Ivanov);}ViewPerson();
void myButton2MouseDown(object sender, MouseEventArgs e) { Graphics g = this.CreateGraphics(); Pen bluePen = new Pen(Color.Blue, 3); g.DrawArc(bluePen, 150, 20, 100, 100, 90, 180); g.Dispose(); }
using System;namespace ivanov{ class Program { static void Main(string[] args) { Console.WriteLine("Иванов ","Иван"); Console.ReadLine(); } }}
class Pupil{ public string name; int income; protected int age; private string password; }class School{ Pupil Ivanov = new Pupil ();}
class Pupil: Person{ public void SayHello(string surname){ Console.WriteLine("Hello, " + name); } } class School{ static void Main(string[] args){ Pupil Petrov = new Pupil(); Petrov.SayHello("Ivanov"); } }
using System;namespace ivanov{ class Program { static void Main(string[] args) { string name = Иванов + Иван; Console.WriteLine(name); Console.ReadLine(); } }}
class Person { public string name; public int age; public Person(string n, int a) { name = n; age = a; } public void PrintName() { Console.WriteLine("Name: "+name); } private void PrintTwoLines() { Console.WriteLine("Name: "+name+"\nAge: "+age); } } class School { static void Main(string[] args) { Person Ivanov = new Person("Ivan Ivanov",15); // вызов метода Console.ReadLine(); } }
void myButton1MouseMove(object sender, EventArgs e) { Graphics g = this.CreateGraphics(); Pen redPen = new Pen(Color.Red, 3); g.DrawEllipse(redPen, 150, 100, 100, 100); g.Dispose(); }
class Pupil:Person{ public void PrintAge(int age){ age = 14; Console.WriteLine("age: " + age); } } class School{ static void Main(string[] args){ Pupil Petrov = new Pupil(); Petrov.PrintAge(Console.ReadLine()); } }
class School { void Main(string[] args) { ViewPerson("Ivan", "Ivanov"); } void ViewPerson(string Name, string Family) { Console.WriteLine("Премию получит: " + Name + " " + Family); } }
using System;namespace ivanov{ class Program { static void Main(string[] args) { Console.WriteLine("Иванов "+"Иван"); Console.ReadLine(); } }}
void myButton2MouseLeave(object sender, EventArgs e) { Graphics g = this.myPictureBox.CreateGraphics(); g.FillRectangle(new SolidBrush(Color.Green), 50, 60, 50, 60); g.Dispose(); }
class School{ int number = 0; public School(){ number = 33; } public School(int n){ number = n; } static void Main(string[] args){ School s43 = new School(); }}
class Person { public string name; public int age; public Person(string n, int a) { name = n; age = a; } public void PrintName() { Console.WriteLine("Name: "+name); } protected void PrintAge() { Console.WriteLine("Age: " + age); } } class School { static void Main(string[] args) { Person Ivanov = new Person("Ivan Ivanov",15); // вызов метода Console.ReadLine(); } }