Professional Documents
Culture Documents
PIC Assignment 1
PIC Assignment 1
PIC Assignment 1
Grade: AA / AB / BB / BC / CC / CD /DD
b. Program to calculate EMI (Equated Monthly Instalment) of loan amount if principal, rate of interest and time in years is given by the user. (E = (P.r.(1+r)n ) / ((1+r)n – 1)
b. Program to calculate EMI (Equated Monthly Instalment) of loan amount if principal, rate of interest and time in years is given by the user. (E = (P.r.(1+r)n ) / ((1+r)n
-1)
____________________________________________________________
Expected OUTCOME of Experiment:
_____________________________________________________________________
Books/ Journals/ Websites referred:
1. Programming in ANSI C, E. Balagurusamy, 7 th Edition, 2016, McGraw-Hill Education, India.
2. Structured Programming Approach, Pradeep Dey and Manas Ghosh, 1 st Edition, 2016, Oxford University Press, India.
3. Let Us C, Yashwant Kanetkar, 15th Edition, 2016, BPB Publications, India.
_____________________________________________________________________
Problem Definition:
Problem 1 : Area and Circumference of any shape(will be given by instructor) (example Circle)
Ask user to enter the value of radius of a circle. Put the values in the formula for finding area of a circle and circumference of a circle and print the
outcome for area of a circle and circumference of a circle
Ask the user to enter the value of principle amount, rate of interest and time (in years).Store the value in E and print the final monthly instalment E as
an outcome.
Flowchart:
Problem1:
start
Calculate area
Calculate circumference
Output:
Department of Sciencearea
and Humanities
Output: circumference
stop
Problem2 :
start
Input: Enter
principal amount
Input:Output:
Enter EMI
time
in years
stop
Implementation details:
Program1 :
#include <stdio.h>
#include <stdlib.h>
int main()
{
float r, area, circumference;
printf("enter the value of radius of circle=");
scanf("%f",&r);
area= 3.14*r*r;
circumference= 3.14*2*r;
printf("the area of the circle is = %f\n", area);
printf("the circumference of the circle is = %f\n",circumference);
return 0;
}
Program2:
#include <stdio.h>
#include <stdlib.h>
int main()
{
float p,r,n;
printf("enter the value of principle amount= ");
scanf("%f",&p);
printf ("enter the rate of interest= ");
scanf("%f", &r);
printf ("enter the time (in years)= ");
scanf("%f", &n);
float E = (p*r*(1+r)*n)/(((1+r)*n)-1);
printf("the final monthly installment = %0.3f",E);
return 0;
}
Output(s):
Program 1:
Program 2:
Conclusion:
Post Lab Descriptive Questions
1. Describe problem definition phase with one case study.
2. What is a flowchart? What are the standard symbols used to draw a flow chart? Explain in brief.
A flowchart is a type of diagram that represents an algorithm, workflow or process. The flowchart shows the steps as
boxes of various kinds, and their order by connecting the boxes with arrows. This diagrammatic representation
1)The Oval: An End or Beginning While Creating a Flowchart. The oval, or terminator, is used to represent the start and
end of a process.
2)The rhombus :this is used for output or input operations . the data to be read or printed are written inside the symbol
3)The rectangle: Used for arithmetic and data manipulation operations. The instructions are listed inside the symbol.