-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathproblem39.js
35 lines (23 loc) · 944 Bytes
/
problem39.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
/* ## Can you find out who will get the delicious cake?
### (Part 1)
Jim is a meritorious student. He secures first place in his class all the time.
This year, Dela has joined his class. She was also a topper at her previous school.
On the day of result publication, the teacher comes into the class with a delicious cake and says that "Jim & Dela, whoever is the topper, will get this tasty cake." Can you find out who will get this cake?
**Input: The input line has two values, m (The marks Jim has got) and n (The marks Dela has got).**
**Output: Print the name of the topper.**
1. Sample Input-1: 84 75
- Sample Output-1: Jim
2. Sample Input-2: 69 97
- Sample Output-2: Dela */
function findingTopper(m,n){
if( m > n){
return "Jim";
}
else{
return "Dela"
}
};
const jimsMarks = 69;
const delasMarks = 97;
const theCakeWillGet = findingTopper(jimsMarks, delasMarks);
console.log(theCakeWillGet);