Skip to content

Commit

Permalink
Update 10-basic-exercise.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sajidhamdard authored Mar 13, 2024
1 parent 90d5068 commit 3f08258
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Exercises-And-Solutions/exercises/10-basic-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 @@ -28,9 +28,9 @@ $

Ask the user question "How many times do you want to print Series". Then print below series. For example below series will be printed if user enteres 5

2, 6, 30, 260, 3130
`2, 6, 30, 260, 3130`

Find the pattern for above series and print accordingly. If the user enters 10 then we will print the same series numbers total 10 times.
Find the pattern for above series and print accordingly. If the user enters 10 then we will print the same series total 10 times.

### Question 4

Expand All @@ -39,39 +39,38 @@ Using a switch case to do the below exercise:
- If number is odd then print "Odd"
- If number is even then print "Even"
- If number is 100 then print "100"
- Else print 10000
- Else print "10000"

### Question 5

Ask user his/her birth year, "What is your birth year?"

If user age is greater than 18 then ask user "Do you have valid license number?"
If user click on Okay then ask for his license number and finally in the alert show message "User with license number #### is ready to drive."
If user click on "Okay" button then ask for his license number and finally in the alert show message "User with license number #### is ready to drive.".

If user age is less than 18 then ask him question in confirm box "Do you have gaurdians ?""
If user says yes then ask his/her Gaurdian name and then in alert show "You are ready to drive with your #### (show gaurdian name here.)"
If user age is less than 18 then ask him question in confirm box "Do you have gaurdians?"
If user says yes then ask his/her Gaurdian name and then in alert show "You are ready to drive with your #### (show gaurdian name here.)"
Else show "Sorry visit again please." in alert box

### Question 6

Take any number and take other number as 19. Now check their difference by subtracting each other. If both numbers difference is greater than 19
then print triple their absolute difference else print double their absolute difference.
Take any number and take other number as 19. Now check their difference by subtracting each other. If both numbers difference is greater than 19 then print triple their absolute difference else print the double of their absolute difference.

### Question 7

Write a JavaScript program to check from two given integers, whether one is positive and another one is negative.

If yes then print sum of both the 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 4 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 4 numbers any of 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 palindrome or not. It means 141 and 12221 both are examples of palindrome number. If number is palindrome then print yes else print no
Write a program to check if a number is palindrome or not. It means 141 and 12221 both are examples of palindrome number. If number is palindrome then print "yes' else print "no".

### Question 10

Take a String and check its length. If string length is greater than 10 then print from 1 to length of the string. else print No
Take a String and check its length. If string length is greater than 10 then print from 1 to length of the string else print No.

0 comments on commit 3f08258

Please sign in to comment.