Skip to content

Commit

Permalink
Update 12-basic-test-exercise.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sajidhamdard authored Mar 14, 2024
1 parent af7510a commit 78607c8
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions Exercises-And-Solutions/exercises/12-basic-test-exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Create Bill Calculator

Ask below Questions
Ask below questions:

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

### Question 2

Print below Pattern
Print below pattern:

```
$$#$$#$$
Expand All @@ -27,27 +27,28 @@ $$

### Question 3

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

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:
```
1 2 3 5 8 13 21 34 55
```
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.

### Question 4

Using a switch case to do this exercise
Using a switch case to do this exercise.

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

- If user says tea print tea
- If user says coffee then print coffee
- If users say anything else then print water
- If user says tea print tea.
- If user says coffee then print coffee.
- If users say anything else then print water.

### Question 5

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

If user age is greater than 18 and less than 50 then ask user "Would you like to have a coffee?"
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 ###"
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 ###"

If user age is less than 18 then ask him question in confirm box "Would you like to have tea?"
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."
Expand All @@ -56,63 +57,62 @@ Else show "Sorry visit again please." in alert box
### Question 6

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
then print double their absolute difference else print triple their absolute difference.
then print double their absolute difference else print triple of their absolute difference.

### Question 7

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

If yes then print sum of both the numbers
Else print multiplication of both numbers
If yes then print sum of both the numbers.
Else print multiplication of both numbers.

### Question 8

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

### Question 9

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.

### Question 10

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

### Question 11

How do you reverse a given string in place
How do you reverse a given string in place?

### Question 12

How do you print duplicate characters from a string
How do you print duplicate characters from a string?

### Question 13

How do you find duplicate characters in a given string
How do you find duplicate characters in a given string?

### Question 14

How do you count a number of vowels and consonants in a given string
How do you count a number of vowels and consonants in a given string?

### Question 15

How do you check if a given string is a palindrome
How do you check if a given string is a palindrome?

### Question 16

Given string str, How do you find the longest palindromic substring in string?
Given a string, How do you find the longest palindromic substring in string?

### Question 17

How to remove the duplicate character from String
How to remove the duplicate character from String?

### Question 18

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

### Question 19

Write a program to check if a given string is a palindrome (reads
the same backwards and forwards).
Write a program to check if a given string is a palindrome (reads the same backwards and forwards).

### Question 20

Expand Down

0 comments on commit 78607c8

Please sign in to comment.