Array Practice - level 1 Questions
1. A Flowgorithm Script that reads marks of ‘n’ students of a class and displays the class
average. Also if more than 2 students have marks less than class average, display a
suitable message.
2. Write a menu driven program for a bank. Read the following details of ‘n’ customers:
customer id(a 4 digit number), current balance and perform the following operations
(menu driven- choice based)
a. Read a customer id number and display the balance for that customer
b. Display the id of the customer with highest balance.
c. Display an error message if the search fails
Hint: Create 2 arrays: id[] and balance[]. Store the customer details in such a way that if
the id of a particular customer is stored at id[k], then his/her balance will be stored in
balance[k].
Array practice set – level 2
1) Write a flowgorithm to find the Number Occurring Odd Number of Times in an
array.
Input :arr = {1, 2, 3, 2, 3, 1, 3}
Output : 3
Input :arr = {5, 7, 2, 7, 5, 2, 5}
Output : 5
2) Write a flowgorithm to display all the duplicates elements in the array.
3) Write a flowgorithm to find minimum difference between any two elements.
Given an unsorted array arr[] of size n, the task is to find the minimum difference
between any pair in the given array.
Input: arr[] = {1, 2, 3, 4}
Output: 1
The possible absolute differences are:
{1, 2, 3, 1, 2, 1}
Input: arr[] = {10, 2, 5, 4}
Output: 1
4) The area of a triangle can be computed by the sine law when 2 sides of the triangle
and the angle between them are known. Area = (1 / 2 ) ab sin ( angle )
Given the following 6 triangular pieces of land, write a program to find their area
and arrange them in the decreasing order of their area.
Plot No. A b angle
1 137.4 80.9 0.78
2 155.2 92.62 0.89
3 149.3 97.93 1.35
4 160.0 100.25 9.00
5 155.6 68.95 1.25
6 149.7 120.0 1.75
******