PIC Assignment 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

K. J.

Somaiya College of Engineering, Mumbai-77

(A Constituent College of Somaiya Vidyavihar University)

Batch: C1 Roll No.: 16010121157

Experiment / assignment / tutorial No. 1

Grade: AA / AB / BB / BC / CC / CD /DD

Signature of the Staff In-charge with date


TITLE: Write a program for:
a. Program to find area and circumference of various Geometric shapes.

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)

AIM: Write a program for:


a. Program to find area and circumference of various Geometric shapes.

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

Problem 2: Calculating EMI

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.

Formula to be used: (E = (P.r.(1+r)n ) / ((1+r)n – 1)

Flowchart:

Problem1:

start

Input: Enter radius

Calculate area

Calculate circumference

Output:
Department of Sciencearea
and Humanities

Page No. PIC Sem I 2021-2022 (Odd Sem)


K. J. Somaiya College of Engineering, Mumbai-77

(A Constituent College of Somaiya Vidyavihar University)

Output: circumference

stop

Problem2 :

start

Input: Enter
principal amount

Input: Enter rate


of interest
Calculate EMI

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);

Department of Science and Humanities

Page No. PIC Sem I 2021-2022 (Odd Sem)


K. J. Somaiya College of Engineering, Mumbai-77

(A Constituent College of Somaiya Vidyavihar University)

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:

Department of Science and Humanities

Page No. PIC Sem I 2021-2022 (Odd Sem)


K. J. Somaiya College of Engineering, Mumbai-77

(A Constituent College of Somaiya Vidyavihar University)

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

illustrates a solution model to a given problem.

The different symbols in a flowchart

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.

4)The diamond: Used to indicate a point at which a decision has to be made.

5)The flowlines –Used to indicate the flow of the operation.

Department of Science and Humanities

Page No. PIC Sem I 2021-2022 (Odd Sem)


K. J. Somaiya College of Engineering, Mumbai-77

(A Constituent College of Somaiya Vidyavihar University)

Date: _____________ Signature of faculty in-charge

Department of Science and Humanities

Page No. PIC Sem I 2021-2022 (Odd Sem)

You might also like