IT Foundation Practice Assignments - PF V1
IT Foundation Practice Assignments - PF V1
1
Practice Assignments
Programming Foundation
Date – 13/12/2021
2
Copyright © 2020, Tech Mahindra. All rights reserved.
Instructions
Solve the assignments and submit on the recommended platform or save on your local machine and
show it to concerned faculty when asked. Mandatory assignments is MUST to complete. Based on time
you are lef t with you can attempt as many assignments from recommended section you can.
Discuss with your course mentor f or feedback and improvements if any. During the faculty connect
session, the course mentor will communicate how many and which assignments from the following set
are expected to be uploaded on the learning platform/shared location or keep it on your local machine.
Assignments
Mandatory
1) Write down code or PSEUDO algorithm to find out smallest and largest amongst 3 elements.
You can write program in any language you know (C/C++/Java/Python)
2) Write down code or PSEUDO algorithm to find out roots of a quadratic equation. Please note
that roots can be imaginary. You can write program in any language you know
(C/C++/Java/Python) OR even you can write PSEUDO Code.
3) Write PSEUDO code or code using the language you know (C/C++/Java/Python) for carrying
out following functionality around Matrix.
a) readMatrix function
b) displayMatrix function
b) AddMatrix function
Function should add two matrices to collect result in another matrix. (check if
number of rows and columns are same)
3
Copyright © 2020, Tech Mahindra. All rights reserved.
4) Write PSEUDO algorithm to perform an encryption as well as decryption of a file. Use any
algorithm to perform above said activity. Simplest possible algorithm is to read every character,
add 128 to it and stores it while performing an encryption and do reverse step while performing
a decryption. (You can even give a try to write program in C/C++/Java/Python)
Your program should a) Read a file character by character b) Encrypt a file d) Display contents
of file d) Decrypt a file
5) Write down an PSEUDO algorithm or code in language you know (C/C++/Java/Python) that
reads in a mark of a student (which is an integer between 0 and 100) and prints the corresponding
grades (A-F).
Grade A B C D F
Range ≥80 65-79 50-64 40-49 <40
1. Modify the program so that it checks if the input is between 0 and 100. If not, it should
ask the user to input again until the input is in the correct range. Use while statements.
2. Modify the program so that it repeats the above computation on 50 students. Use while
statements.
Recommended
6) Write down a code in (C/C++/Java/Python) or PSEUDO algorithm to get the weight (in
kilograms) and height (in meters) of a person. Then calculate and print the Body Mass Index (BMI)
according to the formula:
BMI = weight / (height*height)
The BMI should be printed with 3 decimal places. You should choose an appropriate data types
and names for your variables.
7) Write down a code in (C/C++/Java/Python) or PSEUDO algorithm that reads in the number of
seconds and converts it to hours, minutes and seconds. A sample output of your program is as
follows. Don’t bother with the singular or plural forms of the nouns.
4
Copyright © 2020, Tech Mahindra. All rights reserved.
9) Read in an integer between 0 and 99 and output the value in English. For example, if the input
is 28, it should output “twenty-eight”. You can write program in any language you know
(C/C++/Java/Python) OR even you can write PSEUDO Code.
10) Write down PESUDO algorithm or code in a language you know (C/C++/Java/Python) to
Reverse an array
11) Write down PESUDO algorithm or code in a language you know (C/C++/Java/Python) to
check whether string is a palindrome
12) Write down PESUDO algorithm or code in a language you know (C/C++/Java/Python) to sort
an array. Use any sorting algorithm.
13) Write down PESUDO algorithm or code in a language you know (C/C++/Java/Python) to
search an element an array.
5
Copyright © 2020, Tech Mahindra. All rights reserved.