Skip to content

Commit

Permalink
Update 11-basic-test-exercise.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sajidhamdard authored Mar 13, 2024
1 parent 3f08258 commit 7759e5c
Showing 1 changed file with 16 additions and 28 deletions.
44 changes: 16 additions & 28 deletions Exercises-And-Solutions/exercises/11-basic-test-exercise.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
### Question 1

Write a JavaScript function to capitalize the first character of the string.
Write a javaScript function to capitalize the first character of the string. For example:

```
for example:
allenacademy
output:
//output:
Allenacademy
```

### Question 2

Write a JavaScript function to insert a string within a string at a particular position
Write a javaScript function to insert a string within a string at a particular position. For example:

```
for example:
We are learning exercises.
now insert the word JavaScript at 14 position so output will be :
//now insert the word JavaScript at 14 position so output will be :
We are learning JavaScript exercises.
```
Expand All @@ -30,7 +28,7 @@ Write a JavaScript function to count the occurrence of a substring in a string.
```
"My name is allen academy and my friend name is Arun Kumar."
find count of 'is' in this word is 2.
//find count of 'is' in this word is 2.
```

### Question 4
Expand All @@ -45,14 +43,14 @@ Ask user below questions:

Now do below tasks:

1. Mask last 3 digits of the mobile number
2. Mask middle of 5 numbers of the account
3. Mask last 8 digit of atm card number
4. Mask starting 4 digits and last 4 digits of aadhar number
1. Mask last 3 digits of the mobile number.
2. Mask middle of 5 numbers of the account.
3. Mask last 8 digit of atm card number.
4. Mask starting 4 digits and last 4 digits of aadhar number.

### Question 5

Print below pattern using repeat function
Print below pattern using repeat function:

```
$
Expand All @@ -75,32 +73,22 @@ Ask below questions :

Now using string template literal syntax show below output based on your answer:

My name is Sajid Khan. I was born in 1993 and my current age is 30 years. My address is Jhotwara, Jaipur and my mobile number is +919565465654.
`My name is Sajid Khan. I was born in 1993 and my current age is 30 years. My address is Jhotwara, Jaipur and my mobile number is +91956546565456`.

### Question 7

Divide a string in two part.

Now in right side part add Hello in the end
In left side of the string add World in starting

for example:
Divide a string in two part. Now in right side part of string add "Hello" in the end. In left side of the string add "World" in starting. For example:

```
let str = "Allen Academy"
output:
//output:
Allen Hello World Academy
```

### Question 8

Guessing Game?
Ask user what character is present at particular index in a word.

If user guess is right then show him Congrulations message otherwise show Sorry message.

for example:
Guessing Game. Ask user what character is present at particular index in a word. If user guess is right then show him Congrulations message otherwise show Sorry message. For example:

```
Allen Academy
Expand All @@ -113,7 +101,7 @@ Sorry

### Question 9

Print Pattern using repeat function
Print pattern using repeat function:

```
***********
Expand All @@ -126,7 +114,7 @@ Print Pattern using repeat function

### Question 10

Print below Series using repeat function
Print below series using repeat function:

```
1 224 3339 44412 555520
Expand Down

0 comments on commit 7759e5c

Please sign in to comment.