+ 5

[Solved] What's wrong with my C# social network code coach snippet?

https://code.sololearn.com/c9yt9hTUWDpC/?ref=app

20th Feb 2021, 8:44 AM
Sonic
Sonic - avatar
11 Antworten
0
Post has to be lower case, that's all
20th Feb 2021, 9:29 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
+ 23
using System; using System.Collections.Generic; namespace Code_Coach_Challenge { 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; public Post() { Console.WriteLine("New post"); } public void ShowPost() { Console.WriteLine(text); } public string Text { get {return text;} set {text = value;} } } }
7th Mar 2021, 8:19 PM
Sachin Kumar Biswal
Sachin Kumar Biswal - avatar
+ 5
using System; using System.Collections.Generic; namespace Code_Coach_Challenge { 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; public Post() { Console.WriteLine("New post"); } public void ShowPost() { Console.WriteLine(text); } public string Text { get {return text;} set {text = value;} } } }
22nd Mar 2021, 11:47 AM
Namrata Dattani
Namrata Dattani - avatar
+ 2
Sonic How is the task requirement?
20th Feb 2021, 9:07 AM
Ipang
+ 2
It fails the automated tests despite apparently giving the expected output.
20th Feb 2021, 9:07 AM
Sonic
Sonic - avatar
+ 2
Ipang the requirement are in the C# tutorial End of Module Project #41. Unfortunately it doesn't allow me to post a link.
20th Feb 2021, 11:18 AM
Sonic
Sonic - avatar
+ 2
Thanks for the answers. However, the issue has already been solved.
22nd Mar 2021, 7:43 PM
Sonic
Sonic - avatar
+ 2
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Code_Coach_Challenge { class Post { private string text; public Post(){ Console.WriteLine("New post"); } public void ShowPost() { Console.WriteLine(text); } public string Text { get {return text;} set {text = value;} } } class Program { static void Main(string[] args) { string postText = Console.ReadLine(); Post post = new Post(); post.Text = postText; post.ShowPost(); } } }
5th Dec 2021, 10:58 AM
Yagiz
Yagiz - avatar
+ 1
Benjamin Jürgens OMG! Thank you. I completely missed that.
20th Feb 2021, 11:16 AM
Sonic
Sonic - avatar
+ 1
Ipang it was just incorrect case in the output message.
20th Feb 2021, 11:16 AM
Sonic
Sonic - avatar
+ 1
using System; using System.Collections.Generic; namespace Code_Coach_Challenge { 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;} } } }
27th Jan 2022, 7:14 AM
Bhashitha Kaveesh