TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Paul Agighioleanu
NA
3
952
make an class “employee” with the atributes “name” and “sala
Jul 6 2019 2:04 PM
can someone show me some examples with this class of constructors, methods and overload ??
define 2 employee and for the first one to rais the salary, then display the employees.
i`m very new to programming, i want to learn c#
and i want to know if i started right
using
System;
namespace
ConsoleApp1
{
class
employee
{
public
string
name{
get
;
set
; }
private
double
Salary;
public
double
salary
{
get
{
return
Salary; }
set
{
Salary= value;
if
(Salary< 0) Salary= 0;
}
}
// constructor de clasa
public
employee(
string
_name=
"Neinitializat"
,
double
_salary= 0)
{
salary= _salary;
name = _name;
}
//constructor de copiere
public
produs (salary s)
{
salary= s.salary;
nsme = s.name;
}
public
void
citire()
{
Console.WriteLine(
"NAme:"
); name = Console.ReadLine();
Console.WriteLine(
"Salary:"
);Salary=
double
.Parse(Console.ReadLine());
}
public
void
scriere()
{
Console.WriteLine(name +
","
+ Salary);
}
};
class
Program
{
static
void
Main(
string
[] args)
{
}
}
}
Reply
Answers (
2
)
Dynamically Create instance for class
ArcObject using #c integrated with Network ericssion (NE)