Skip to content

Commit 78607c8

Browse files
authored
Update 12-basic-test-exercise.md
1 parent af7510a commit 78607c8

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Exercises-And-Solutions/exercises/12-basic-test-exercise.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Create Bill Calculator
44

5-
Ask below Questions
5+
Ask below questions:
66

77
1. How many french fries (60rs per piece) do you want to order ?
88
2. How many burgers (50rs per piece) do you want to order ?
@@ -15,7 +15,7 @@ item count as 0.
1515

1616
### Question 2
1717

18-
Print below Pattern
18+
Print below pattern:
1919

2020
```
2121
$$#$$#$$
@@ -27,27 +27,28 @@ $$
2727

2828
### Question 3
2929

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+
```
3232
1 2 3 5 8 13 21 34 55
33+
```
3334
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.
3435

3536
### Question 4
3637

37-
Using a switch case to do this exercise
38+
Using a switch case to do this exercise.
3839

3940
Ask user a question "Do you drink tea/coffee" ?
4041

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.
4445

4546
### Question 5
4647

4748
Ask user his/her age, "What is your age?"
4849

4950
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 ###"
5152

5253
If user age is less than 18 then ask him question in confirm box "Would you like to have tea?"
5354
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
5657
### Question 6
5758

5859
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.
6061

6162
### Question 7
6263

6364
Write a JavaScript program to check from two given integers, whether one is greater than 18 and another one is less than 10.
6465

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.
6768

6869
### Question 8
6970

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".
7172

7273
### Question 9
7374

7475
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.
7576

7677
### Question 10
7778

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".
7980

8081
### Question 11
8182

82-
How do you reverse a given string in place
83+
How do you reverse a given string in place?
8384

8485
### Question 12
8586

86-
How do you print duplicate characters from a string
87+
How do you print duplicate characters from a string?
8788

8889
### Question 13
8990

90-
How do you find duplicate characters in a given string
91+
How do you find duplicate characters in a given string?
9192

9293
### Question 14
9394

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?
9596

9697
### Question 15
9798

98-
How do you check if a given string is a palindrome
99+
How do you check if a given string is a palindrome?
99100

100101
### Question 16
101102

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?
103104

104105
### Question 17
105106

106-
How to remove the duplicate character from String
107+
How to remove the duplicate character from String?
107108

108109
### Question 18
109110

110111
Write a program to count the number of characters in a string.
111112

112113
### Question 19
113114

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).
116116

117117
### Question 20
118118

0 commit comments

Comments
 (0)