+ 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.

16th Mar 2022, 2:03 PM
Kyle Mastropolo
Kyle Mastropolo - avatar
5 Answers
+ 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; } } }
25th Apr 2022, 11:25 PM
Feriloo
Feriloo  - avatar
+ 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; } } } }
10th Oct 2022, 5:31 AM
Pooja Patel
Pooja Patel - avatar
16th Mar 2022, 2:16 PM
SoloProg
SoloProg - avatar
+ 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); } }
24th Dec 2022, 1:31 PM
Felix Kaufmann
Felix Kaufmann - avatar
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); } } }
23rd Dec 2022, 1:48 PM
Ewan Downey
Ewan Downey - avatar