Answer to Question #289187 in C# for Chitti

Question #289187

ABC private Ltd wants to maintain employees information. You need to define an entity class to hold employee information

1
Expert's answer
2022-01-20T11:54:54-0500


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();


        }


    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS