-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
113 lines (113 loc) · 4.19 KB
/
main.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#! usr/bin/env node
import inquirer from "inquirer";
let firstQuestion = await inquirer.prompt([
{
name: "question1",
type: "input",
message: "Enter Your Name:",
},
]);
const id = Math.floor(Math.random() * 20000);
let secondQuestion = await inquirer.prompt([
{
name: "question2",
type: "list",
message: "Please select the course you want to do",
choices: [
"CIT",
"Web and Graphic Designing",
"Web Development",
"Digital Marketing",
"Freelancing",
"PowerBI",
"Business Development",
"Daraz",
"Amazon"
],
},
]);
let balance = 25000;
let one = 100;
let two = 500;
let three = 1000;
let four = 2000;
let thirdQuestion = await inquirer.prompt([
{
name: "question3",
type: "list",
message: "Please select any one",
choices: ["Payfees", "Check current balance"],
},
]);
if (thirdQuestion.question3 === "Payfees") {
let fourthQuestion = await inquirer.prompt([
{
name: "question4",
type: "list",
message: "Please select the name of course you selected above to pay fee for",
choices: [
"CIT '100$'",
"Web and Graphic Designing '500$'",
"Web Development '1000$'",
"Digital Marketing '1000$'",
"Freelancing '500$'",
"PowerBI '2000$'",
"Business Development'100$'",
"Daraz '500$'",
"Amazon '2000$"
],
},
]);
if (fourthQuestion.question4 === "CIT '100$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= one;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "Web and Graphic Designing '500$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= two;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "Web Development '1000$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= three;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "Digital Marketing '1000$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= three;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "Freelancing '500$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= two;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "PowerBI '2000$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= four;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "Business Development'100$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= one;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "Daraz '500$'") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= two;
console.log(`Dear customer your current balance is ${balance}`);
}
else if (fourthQuestion.question4 === "Amazon '2000$") {
console.log(`You successfully paid the fees of course ${fourthQuestion.question4}`);
balance -= four;
console.log(`Dear customer your current balance is ${balance}`);
}
else {
console.log(`Dear customer your balance is ${balance}`);
}
}
console.log("Student Information");
console.log(`Student Name: ${firstQuestion.question1}`);
console.log(`Student ID: ${id}`);
console.log(`Course: ${secondQuestion.question2}`);