-
Notifications
You must be signed in to change notification settings - Fork 0
/
assignment.js
119 lines (80 loc) · 2.38 KB
/
assignment.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
114
115
116
117
118
119
/***********
Problem 1:
Write a program that uses a loop to print out (using console.log()) the multiplication table (12 levels) of a provided number
Variables Required (feel free to add your own variables if needed):
baseNumber (number)
Test Cases:
Use the following test cases to confirm your program meets the success criteria
1. Given the following:
baseNumber = 2
Result:
0
2
4
6
8
10
12
14
16
18
20
22
24
************/
console.log('Problem 1:')
// Add your code below this line
// Add your code above this line
console.log('')
console.log('-----------------')
/***********
Problem 2:
Write a program that prints (using console.log()) the largest number in a given array
Variables Required (feel free to add your own variables if needed):
numbers (array)
currentLargestNumber (number)
Test Cases:
Use the following test cases to confirm your program meets the success criteria
1. Given the following:
values = [57, 13, 4, 38]
Result: 57
2. Given the following:
values = [3, 48, 29, 12, 18]
Result: 48
************/
console.log('Problem 2:')
// Add your code below this line
// Add your code above this line
console.log('')
console.log('-----------------')
/***********
Problem 3:
Write a program that prints out (using console.log()) the winner of a rock paper scissors game between two players
- if the playerA chooses scissors and playerB chooses rock, playerB wins
- if the playerA chooses scissors and playerB chooses scissors, game is a tie
- if the playerA chooses paper and playerB chooses rock, playerA wins
- if the playerA chooses rock and playerB chooses paper, playerB wins
- etc (program should account for all available scenarios)
Variables Required (feel free to add your own variables if needed):
playerAChoice (string)
playerBChoice (string)
Test Cases:
Use the following test cases to confirm your program meets the success criteria
1. Given the following:
playerAChoice = "rock"
playerBChoice = "paper"
Result: "playerB wins"
2. Given the following:
playerAChoice = "scissors"
playerBChoice = "scissors"
Result: "tie"
3. Given the following:
playerAChoice = "scissors"
playerBChoice = "paper"
Result: "playerA wins"
************/
console.log('Problem 3:')
// Add your code below this line
// Add your code above this line
console.log('')
console.log('-----------------')