Skip to content

Commit b47d4d0

Browse files
Stephen LeeStephen Lee
authored andcommitted
update question wording and details
1 parent 644bf4b commit b47d4d0

File tree

32 files changed

+147
-145
lines changed

32 files changed

+147
-145
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
>>Complete the function <code>quotedText</code> so that it satisfies the following condition:
2-
<p>Return a string variable with the input in single quotes.</p>
2+
<p>Print the string variable (input) in single quotation marks.</p>
33
<p>
44
For example:<br/>
5-
<code>quotedText("Hello")</code> should return 'Hello'<br/>
6-
<code>quotedText("Bye")</code> should return 'Bye'<br/>
7-
<code>quotedText(" ")</code> should return ' '</p><<
5+
<code>quotedText("Hello")</code> should print 'Hello'<br/>
6+
<code>quotedText("Bye")</code> should print 'Bye'<br/>
7+
<code>quotedText(" ")</code> should print ' '</p><<
88
99
= #!exl::repl('index.prob.repl.yaml')
1010

11-
||You can use single quotes inside double quotes. e.g. <code>console.log("'Hi'")</code> ||
11+
||You can use single quotes inside double quotes. e.g. <code>console.log("'Hi'")</code> will print 'Hi'||
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
>>Complete the function <code>parseNumbers</code> so that it satisfies the following condition:
2-
3-
<p>Parse strings into integer or floats<br/>
2+
<p>Parse strings into integers and adds one to integer value.<p>
3+
<p>
44
For example:<br/>
5-
<code>parseNumbers('2')</code> should return 2<br/>
6-
<code>parseNumbers('24.23')</code> should return 24.23<br/>
7-
<code>partyBalloons('0')</code> should return 0</p><<
5+
<code>parseNumbers('2')</code> should print 3<br/>
6+
<code>parseNumbers('24')</code> should print 25<br/>
7+
<code>partyBalloons('-1')</code> should print 0</p><<
88
99
= #!exl::repl('index.prob.repl.yaml')
1010

11-
||Use parseInt and parseFloat when writing the function. ||
11+
||Use parseInt to convert the string into an integer. ||
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
>>Complete the function <code>oddOrEven</code> so that it satisfies the following condition:
2-
<p>Check if given integer is odd or even, and prints "even NUMBER" or "odd NUMBER", where you should print the input number's value instead of NUMBER.<br/>
1+
>>Complete the function <code>checkEven</code> so that it satisfies the following condition:
2+
<p>Check if the given integer is an even number. If the integer is even, print true, otherwise, print false.<br/>
33
For example:<br/>
4-
<code>oddOrEven(2)</code> should return "even 2"<br/>
5-
<code>oddOrEven(3)</code> should return "odd 3"<br/>
6-
<code>oddOrEven(-2)</code> should return "even -2"</p><<
4+
<code>checkEven(2)</code> should print "true"<br/>
5+
<code>checkEven(3)</code> should print "false"<br/>
6+
<code>checkEven(-2)</code> should print "true"</p><<
77
88
= #!exl::repl('index.prob.repl.yaml')
99

10-
||Use the modulus operator to solve this question ||
10+
||Use the modulus operator and to solve this question ||
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
>>Complete the function <code>divisionPractise</code> so that it satisfies the following condition:
2-
<p>Prints on the console "true NUMBER" if the number is divisible without remainder by 7 and 5. Otherwise prints "false NUMBER". In place of NUMBER print the value of the input number.<br/>
2+
<p>Prints true on the console if the number (input) is divisible by 7 and 5. Otherwise prints false.<br/>
33
For example:<br/>
4-
<code>divisionPractise(30)</code> should return "false 30"<br/>
5-
<code>divisionPractise(35)</code> should return "true 35"<br/>
6-
<code>divisionPractise(0)</code> should return "true 0"</p><<
4+
<code>divisionPractise(30)</code> should print "false"<br/>
5+
<code>divisionPractise(35)</code> should print "true"<br/>
6+
<code>divisionPractise(0)</code> should print "true"</p><<
77
88
= #!exl::repl('index.prob.repl.yaml')
99

10-
||Use the modulus operator to solve this question ||
10+
||Use the modulus operator and "&&" to solve this question ||
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
>>Complete the function <code>rectangles</code> so that it satisfies the following condition:
2-
<p>Calculates rectangle’s area and perimeter by given width and height. <br/>
2+
<p>Calculates rectangle’s area and perimeter with the given width and height. Print the area, a space, and then the perimeter in the console. <br/>
33
For example:<br/>
4-
<code>rectangles(2,5)</code> should return "10 14"<br/>
5-
<code>rectangles(3,10)</code> should return "30 26"<br/>
6-
<code>rectangles(1,1)</code> should return "1 4"</p><<
4+
<code>rectangles(2,5)</code> should print "10 14"<br/>
5+
<code>rectangles(3,10)</code> should print "30 26"<br/>
6+
<code>rectangles(1,1)</code> should print "1 4"</p><<
77
88
= #!exl::repl('index.prob.repl.yaml')
99

10-
||Use the multiplication and addition ||
10+
||Use multiplication and addition using basic math concepts to solve this problem. Don't forget the space in between the area and perimeter. ||
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
>>Complete the function <code>thirdDigit</code> so that it satisfies the following condition:
2-
<p>Takes an integer N as parameter and prints true if the third digit of N is 7, or "false THIRD_DIGIT", where you should print the third digit of N.<br/>
1+
>>Complete the function <code>lastDigit</code> so that it satisfies the following condition:
2+
<p>Takes an integer N as parameter and prints the last digit of the integer N.<br/>
33
For example:<br/>
4-
<code>thirdDigit(123456)</code> should return "false 3"<br/>
5-
<code>thirdDigit(1273)</code> should return "true"<br/>
6-
<code>thirdDigit(137)</code> should return "true"</p><<
4+
<code>lastDigit(123456)</code> should print 6<br/>
5+
<code>lastDigit(1273)</code> should print 3<br/>
6+
<code>lastDigit(137)</code> should print 7</p><<
77
88
= #!exl::repl('index.prob.repl.yaml')
99

10-
||Use parseInt when solving this question. ||
10+
||1234%10 is 4 while 1235%10 is 5. What's the pattern, and how can you utilize it to solve this question?||

03_Operators and Expressions/02_Final Exam/04_Question 5/00_Code Input.prob.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
>>Complete the function <code>pointInCircle</code> so that it satisfies the following condition:
2-
<p>Given coordinates of a point x and y, write an expression that checks if given point (x, y) is inside a circle K({0, 0}, 2) - the center has coordinates (0, 0) and the circle has radius 2. The program should then print "yes DISTANCE" if the point is inside the circle or "no DISTANCE" if the point is outside the circle.<br/>
2+
<p>Given coordinates of a point x and y, write an expression that checks if given point (x, y) is inside a circle K({0, 0}, 2) - the center has coordinates (0, 0) and the circle has radius 2. The program should then print true if the point is inside the circle and false if the point is outside the circle.<br/>
33
For example:<br/>
4-
<code>pointInCircle(0,2)</code> should return "yes DISTANCE"<br/>
5-
<code>pointInCircle(3,4)</code> should return "no DISTANCE"<br/>
6-
<code>pointInCircle(1,1)</code> should return "yes DISTANCE"</p><<
4+
<code>pointInCircle(0,2)</code> should print true<br/>
5+
<code>pointInCircle(3,4)</code> should print false<br/>
6+
<code>pointInCircle(-1,-1)</code> should print true<br/>
7+
<code>pointInCircle(1,1)</code> should print true</p><<
78
89
= #!exl::repl('index.prob.repl.yaml')
910

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
>>Complete the function <code>exchangeGreater</code> so that it satisfies the following condition:
2-
<p>Write an if statement that takes two double variables a and b and exchanges their values if the first one is greater than the second. As a result print the values a and b, separated by a space.<br/>
2+
<p>Write an if statement that takes two integers a and b and prints the value b first if a is greater than the b. If a is less than or equal to the b, print the value of a first. Print the first number and the second number with a space.<br/>
33
For example:<br/>
44
<code>exchangeGreater(2,30)</code> should return "2 30"<br/>
55
<code>exchangeGreater(3,3)</code> should return "3 3"<br/>
66
<code>exchangeGreater(5,4)</code> should return "4 5"</p><<
77
88
= #!exl::repl('index.prob.repl.yaml')
99

10-
||Exchange their values ONLY if the first number is larger than the second number ||
10+
||Exchange their values ONLY if the first number is larger than the second number. Use nested if statements or if-else statements to solve this question. ||
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
>>Complete the function <code>sortNumbers</code> so that it satisfies the following condition:
2-
<p>Sort 3 values of an array in descending order.<br/>
2+
<p>Sort 3 integers in descending order. The numbers should be separated with commas.<br/>
33
For example:<br/>
4-
<code>sortNumbers([4,5,6])</code> should return [6,5,4]<br/>
5-
<code>sortNumbers([20,3,1])</code> should return [20,3,1]<br/>
6-
<code>sortNumbers([4,10,2])</code> should return [10,4,2]</p><<
4+
<code>sortNumbers(4,5,6)</code> should print 6,5,4<br/>
5+
<code>sortNumbers(20,3,1)</code> should print 20,3,1<br/>
6+
<code>sortNumbers(4,10,2)</code> should print 10,4,2</p><<
77
88
= #!exl::repl('index.prob.repl.yaml')
99

10-
||<code>arrayname[i]</code> accesses the element at position i of the array. ||
10+
||Nested if statements or if-else statements are needed to solve this question ||

04_Conditional Statements/02_Final Exam/02_Question 3/00_Code Input.prob.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
>>Complete the function <code>digitToWord</code> so that it satisfies the following condition:
2-
<p>Prints the digit input as a word (in English). Print "not a digit" in case of invalid input.<br/>
2+
<p>Prints the numeric digit (input) as a word in English in lowercase. Print "not a digit" in the input is not a digit (between 0-9).<br/>
33
For example:<br/>
4-
<code>digitToWord(2)</code> should return "two"<br/>
5-
<code>digitToWord(3)</code> should return "three"<br/>
6-
<code>digitToWord("Hello")</code> should return "not a digit"</p><<
4+
<code>digitToWord(2)</code> should print "two"<br/>
5+
<code>digitToWord(0)</code> should print "zero"<br/>
6+
<code>digitToWord(10)</code> should print "not a digit"<br/>
7+
<code>digitToWord("Hello")</code> should print "not a digit"</p><<
78
89
= #!exl::repl('index.prob.repl.yaml')
910

0 commit comments

Comments
 (0)