-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
47 lines (37 loc) · 993 Bytes
/
main.c
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
#include <stdio.h>
int main(){
printf("/n new job AI");
printf("-------------");
float p;
float threshold=1.5;
float input;
//better salary
printf("/n does the job have a better salary? (0:false, 1:true)");
scanf("%f",&input);
float x1=input;
float w1=0.8;
printf("/n does the job have a better travel time? (0:false, 1:true)");
scanf("%f",&input);
float x2=input;
float w2=0.4;
printf("/n is the job interesting? (0:false, 1:true)");
scanf("%f",&input);
float x3=input;
float w3=0.6;
printf("/n does the job have a better prospect? (0:false, 1:true)");
scanf("%f",&input);
float x4=input;
float w4=0.7;
printf("/n are you unhappy at your current job? (0:false, 1:true)");
scanf("%f",&input);
float x5=input;
float w5=0.8;
p=(x1*w1)+(x2*w2)+(x3*w3)+(x4*w4)+(x5*w5);
if(p>threshold){
printf("/n yes: you should apply for a job");
}
else {
printf ("/n no: you should not apply for a job");
}
return 0;
}