This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class UserHomeWork { | |
name: string | |
surname: string | |
age: number | |
isConsentGiven: boolean | |
constructor(name: string, surname: string, age: number,isConsentGiven: boolean = false) { | |
this.name = name; | |
this.surname = surname; | |
this.isConsentGiven = isConsentGiven; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function multiply (a: number, b: number): number { | |
return a * b; | |
} | |
export function calculatePercentage (a: number, b: number): number { | |
return (a/b) * 100; | |
} | |
export function isEven (num: number): boolean { | |
return num % 2 === 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Assignment #1 | |
class Calculator { | |
num1: number | |
num2: number | |
constructor(num1: number, num2: number) { | |
this.num1 = num1; | |
this.num2 = num2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Assignment 01 | |
//Temperature Converter | |
function convertToFahrenheit (celsius: number): number | |
{ | |
const result = (celsius * 9/5) + 32 | |
return result; | |
} | |
//Greeting Generator |