-
Notifications
You must be signed in to change notification settings - Fork 0
/
Laptop_Recommendation_System.txt
318 lines (279 loc) · 8.93 KB
/
Laptop_Recommendation_System.txt
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
start:-
writeln("****************************** Laptop Selection Recommendation System ****************************"),
writeln("******************** here you can know the ideal laptop for you in a few minutes! ********************"),nl,
menu.
menu:-
writeln('Please choose the category you intrested in: '),
writeln('1- Daily Use'),
writeln('2- Programming'),
writeln('3- Gaming and Designing'),
read(A),
(not(A==1),not(A==2),not(A==3) ->
writeln("Incorrect entry! choose a number between 1-3."), menu;
category(A)).
% ------------------------- Daily Use -------------------------------
category(1):-
writeln('Mac OS?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),category(1);
((A=='yes') ->
q1_DU;
q2_DU)
).
q1_DU:-
writeln('Do you want it with touch bar?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q2_DU;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('Apple MacBook Pro 13 M2 Retiena + Touch bar'),
writeln('Thank you for utilizing our system!'), abort);
( writeln('The Ideal Laptop for you is:'),
writeln('Apple MacBook Pro with M2 chip'),
writeln('Thank you for utilizing our system!'), abort )
)
).
q2_DU:-
writeln('Do you need it tp be portable?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q3_DU;
((A=='yes') ->
q4_DU;
q5_DU)
).
q4_DU:-
writeln('Is your bugdet limtited?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q5_DU;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('Acer Aspire 3 A315-56'),
writeln('Thank you for utilizing our system!'), abort);
( writeln('The Ideal Laptop for you is:'),
writeln('HP Pavillion 14-dv2022nx'),
writeln('Thank you for utilizing our system!'), abort )
)
).
q3_DU:-
writeln('Do you prefer it to be a touch sreen?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q4_DU;
((A=='yes') ->
q5_DU;
q4_DU)
).
q5_DU:-
writeln('Decide if you want a 2-in-1?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q5_DU;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('Mircosoft Surface Pro 9 2-in-2 labtop'),
writeln('Thank you for utilizing our system!'), abort);
q4_DU)
).
% ------------------------ Programming ------------------------------
category(2):-
writeln('For college?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),category(2);
((A=='yes') ->
q10_PRG;
q20_PRG)
).
q10_PRG:-
writeln('Do you prefer a LED screen?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q10_PRG;
(((A=='yes'); (A=='no')) ->
q11_PRG)
).
q11_PRG:-
writeln('Do you need to carry it with you in college?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q10_PRG;
((A=='yes') ->
q111_PRG;
q112_PRG)
).
q111_PRG:-
writeln('Do you need it to be large battery life?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q11_PRG;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('Dell inspiron 13 5310'),
writeln('Thank you for utilizing our system!'), abort );
( writeln('The Ideal Laptop for you is:'),
writeln('Apple MacBook Air M1'),
writeln('Thank you for utilizing our system!'), abort )
)
).
q112_PRG:-
writeln('Do you like it to be with large screen size?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q11_PRG;
((A=='yes') ->
q1121_PRG;
q1122_PRG)
).
q1121_PRG:-
writeln('is your budget limited?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q112_PRG;
((A=='yes') ->
(writeln('The Ideal Laptop for you is:'),
writeln('Lenovo IdealPad 5'),
writeln('Thank you for utilizing our system!'), abort);
q111_PRG)
).
q1122_PRG:-
(
q111_PRG).
q20_PRG:-
writeln('iOS Development?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q20_PRG;
((A=='yes') ->
q21_PRG;
q22_PRG)
).
q21_PRG:-
writeln('Do you need it to be portable?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q21_PRG;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('Apple MacBook pro 13-inch'),
writeln('Thank you for utilizing our system!'), abort);
( writeln('The Ideal Laptop for you is:'),
writeln('Apple MacBook pro 16-inch'),
writeln('Thank you for utilizing our system!'), abort )
)
).
q22_PRG:-
writeln('Do you prefer Windows OS?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q22_PRG;
((A=='yes') ->
q23_PRG;
q21_PRG)
).
q23_PRG:-
writeln('Game Development?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q22_PRG;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('Asus ROG Zephyrus G15'),
writeln('Thank you for utilizing our system!'), abort);
q24_PRG)
).
q24_PRG:-
writeln('Do you need it to be portable?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q24_PRG;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('HP Spectre x360'),
writeln('Thank you for utilizing our system!'), abort);
( writeln('The Ideal Laptop for you is:'),
writeln('Lenovo ThinkPad X1 Extreme'),
writeln('Thank you for utilizing our system!'), abort )
)
).
% ------------------------ Gaming and Designing ------------------------------
category(3):-
writeln('Do you have limited budget?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),category(3);
((A == 'yes') ->
question3_1;
question3_2)
).
question3_2:-
writeln('Do you need high quality screen ?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),question3_2;
question3_3).
question3_3:-
writeln('Do you need large screen size ?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),question3_3;
question3_1).
question3_1:-
writeln('Do you need large capacity ?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),question3_1;
question3_4).
question3_4:-
writeln('Do you need fast data transfer ?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),question3_4;
question3_5).
question3_5:-
writeln('Do you need high performance ?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),question3_5;
question3_6).
question3_6:-
writeln('Do you use it for many hours a day?'),
writeln('(yes/no)'),
read(A),
(not(A=='yes'), not(A=='no') ->
writeln("Invalid Input! You must write either yes or no."),q24_PRG;
((A=='yes') ->
( writeln('The Ideal Laptop for you is:'),
writeln('ASUS ROG Zephyrus'),
writeln('Thank you for utilizing our system!'), abort);
( writeln('The Ideal Laptop for you is:'),
writeln('ASUS A15'),
writeln('Thank you for utilizing our system!'), abort )
)
).