-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
92 lines (92 loc) · 3.46 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#! /usr/bin/env node
///////////////////// "The Starting Coding" /////////////////////
import inquirer from "inquirer";
import chalk from "chalk";
console.log(chalk.bgGreen.white.bold.underline(`\n\t\t\t\t\t*Welcome To Object Oriented Programming*\n`));
class Person {
name;
age;
education1;
program;
education2;
giaic;
future;
// // Properties
// name: string;
// age: number;
// education1: string;
// program: string;
// education2: string;
// giaic: string;
// future: string;
// Constructor
constructor(name, age, education1, program, education2, giaic, future) {
this.name = name;
this.age = age;
this.education1 = education1;
this.program = program;
this.education2 = education2;
this.giaic = giaic;
this.future = future;
this.name = name;
this.age = age;
this.education1 = education1;
this.program = program;
this.education2 = education2;
this.giaic = giaic;
this.future = future;
}
// Method
sayHello() {
console.log(chalk.bgRed.white.bold.underline(`\nHello, my name is ${this.name} and I am ${this.age} years old.`));
console.log(chalk.bgGreen.white.bold.underline(`\nMy education is ${this.education1} and currently I am studying IT programs from ${this.program}.`));
console.log(chalk.bgRed.white.bold.underline(`\nDo you like education at Gov. House Sindh faculty? ${this.education2}.`));
console.log(chalk.bgGreen.white.bold.underline(`\nAre you pleased with the Governor IT programs at GIAIC? ${this.giaic}.`));
console.log(chalk.bgRed.white.bold.underline(`\nWhat do you want to do in future? ${this.future}.`));
}
}
async function OOP() {
let answers = await inquirer.prompt([
{
type: "input",
name: "name",
message: chalk.bgWhite.red.bold.underline(`What's is Your Name : `),
},
{
type: "input",
name: "age",
message: chalk.bgRed.white.bold.underline(`How Old Are You : `),
},
{
type: "input",
name: "education",
message: chalk.bgGreen.white.bold.underline(`What Education Do You Have : `),
},
{
type: "input",
name: "program",
message: chalk.bgRed.white.bold.underline(`Where Are You Now Studying For IT Programs : `),
},
{
name: "education2",
type: "input",
message: chalk.bgGreen.white.bold.underline(`Do You Like Education Governor House Sindh Faculty ? , Answer Yes and No ?`),
},
{
name: "giaic",
type: "input",
message: chalk.bgRed.white.bold.underline("Are You Pleased With The IT Programs at GIAIC ? Answer Yes and No ?"),
},
{
type: "input",
name: "future",
message: chalk.bgGreen.white.bold.underline(`What Do You Wish to do in the future ? , Write a Small Sentence : `),
},
]);
const { name, age, education1, program, education2, giaic, future } = answers;
const person = new Person(name, age, education1, program, education2, giaic, future);
person.sayHello();
console.log(chalk.bgGreen.white.bold.underline("\nMay Allah bless you and your family always, and best wishes for the future.\nGood luck to you."));
}
OOP();
/////////////////////// "The Ending Coding" ///////////////////