strikeouts27
strikeouts27
CC#
Created by strikeouts27 on 5/10/2025 in #help
Can someone tell me if I am on the right track?
Can someone tell me if I am on the right track with these instructions? Create an application class named LetterDemo that instantiates objects of two classes named Letter and CertifiedLetter and that demonstrates all their methods. The classes are used by a company to keep track of letters they mail to clients. The Letter class includes auto-implemented properties for the Name of the recipient and the Date mailed (stored as strings). Create a child class named CertifiedLetter that includes an auto-implemented property TrackingNumber (of type string) that holds a tracking number for the letter. Next, include a ToString() method that overrides the Object class’s ToString() method and returns a string that contains the name of the class (using GetType()) and the respective class's data field values. Use default, empty constructor for both classes.
using System;
using static System.Console;
using System.Globalization;
class LetterDemo
{
static void Main()
{
class LetterDemo
{
static void Main(string[] args)
{
LetterObject = new Letter();
CertifiedLetter = new CertifiedLetter()
}
}


public class Letter()
{

// Set the class properties
private string name;
private string dateMailed;

// Get set methods
public string Name
{
get {return name; }
set { name = value; }
}

// Property for DateMailed
public string DateMailed
{
get {return dateMailed; }
set {dateMailed = value; }
}

// Override the ToString() method
public ovveride string ToString()
{
return $"Name {Name},
}
}

public class CertifieddLetter : Letter
{

public string TrackingNumber {get; set};


}
}
}
using System;
using static System.Console;
using System.Globalization;
class LetterDemo
{
static void Main()
{
class LetterDemo
{
static void Main(string[] args)
{
LetterObject = new Letter();
CertifiedLetter = new CertifiedLetter()
}
}


public class Letter()
{

// Set the class properties
private string name;
private string dateMailed;

// Get set methods
public string Name
{
get {return name; }
set { name = value; }
}

// Property for DateMailed
public string DateMailed
{
get {return dateMailed; }
set {dateMailed = value; }
}

// Override the ToString() method
public ovveride string ToString()
{
return $"Name {Name},
}
}

public class CertifieddLetter : Letter
{

public string TrackingNumber {get; set};


}
}
}
5 replies
CC#
Created by strikeouts27 on 2/6/2025 in #help
✅ Discord paste line tool for C#
is there a discord paste tool for discord where i can place my c# code in a hyperlink instead of posting all of it
4 replies
CC#
Created by strikeouts27 on 3/29/2024 in #help
Trying to install C# need help troubleshooting
I am trying to install C# on my windows machine using the following instructions. https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.203-windows-x64-installer I have downloaded the installer and have attempted step2 to verify the installation. When I run the commands I get the following error message
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-8.0.203-win-x64.exe -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-8.0.203-win-x64.exe -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
C:\Users\Andrew>mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-8.0.203-win-x64.exe -C $HOME/dotnet The syntax of the command is incorrect. C:\Users\Andrew>export DOTNET_ROOT=$HOME/dotnet 'export' is not recognized as an internal or external command, operable program or batch file.
16 replies