You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Exercises-And-Solutions/exercises/12-basic-test-exercise.md
+23-23
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Create Bill Calculator
4
4
5
-
Ask below Questions
5
+
Ask below questions:
6
6
7
7
1. How many french fries (60rs per piece) do you want to order ?
8
8
2. How many burgers (50rs per piece) do you want to order ?
@@ -15,7 +15,7 @@ item count as 0.
15
15
16
16
### Question 2
17
17
18
-
Print below Pattern
18
+
Print below pattern:
19
19
20
20
```
21
21
$$#$$#$$
@@ -27,27 +27,28 @@ $$
27
27
28
28
### Question 3
29
29
30
-
Ask the user question "How many times do you want to print Series". Then print below series. For example below series will print if user enteres 5
31
-
30
+
Ask the user question "How many times do you want to print Series". Then print below series. For example below series will print if user enteres 5:
31
+
```
32
32
1 2 3 5 8 13 21 34 55
33
+
```
33
34
Find the pattern for above series and print accordingly. If the user enters 10 then we will print the same series numbers till 10 times.
34
35
35
36
### Question 4
36
37
37
-
Using a switch case to do this exercise
38
+
Using a switch case to do this exercise.
38
39
39
40
Ask user a question "Do you drink tea/coffee" ?
40
41
41
-
- If user says tea print tea
42
-
- If user says coffee then print coffee
43
-
- If users say anything else then print water
42
+
- If user says tea print tea.
43
+
- If user says coffee then print coffee.
44
+
- If users say anything else then print water.
44
45
45
46
### Question 5
46
47
47
48
Ask user his/her age, "What is your age?"
48
49
49
50
If user age is greater than 18 and less than 50 then ask user "Would you like to have a coffee?"
50
-
If user click on Okay then ask for his/her choice with questions "What type of coffee you want to have?" and finally in the alert show message "Hello Sir/Mam, here is your coffee ###"
51
+
If user click on "Okay" button then ask for his/her choice with questions "What type of coffee you want to have?" and finally in the alert show message "Hello Sir/Mam, here is your coffee ###"
51
52
52
53
If user age is less than 18 then ask him question in confirm box "Would you like to have tea?"
53
54
If user says yes then ask "What type of tea do you want?" and then in alert show "Hello Sir/Mam, here is your ### tea."
@@ -56,63 +57,62 @@ Else show "Sorry visit again please." in alert box
56
57
### Question 6
57
58
58
59
Take any number and take other number as 39. Now check their difference by subtracting each other. If both numbers difference is greater than 40
59
-
then print double their absolute difference else print triple their absolute difference.
60
+
then print double their absolute difference else print triple of their absolute difference.
60
61
61
62
### Question 7
62
63
63
64
Write a JavaScript program to check from two given integers, whether one is greater than 18 and another one is less than 10.
64
65
65
-
If yes then print sum of both the numbers
66
-
Else print multiplication of both numbers
66
+
If yes then print sum of both the numbers.
67
+
Else print multiplication of both numbers.
67
68
68
69
### Question 8
69
70
70
-
Write a JavaScript program to check if out of 5 numbers any two numbers are same or not. If yes then print Yes else print No.
71
+
Write a JavaScript program to check if out of 5 numbers any two numbers are same or not. If yes then print "Yes" else print "No".
71
72
72
73
### Question 9
73
74
74
75
Write a program to check if a number is divisible by 10 && 20 or not. If yes then multiply the number by 51 else multiply the number by 59 and print.
75
76
76
77
### Question 10
77
78
78
-
Take a String and check its length. If string length is greater than 15 then print 2's table till the length of the string else print No
79
+
Take a String and check its length. If string length is greater than 15 then print 2's table till the length of the string else print "No".
79
80
80
81
### Question 11
81
82
82
-
How do you reverse a given string in place
83
+
How do you reverse a given string in place?
83
84
84
85
### Question 12
85
86
86
-
How do you print duplicate characters from a string
87
+
How do you print duplicate characters from a string?
87
88
88
89
### Question 13
89
90
90
-
How do you find duplicate characters in a given string
91
+
How do you find duplicate characters in a given string?
91
92
92
93
### Question 14
93
94
94
-
How do you count a number of vowels and consonants in a given string
95
+
How do you count a number of vowels and consonants in a given string?
95
96
96
97
### Question 15
97
98
98
-
How do you check if a given string is a palindrome
99
+
How do you check if a given string is a palindrome?
99
100
100
101
### Question 16
101
102
102
-
Given string str, How do you find the longest palindromic substring in string?
103
+
Given a string, How do you find the longest palindromic substring in string?
103
104
104
105
### Question 17
105
106
106
-
How to remove the duplicate character from String
107
+
How to remove the duplicate character from String?
107
108
108
109
### Question 18
109
110
110
111
Write a program to count the number of characters in a string.
111
112
112
113
### Question 19
113
114
114
-
Write a program to check if a given string is a palindrome (reads
115
-
the same backwards and forwards).
115
+
Write a program to check if a given string is a palindrome (reads the same backwards and forwards).
0 commit comments