+ 1
Can someone help to make a code using C# language?
27 Answers
+ 3
Yeah we all here for that!
Tell us what's the issue
+ 2
Please share the code
+ 1
Ze Shion
Are you required to create inputs also, or just print out those statements.
Can you attach your attempt?
It makes it easier to assist
+ 1
Ze Shion
It looks like you wrote this all at once, then ran it.
Might I suggest you write one concept only and test that concept for viability.
If it works, then build on it, and keep testing.
I was getting indications of {} in strange places, which indicates that you may have introduced more flaws while searching for the original bug
+ 1
can you help me to write code sir/ma'am??
+ 1
chill dude
+ 1
omyyy
+ 1
That's what I thought the first time around, watch out for the beasts like Vats [ DEV ] I and JOY ..
Those wakes me up at night
+ 1
https://code.sololearn.com/cL9taN1jD8Sk/?ref=app
If you have to just print the statement, without any input, then it can help you.
+ 1
woww its amazing
0
my teacher assigned me to create a code using c# language and the output of the code is like this
Hello!
Hello
My age is 21 years old
I'm studying
Hello!
I'm explaining
0
using System;
public class StudentAndTeacherTecherTest
{
public static void Main()
{
Person myPerson = new Person();
myPerson.Greet();
Student myStudent = new Student();
myStudent.SetAge(21);
myStudent.Greet();
myStudent.ShowAge();
myStudent.Study();
}
}
public class Person
{
protected int age;
public void Greet()
{
Console.WriteLine("Hello!");
}
public void SetAge(int n)
{
age = n;
}
{
public class Student : Person
}
public void Study()
{
Console.WriteLine("I'm studying");
}
public void ShowAge()
{
Console.WriteLine("My age is {0} years old", age);
}
{
public class Teacher : Person
}
public void Explain()
{
Console.WriteLine("I'm explaining");
}
}
}
0
i cant run my code😭
0
plsss help😭
0
Why dont you just do Console.WriteLine(); a bunch of times?
0
Ze Shion
Line that reads:
Console.WriteLine(quot;My age is {age} years old") ;
You only missed the $ sign and the age variable position, at a glance.
Hope I'm not too late.
0
They haven't heard of Stackoverflow.com yet, I was a lost soul before that miracle happened!
0
scratch??
0
really??
0
OML, Please keep the children off the street at night!
I heard this one dude on a podcast all chuffed with himself because he could code better than any other because of scratch. lol.
Doesn't the name say it already, scratch that.