This Assignment is specially designed for the Class and Lab Assignment portion. Separate submission for Class will be creating on Moellim and for Lab, you can submit here Submission is created below the Tasks. 

 The deadline for Both Class and Lab Assignment Submission will be on Sunday 13/12/2020 No further relaxation.

Concept:

                                        Nested Loops & Arrays 

Objective: to revision Array concepts and get familiar with the patterns using loops.

Background: Student should have concepts of Arrays data structure and loops

Pre-Lab: Students should implement all lab-related arrays and loops.

Assessment tools:

The assessment is according to the student participation in the lab if the student solves the exercise, he will get the participation mark for this lab.

Lab assignment:

Q1: Fibonacci Series up to n number of termssee the definition of Fibonacci on any online resource

Output

Enter the number of terms: 10

Fibonacci Series: 0, 1, 1, 2, 3, 5, 8, 13, 21, 3

Q2: Find a Factorial of a given number. see the definition of factorial on any online resource. 

Output

Enter a positive integer: 12

Factorial of 12 = 479001600

Q3:  Print Following Pattern using nested loops

Output

1

2 2

3 3 3

4 4 4 4

5 5 5 5 5

 

Q4: Write a program which prints the Mode number form the entered 10 number using Arrays for an instant if user enter 1,2,3,4,4,5,4 then the system will print 4 because the mode is a number that repeats more than other numbers.

Q5: write a program which takes input characters in the array and print the count of Capital and small letters entered in the array.

Q6:  Print Following Pattern using nested loops

Output

*****

*****

*****

***** 

 

Q6:  Print Following Pattern using nested loops

Output

*****

****

***

**

*

 

Q7:  Print Following Pattern using nested loops

Output

*

**

***

****

*****

*****

****

***

**

*


Q8:  Print Following Pattern using nested loops

Output

 

     *

    **

   ***

  ****

 *****

 

Q9:  Print Following Pattern using nested loops

Output

 

     *

    **

   ***

  ****

 *****

 ****

  ***

  **

   *


Q10:  Print Following Pattern using nested loops

Output

 

     *

    **

   ***

  ****

 *****
  **
  **
  **

  **

  Note: Please submit Class tasks and Assignment tasks in different files for example for class tasks make different files and name it ClassTasks.doc and for Assignment tasks make different files and name that file as AssignmentTasks.doc. Marks will be deducted if you do not follow the pattern.

 

Post a Comment

Previous Post Next Post