<repo_name>mendajayaram/GitDemoUst<file_sep>/module.ts
import {position} from './oops';
var posobj=new position(1002,"jayaram",12345,"Full Stack Developer","Hyderabad");
posobj.displayDetail();<file_sep>/basic.ts

//Basic Program
var no:number=10.0;
var greet:string="Welcome to every one";
var con:boolean=false;
console.log(no);
console.log(greet);
console.log(con);

//Array

var student: string[]=["jayaram","Ram","Naresh"];
var fritus:Array<string>=["Applle","mango"];
console.log(fritus);
console.log(student);

//tupple

var product:[String,number,boolean,String]=["Apple",101,true,"hyd"];
console.log(product);
//enum
enum color{red=101,black,blue,green}
var num=color.green
console.log(num);


//union
var max :String | number |boolean=true;
var unknown:any="my name is jayaram";
console.log(unknown);

//object data type

var emp={
    empid:1002,
    empName:"Jayaram",
    empsalary:12345,
    empDetails:function(){
        return `ID:${this.empid},Name:${this.empName},salary:${this.empsalary}`;

    }
}
console.log(emp.empid);
console.log(emp.empName);
console.log(emp.empsalary);




<file_sep>/TaskNo6.ts
//Q5. //write a programe for displaying employee data
   // create base class with name Employee containing property (id,name,designation) 
   // and one methode which will display all these information.
   // create sub class with name Payslip containing property total salary, 
   // DA=25% of basic salary,HRA=800,tax=15% of basic salary. 
   // and create one methode which will display all information from Employee class 
   // as well as gross salary,DA,Tax.
   class Employee{
    displayempData() {
        throw new Error("Method not implemented.");
    }
    protected Empid:number;
    protected EmpName:string;
    protected Empdesignation:string;
    
    constructor(Empid:number,EmpName:string,Empdesignation:string){
        this.Empid=Empid;
        this.EmpName=EmpName;
        this.Empdesignation=Empdesignation;
        
    }
    employeedisplay(){
        console.log(`Employeeid: ${this.Empid}\nEmployeename: ${this.EmpName}\nEmpployeedesignation: ${this.Empdesignation}`)
    }
   
}
var empobj = new Employee(10,"jayaram","Developer");
empobj.employeedisplay();

class Payslip extends Employee{
     //DA=25% of basic salary,HRA=800,tax=15% 
    totalsalary: number;
    
   
    constructor(Empid:number,EmpName:string,Empdesignation:string,totalsalary:number){
       super(Empid,EmpName,Empdesignation);
       this.totalsalary=totalsalary;
       
        
      
    }
    employeedisplay(){
   var  da:number=(this.totalsalary)*(25/100);
     var hra:number=800;
    var  tax:number=(this.totalsalary)*(15/100);
console.log(`Employeeid: ${this.Empid}\nEmployeename: ${this.EmpName}\nEmpployeedesignation: ${this.Empdesignation}\nEmployeetotalsalary: ${this.totalsalary}\nEmployeeda: ${da }\nEmpployeehra: ${hra}\nEmpployeetax: ${tax}`)
    } 

}
var Pobj=new Payslip(1002,"sam","Developer",12345);

Pobj.employeedisplay();
<file_sep>/setterandgetter.ts
class Employee1{
    private ename:string;
    private esal:number;
    private epost:string;
    private post:string;
    set _name(value){
        this.ename=value;
    }
    get _name(){
        return this.ename;
    }
        set _post(value){
            this.ename=value;
        }
        get _post(){
            return this.ename;    
        }
        set _sal(value){
            this.ename=value;
        }
        get _sal(){
            return this.ename;    
        } 
        displayEmployeeData(){
            console.log(`EmpName:${this.ename},EmpPost:${this.epost},EmpSal:${this.esal}`)
        } 
}
var empobj1=new Employee1();
empobj1._name="jayaram";
console.log("name"+empobj1._name);
empobj1._post="Full Stacki Developer";
console.log("Employee Position:"+empobj1._post);
empobj1._sal="123";
console.log("salary"+empobj1._sal)


<file_sep>/Task1.ts
class Student1{
    protected sid:number;
    protected sname:string;
   
    constructor(id:number,name:string){
        this.sid=id;
        this.sname=name;
      
    }
    studentdisplay(){
        console.log(`Studentid: ${this.sid},Studentname: ${this.sname}`)
    }
   
}
var Studentobj = new Student(10,"jayaram");
Studentobj.studentdisplay();
//Task2
class Task2 extends Student1{
    phonenumber:number;//phonenumber  

    address:string;//address
    constructor(id:number,name:string,phonenumber:number,address:string){
       super(id,name)
        this.phonenumber=phonenumber;
        this.address=address;
      
    }
    studentdisplay(){
        console.log(`studentid: ${this.sid},studentname: ${this.sname},studentphonenumber: ${this.phonenumber},studentAddress: ${this.address}`)
    } 

}
var stdobj2=new Task2(1002,"sam",9874563210,"Hyderabad");
var stdobj3=new Task2(1003,"Josh",836952582,"Hyderabad");
stdobj2.studentdisplay();
stdobj3.studentdisplay();<file_sep>/Taskno7.ts
//creat one class which will calculate area of circle and,execute it from another file.
export
class Area1{
    length:number;
    width:number;
    constructor(length:number,width:number){
        this.length=length;
        this.width=width;

    }
    getArea(){
       console.log("Area of the rectange =:"+(this.length * this.width));
       
    }

}


<file_sep>/Taskno5.ts
//create one parent class with name  Student  containing property stdName,stdId,
//stdSection, stdContact which should be accessible only in Mark class but not 
//outside and one methode with name displayStdData which display all its property 
//value.create another child class with name Mark extends from Student class 
//containing property  totalMark and one methode allInformation() which will 
//display student class as well as Mark class property.
class Student{
    protected stdId:number;
    protected stdName:string;
    protected stdSection:string;
    protected stdContact:number;
    constructor(stdId:number,stdName:string,stdSection:string,stdContact:number){
        this.stdId=stdId;
        this.stdName=stdName;
        this.stdSection=stdSection;
        this.stdContact=stdContact;
    }
    displayStdData(){
        console.log(`Studentid: ${this.stdId},Studentname: ${this.stdName},StudentSection: ${this.stdSection},StudentContact: ${this.stdContact}`)
    }
   
}
var Studentobj = new Student(10,"jayaram","A",9876543210);
Studentobj.displayStdData();
//Marks Class
class Marks extends Student{
    m1:number; 
    m2:number;
    
    address:string;//address
    constructor(stdId:number,stdName:string,stdSection:string,stdContact:number ,m1:number,m2:number){
       super(stdId,stdName,stdSection,stdContact);
       this.m1=m1;
       this.m2=m2;
        
      
    }
    studentdisplay(){
        console.log(`Studentid: ${this.stdId},Studentname: ${this.stdName},StudentSection: ${this.stdSection},StudentContact: ${this.stdContact},StudentTotalmarks: ${this.m1+this.m2},StudentAverage: ${this.m1+this.m2}`)
    } 

}
var stdobj2=new Marks(1002,"sam","A",9876543210,90,80);

stdobj2.studentdisplay();
<file_sep>/oops.js
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
exports.__esModule = true;
exports.position = void 0;
var Employee = /** @class */ (function () {
    function Employee(id, name, sal) {
        this.empid = id;
        this.ename = name;
        this.salary = sal;
    }
    Employee.prototype.displayDetail = function () {
        console.log("Empid: " + this.empid + ",Empname: " + this.ename + ",Empsal: " + this.salary);
    };
    return Employee;
}());
var position = /** @class */ (function (_super) {
    __extends(position, _super);
    function position(id, name, sal, post, address) {
        var _this = _super.call(this, id, name, sal) || this;
        _this.post = post;
        _this.address = address;
        return _this;
    }
    position.prototype.displayDetail = function () {
        console.log("Empid: " + this.empid + ",Empname: " + this.ename + ",Empsal: " + this.salary + ",EmpPost: " + this.post + ",EmpAddress: " + this.address);
    };
    return position;
}(Employee));
exports.position = position;
var posobj = new position(1002, "jayaram", 12345, "Full Stack Developer", "Hyderabad");
posobj.displayDetail();
<file_sep>/task1.js
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var Student = /** @class */ (function () {
    function Student(id, name) {
        this.sid = id;
        this.sname = name;
    }
    Student.prototype.studentdisplay = function () {
        console.log("Studentid: " + this.sid + ",Studentname: " + this.sname);
    };
    return Student;
}());
var Studentobj = new Student(10, "jayaram");
Studentobj.studentdisplay();
//Task2
var Task2 = /** @class */ (function (_super) {
    __extends(Task2, _super);
    function Task2(id, name, phonenumber, address) {
        var _this = _super.call(this, id, name) || this;
        _this.phonenumber = phonenumber;
        _this.address = address;
        return _this;
    }
    Task2.prototype.studentdisplay = function () {
        console.log("studentid: " + this.sid + ",studentname: " + this.sname + ",studentphonenumber: " + this.phonenumber + ",studentAddress: " + this.address);
    };
    return Task2;
}(Student));
var stdobj2 = new Task2(1002, "sam", 9874563210, "Hyderabad");
var stdobj3 = new Task2(1003, "Josh", 836952582, "Hyderabad");
stdobj2.studentdisplay();
stdobj3.studentdisplay();
