+ 2

Creating A Project Complete the given class by adding a constructor to show the success message.

Hello, I've got a task in a 38.1 C# lessons. There is "Your graphic application needs to report that a new project has been created successfully once the "Create" button has been pressed. Complete the given class by adding a constructor that will show message "Project created" once the operation is done." And there's code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { Project project = new Project(); } } class Project { //create a constructor to show "Project created" public Project() { Console.WriteLine("Project created"); } } } So i've got problem, because this code works in the Visual Studio but not in the SoloLearn site, TEST CASE is failed. Unfortunately the message from site is "This test case is hidden" altough i've got pro version but still cannot see the errors :/ Can anyone understand why this is happen?

25th Sep 2021, 3:06 PM
Adam
4 Answers
+ 2
// This works: public Project(){ Console.Write("Project created"); }
25th Sep 2021, 4:23 PM
JaScript
JaScript - avatar
+ 1
After 10x times refresing, the code starts working somehow. Strange bug.
25th Sep 2021, 3:13 PM
Adam
0
It's kind of a hilarious bug! You've got to remove space and use the bracket right after prentices! public Project(){ Console.Write("Project created"); }
13th Aug 2022, 2:19 PM
alborz ashrafi
alborz ashrafi - avatar
0
public void Pro(){ Console.Write("Project created"); } } true one
18th Nov 2023, 7:15 PM
Nouran Tariq
Nouran Tariq - avatar