0% found this document useful (0 votes)
71 views2 pages

Arrays Programming Practice for Students

The document provides 4 programming problems involving arrays: 1) A program to calculate class average and display a message if more than 2 students score below average. 2) A menu-driven bank program to store customer details in arrays and perform operations like balance lookup. 3) Problems finding the odd-occurring number in an array, displaying duplicate elements, and minimum difference between array elements. 4) A program to calculate and sort the areas of 6 triangular plots of land using sine law.

Uploaded by

Kishore Raja
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views2 pages

Arrays Programming Practice for Students

The document provides 4 programming problems involving arrays: 1) A program to calculate class average and display a message if more than 2 students score below average. 2) A menu-driven bank program to store customer details in arrays and perform operations like balance lookup. 3) Problems finding the odd-occurring number in an array, displaying duplicate elements, and minimum difference between array elements. 4) A program to calculate and sort the areas of 6 triangular plots of land using sine law.

Uploaded by

Kishore Raja
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

******

You might also like