+ 3
C# Code Project : Social Network
I tried a couple things but I have been on this for like an hour and every time had a problem. Can people who have solved it give me their solutins from when they solved it because I just want it to be as simple as possible.
5 ответов
+ 12
class Program
{
static void Main(string[] args)
{
string postText = Console.ReadLine();
Post post = new Post();
post.Text = postText;
post.ShowPost();
}
}
class Post
{
private string text;
//write a constructor here
public Post()
{
Console.WriteLine("New post");
}
public void ShowPost()
{
Console.WriteLine(text);
}
//write a property for member text
public string Text
{
get { return text; }
set { text = value; }
}
}
+ 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
string postText = Console.ReadLine();
Post post = new Post();
post.Text = postText;
post.ShowPost();
}
}
class Post
{
private string text;
//write a constructor here
public Post()
{
Console.WriteLine("New post");
}
public void ShowPost()
{
Console.WriteLine(text);
}
//write a property for member text
public string Text
{
get { return text; }
set { text = value; }
}
}
}
+ 2
good luck
https://code.sololearn.com/cwzYi38UalIa
+ 1
I know this isn´t how this was intended to be solved, but it´s the most simple way, i guess:
using System;
using System.Collections.Generic;
namespace Code_Coach_Challenge
{
class Program
{
static void Main(string[] args)
{
string postText = Console.ReadLine();
Console.WriteLine("New post");
Console.WriteLine(postText);
}
}
0
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using static System.Net.Mime.MediaTypeNames;
namespace Code_Coach_Challenge
{
class Program
{
static void Main(string[] args)
{
string postText = Console.ReadLine();
Post post = new Post();
//post.Text = postText;
post.ShowPost(postText);
}
}
class Post
{
private string text;
//write a constructor here
public Post()
{
Console.WriteLine("New post");
}
public void ShowPost(string text)
{
Console.WriteLine(text);
}
}
}