in C# i need to  Create an application named TestSoccerPlayer that instantiates and displays a SoccerPlayer object. The SoccerPlayer class contains the following properties: Name - The player’s name ( a string) JerseyNum - The player's jersey number (an integer) Goals - Number of goals scored (an integer) Assists - Number of assists (an integer) my errors are  Unit Test Incomplete Set and get the Name property Build Status Build Failed   Build Output Compilation failed: 1 error(s), 0 warnings   NtTestd94a3da4.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)     Test Contents   [TestFixture] public class SoccerPlayerClassTest { [Test] public void SoccerPlayerTest() { SoccerPlayer mySoccerPlayer = new SoccerPlayer(); mySoccerPlayer.Name = "Lionel"; mySoccerPlayer.JerseyNum = 9; mySoccerPlayer.Goals = 8; mySoccerPlayer.Assists = 35;   Assert.AreEqual("Lionel", mySoccerPlayer.Name, "Unable to set or get the 'SoccerPlayer.Name' value. "); } }   Unit TestIncomplete Set and get the JerseyNum property Build Status Build Failed Build Output Compilation failed: 1 error(s), 0 warnings   NtTest4182d6f7.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)   Test Contents [TestFixture] public class SoccerPlayerClassTest { [Test] public void SoccerPlayerTest() { SoccerPlayer mySoccerPlayer = new SoccerPlayer(); mySoccerPlayer.Name = "Lionel"; mySoccerPlayer.JerseyNum = 9; mySoccerPlayer.Goals = 8; mySoccerPlayer.Assists = 35;   Assert.AreEqual(9, mySoccerPlayer.JerseyNum, "Unable to set or get the 'SoccerPlayer.JerseyNum' value. ");   } } Unit TestIncomplete Set and get the Goals property Build Status Build Failed Build Output Compilation failed: 1 error(s), 0 warnings   NtTestb53c2012.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)   Test Contents [TestFixture] public class SoccerPlayerClassTest { [Test] public void SoccerPlayerTest() { SoccerPlayer mySoccerPlayer = new SoccerPlayer(); mySoccerPlayer.Name = "Lionel"; mySoccerPlayer.JerseyNum = 9; mySoccerPlayer.Goals = 8; mySoccerPlayer.Assists = 35;   Assert.AreEqual(8, mySoccerPlayer.Goals, "Unable to set or get the 'SoccerPlayer.Goals' value. ");    } }   Unit TestIncomplete Set and get the Assists property Build Status Build Failed   Build Output Compilation failed: 1 error(s), 0 warnings   NtTest4c3b83e0.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)   Test Contents [TestFixture] public class SoccerPlayerClassTest { [Test] public void SoccerPlayerTest() { SoccerPlayer mySoccerPlayer = new SoccerPlayer(); mySoccerPlayer.Name = "Lionel"; mySoccerPlayer.JerseyNum = 9; mySoccerPlayer.Goals = 8; mySoccerPlayer.Assists = 35;   Assert.AreEqual(35, mySoccerPlayer.Assists, "Unable to set or get the 'SoccerPlayer.Assists' value. "); } }   this is my code using static System.Console; class TestSoccerPlayer {     static void Main()     {         SoccerPlayer player = new SoccerPlayer("Lionel Messi", 10, 32, 16);         WriteLine("Player Name: " + player.Name);         WriteLine("Jersey Number: " + player.JerseyNum);         WriteLine("Goals: " + player.Goals);         WriteLine("Assists: " + player.Assists);     } } class SoccerPlayer {     public string Name { get; set; }     public int JerseyNum { get; set; }     public int Goals { get; set; }     public int Assists { get; set; }     public SoccerPlayer(string name, int jerseyNum, int goals, int assists)     {         Name = name;         JerseyNum = jerseyNum;         Goals = goals;         Assists = assists;     } }

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 1E: Create an application class named LetterDemo that instantiates objects of two classes named Letter...
icon
Related questions
Question

in C# i need to 

Create an application named TestSoccerPlayer that instantiates and displays a SoccerPlayer object. The SoccerPlayer class contains the following properties:

  • Name - The player’s name ( a string)
  • JerseyNum - The player's jersey number (an integer)
  • Goals - Number of goals scored (an integer)
  • Assists - Number of assists (an integer)

my errors are 

Unit Test
Incomplete

Set and get the Name property

Build Status
Build Failed
 
Build Output
Compilation failed: 1 error(s), 0 warnings
 
NtTestd94a3da4.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments
TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)
 
 
Test Contents
 
[TestFixture] public class SoccerPlayerClassTest
{
[Test]
public void SoccerPlayerTest()
{
SoccerPlayer mySoccerPlayer = new SoccerPlayer();
mySoccerPlayer.Name = "Lionel";
mySoccerPlayer.JerseyNum = 9;
mySoccerPlayer.Goals = 8;
mySoccerPlayer.Assists = 35;
 
Assert.AreEqual("Lionel", mySoccerPlayer.Name, "Unable to set or get the 'SoccerPlayer.Name' value. "); }
}
 
Unit TestIncomplete

Set and get the JerseyNum property

Build Status
Build Failed
Build Output
Compilation failed: 1 error(s), 0 warnings
 
NtTest4182d6f7.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments
TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)
 
Test Contents
[TestFixture]
public class SoccerPlayerClassTest
{
[Test]
public void SoccerPlayerTest()
{
SoccerPlayer mySoccerPlayer = new SoccerPlayer();
mySoccerPlayer.Name = "Lionel";
mySoccerPlayer.JerseyNum = 9;
mySoccerPlayer.Goals = 8;
mySoccerPlayer.Assists = 35;
 
Assert.AreEqual(9, mySoccerPlayer.JerseyNum, "Unable to set or get the 'SoccerPlayer.JerseyNum' value. ");
  }
}
Unit TestIncomplete

Set and get the Goals property

Build Status
Build Failed
Build Output
Compilation failed: 1 error(s), 0 warnings
 
NtTestb53c2012.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments
TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)
 
Test Contents
[TestFixture]
public class SoccerPlayerClassTest
{
[Test]
public void SoccerPlayerTest()
{
SoccerPlayer mySoccerPlayer = new SoccerPlayer();
mySoccerPlayer.Name = "Lionel";
mySoccerPlayer.JerseyNum = 9;
mySoccerPlayer.Goals = 8;
mySoccerPlayer.Assists = 35;
 
Assert.AreEqual(8, mySoccerPlayer.Goals, "Unable to set or get the 'SoccerPlayer.Goals' value. ");
   }
}
 
Unit TestIncomplete

Set and get the Assists property

Build Status
Build Failed
 
Build Output
Compilation failed: 1 error(s), 0 warnings
 
NtTest4c3b83e0.cs(12,37): error CS1729: The type `SoccerPlayer' does not contain a constructor that takes `0' arguments
TestSoccerPlayer.cs(22,12): (Location of the symbol related to previous error)
 
Test Contents
[TestFixture]
public class SoccerPlayerClassTest
{
[Test]
public void SoccerPlayerTest()
{
SoccerPlayer mySoccerPlayer = new SoccerPlayer();
mySoccerPlayer.Name = "Lionel";
mySoccerPlayer.JerseyNum = 9;
mySoccerPlayer.Goals = 8;
mySoccerPlayer.Assists = 35;
 
Assert.AreEqual(35, mySoccerPlayer.Assists, "Unable to set or get the 'SoccerPlayer.Assists' value. ");
}
}
 
this is my code
using static System.Console;

class TestSoccerPlayer
{
    static void Main()
    {
        SoccerPlayer player = new SoccerPlayer("Lionel Messi", 10, 32, 16);
        WriteLine("Player Name: " + player.Name);
        WriteLine("Jersey Number: " + player.JerseyNum);
        WriteLine("Goals: " + player.Goals);
        WriteLine("Assists: " + player.Assists);
    }
}

class SoccerPlayer
{
    public string Name { get; set; }
    public int JerseyNum { get; set; }
    public int Goals { get; set; }
    public int Assists { get; set; }

    public SoccerPlayer(string name, int jerseyNum, int goals, int assists)
    {
        Name = name;
        JerseyNum = jerseyNum;
        Goals = goals;
        Assists = assists;
    }
}
 
 
 
 
 
Expert Solution
Step 1

Algorithm:

Step 1 Start.

Step 2 Create a class "SoccerPlayer" with properties "Name", "JerseyNum", "Goals" and "Assists".

Step 3 Implement a default constructor for the class.

Step 4 Implement another constructor that takes in parameters for "Name", "JerseyNum", "Goals", and "Assists".

Step 5 In the main method, create an instance of the "SoccerPlayer" class and assign values to its properties.

Step 6 Output the values of the properties on the console.

Step 7 End.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT