Search This Blog

Assignment 01 - Complete Java + DSA + Interview Preparation Course - Kunal Kushwaha

 

Assignment of Flow of Program - Flowcharts & Pseudocode - Video 02Kunal Kushwaha ]

Create flowchart and pseudocode for the following:

1. Input a year and find whether it is a leap year or not.

    Solution: 

Flow Chart

Pseudocode

1. Start
2. Input year in type int
3. if year%4==0 and year%100!=0 or year%400==0:
          output: Leap Year
    else:
          output: Non Leap Year
4. Stop

2. Take two numbers and print the sum of both.
    
    Solution: 

Flow Chart

Pseudocode

1. Start
2. Input num1 & num2 in type int
3. sum=num1+num2
4. output: sum
5. Stop


3. Take a number as input and print the multiplication table for it.
   
    Solution: 

Flow Chart

Pseudocode

1. Start
2. Input num in type int
3. multiplier=1
    while multiplier!=11:
            output: num*multiplier
             multiplier=multiplier+1
     end while
5. Stop


4. Take 2 numbers as inputs and find their HCF and LCM.

    Solution: Yet to do.

Flow Chart


Pseudocode


5. Keep taking numbers as inputs till the user enters ‘x’, after that print sum of all.

    Solution: 

Flow Chart





Pseudocode

1. Start
2. num = [ ] , add = 0
    while True:
          input s
          if s=='x' or s=='X':
                  for i in s:
                       add=add+int(i)
                   end for
                   output add
                    exit
           else:
                   num.append(s)
     end while
3. Stop



No comments:

Post a Comment