ABC private Ltd wants to maintain employees information. You need to define an entity class to hold employee information
using System;
using System.Collections.Generic;
namespace App
{
class Employee
{
private string name;
private double salesAmount;
public string Name
{
get { return name; }
set { name = value; }
}
public double SalesAmount
{
get { return salesAmount; }
set { salesAmount = value; }
}
public Employee() { }
public Employee(string name, double salesAmount)
{
this.name = name;
this.salesAmount = salesAmount;
}
}
class Program
{
static void Main(string[] args)
{
Console.Write("Enter the name of the employee: ");
string name = Console.ReadLine();
Console.Write("Enter the sales amount for the week: ");
double salesAmount = double.Parse(Console.ReadLine());
Employee employee = new Employee(name, salesAmount);
Console.WriteLine("The name of the employee: {0}", employee.Name);
Console.WriteLine("The sales amount for the week of the employee: {0}", employee.SalesAmount.ToString("C"));
Console.ReadLine();
}
}
}
Comments
Leave a comment