Name

You might also like

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

Name: Adrishikhar Chowdhury

Registration No. 4211113001

Computer Science
Project
Class:- XII Roll no.
27
Index
Serial Name of the topic Page
no. no.
1. Application Of C programming 1

a. Introduction 1

b. Aim of the project 1

c. Identification of the problem 1

d. Specification of the problem 1

e. Objective of the project 1

f. Operational definitions of the terms 2

2. Webpage designing using HTML 7

a. Design the Homepage: 7

b. Design the Diwali (hyperlinked) page: 8

c. Design the Durga Puja (hyperlinked) page: 9

d. Design the Eid-Ul-Fitr (hyperlinked) page: 9

e. Design the Christmas (hyperlinked) page: 10

f. Design the Holi (hyperlinked)page: 11

g. Output webpages 12
3. References 18
4. Conclusion 18
5. Acknowledgement 18
Application Of C Programming
Method Of Bisection
Introduction:-
The advent of high speed digital computers and it’s increasing use in
finding numerical solutions to problems of various branches of science and
engineering has led to increased demand of courses on numerical analysis.
Numerical analysis is concerned with methods which give numerical
solutions to mathematical problems by arithmetic operations of numbers.
The Bisection method is devoted to compute numerically the
roots of an equation of the form f(x)=x-4x-9. The method discussed here are
based on iterative techniques.

Aim of the project: -


To find the root of an equation f(x)=0 by the iterative technique and the
iteration terminates when the relative error becomes ≤ E(epsilon).

Identification of the problem: -


We have a polynomial equation y=f(x)= x ³-4x-9 and we have to
find the root of that equation by iteratively bisect the intervals and the root
finally lies between the intervals and we stop the process of iteration when the
relative error is less than or equal to the prescribed limit.

Specification of the problem: -


Thus ultimately I have identified the problem and the problem is
specified as Method Of Bisection.

Objective of the project: -


There are some basic objectives of the project that are listed
below
i. To know about the numerical analysis.
ii. Know about the convergence.
iii. Get an idea about the initial estimate values.
iv. Know about relative error.
(1)
v. Know about iterative technique.
vi. Finally to know how to implement numerical methods by C
programming language.

Operational definitions of the terms


i. Error: - Error is defined as the difference between the exact
value
and the approximate value.
Error =Actual value - Approx. value
=x-x a

Where x represents some quantity and x a is an approximation to x.


ii. Relative Error(E): -
Relative Error (E)= x +x a

iii. Bisection method: - If a function f(x) is continuous in the


closed interval [x1, x2] and f(x1) and f(x2) are of opposite signs, then,
there
exists at least one real root of f(x)= x ³-4x-9 between x1 and x2 .
iv. Convergence: - Convergence in mathematics of approaching
a limit more and more closely as an argument of the function.
 Methodology:
To solve bisection method problems, given below is the step-by-
step explanation of the working of the bisection method algorithm for a given
function f(x):

Step 1: Choose two values, a and b such that f(a) > 0 and f(b) < 0 .

Step 2: Calculate a midpoint c as the arithmetic mean between a and b such


that c = (a + b) / 2. This is called interval halving.

Step 3: Evaluate the function f for the value of c.

Step 4: The root of the function is found only if the value of f(c) = 0.
(2)

Step 5:If (c) ≠ 0, then we need to check the sign:


a. we replace a with c if f(c) has the same sign as f(a) and we keep
the same value for b
b. we replace b with c if f(c) has the same sign as f(b), and we keep
the same value for a.

To get the right value with the new value of a or b, we go back to step 2 And
recalculate c. 

 Algorithm:
1. Start
2. Read x1, x2, e
*Here x1 and x2 are initial guesses
e is the absolute error i.e. the desired degree of accuracy*
3. Compute: f1 = f(x1) and f2 = f(x2)
4. If (f1*f2) > 0, then display initial guesses are wrong and goto
(11).
Otherwise, continue.
5. x = (x1 + x2)/2
6. If ( [ (x1 – x2)/x ] < e ), then display x and go to (11).
* Here [ ] refers to the modulus sign. *
7. Else, f = f(x)
8. If ((f*f1) > 0), then x1 = x and f1 = f.
9. Else, x2 = x and f2 = f.
10.Goto (5).
*Now the loop continues with new values.*
11.Stop
(3)

 Flowchart: -
(4)
 Language Selection: - There are so many languages like
FORTRAN, C, C++ etc. are used to solve the numeric
problems. I have selected C programming language to solve
this problem according to our HS syllabus.
 Source Code: -
#include<stdio.h>
#include<math.h>
float fun (float x)
{
return (x*x*x - 4*x - 9);
}
void bisection (float *x, float a, float b, int *itr)
{
*x=(a+b)/2;
++(*itr);
printf("Iteration no. %3d X = %7.5f\n", *itr, *x);
}
int main()
{
int itr = 0, maxmitr;
float x, a, b, allerr, x1;
printf("\nEnter the values of a, b, allowed error and
maximum iterations:\n");
scanf("%f %f %f %d", &a, &b, &allerr, &maxmitr);
bisection (&x, a, b, &itr);
do
{
if (fun(a)*fun(x) < 0)
b=x;
else
a=x;
bisection (&x1, a, b, &itr);
if (fabs(x1-x) < allerr)
{
printf("After %d iterations, root = %6.4f\n", itr, x1);
return 0;
}
x=x1;
(5)

while (itr < maxmitr);


printf(“The solution does not converge or iterations are not
sufficient”);
return 1;
}
 Output:

 Limitations of the project: -


 Choosing a guess that is close to the root may necessitate
numerous iterations to converge.
 Some equations’ roots cannot be found. Because there are
no bracketing values, like f(x) = x².
 Its rate of convergence is linear.
 It is incapable of determining complex roots.
 If the guess interval contains discontinuities, it cannot be
used.
 It cannot be applied over an interval where the function
returns values of the same sign.

(6)
Webpage Designing Using HTML

Festivals Of India
(A) Design the Homepage:
<HTML>
<HEAD>
<TITLE>Festivals Of India</TITLE>
</HEAD>
<BODY BGCOLOR="#ffff99">
<B><I><FONT SIZE="+5"><P STYLE="COLOR:#e65c00">Festivals Of
India</FONT></P>
<P><FONT SIZE="+2">Festivals in India are celebrated in many parts of
India, as India is subdivided into different Linguistic States. The local
Government in each State also specifies certain festivals, in addition to
Central Government festivals and holidays, depending on the local population
which have elected them .</P>
<P>India is a multi-cultural country, and it is reflected in the Festivals of
India: Festivals of India is about various social, religious, and national
festivals celebrated in different parts of India. India has been rightly
described as a sub-continent and of its major festivals, many are region-
specific festivals too. There are many festivals which are celebrated as
national festivals; while a number of them are celebrated by members of
particular religious or social groups. India is a land of festivals. These Indian
festivals bind all Indians together of different castes, religions, etc there is no
discrimination while celebration. When there is no discrimination then it is
called INDIA .</P>
The major festivals are listed under:
<OL>
<LI><A HREF="Diwali.html">Diwali</A>
<LI><A HREF="Durga Puja.html">Durga Puja</A>
<LI><A HREF="Eid-Ul-Fitr.html">Eid-Ul-Fitr</A>
(7)
<LI><A HREF=”Christmas.html”>Christmas</A>
<LI><A HREF=”Holi.html”>Holi</A>
</OL></B></I></FONT>
</BODY>
</HTML>
(B) Design the Diwali (hyperlinked) page:
<HTML>
<HEAD>
<TITLE>Diwali</TITLE>
</HEAD>
<BODY BGCOLOR=”#ffcc00”>
<B><I><FONT SIZE=”+10”><P STYLE=”COLOR:#0055ff”>Diwali-
Festival of Lights
</P></FONT></B></I>
<B><I><FONT SIZE=”+2”><P>This pan Indian festival, famous for
lighting up our lives, Diwali is joyously celebrated globally now. Sending a
powerful message of the triumph of good over evil, the festival is celebrated in
every nook and corner of the country. People enjoy the festival of lights by
beginning the day with an auspicious pooja, followed by welcoming the night
with new traditional clothes, sweets and glowing deeyas. The houses are
decorated with garlands of electric lights and colourful rangolis. Ignite the
light of brotherhood and goodness in you being through the festival of
Diwali.</P></B></I>

<CENTER>
<IMG SRC=”C:\Users\amiad\Downloads\Notes\diwali.jpg” Height=”400”>
<A HREF=”Festivals of India.html”>To the main page</A></FONT>
</CENTER>
</BODY>
</HTML>
(8)
(C) Design the Durga Puja (hyperlinked) page:
<HTML>
<HEAD>
<TITLE>Durga Puja</TITLE>
</HEAD>
<BODY BGCOLOR="#ff8000">
<B><I><FONT SIZE="+10"><P STYLE="COLOR:#ffff00">Durga Puja-
Durgotsava or Navaratri</FONT></P>
<P><FONT SIZE="+2">A festival celebrating the powerful Goddess Durga,
Durga Puja is a major festival for the Bengalis in India. The colourful and
high energy festival is celebrated by decorating huge pandals, in the middle of
which a heavily decorated idol of Goddess Durga sits. The festival is marked
by a lot of dancing, singing and wholesome enjoyment. Celebrations of Durga
Puja in Kolkata is a can’t-miss sight, it is really a lifetime opportunity to
witness a festival in the heart of its existence.</P></B></I>
<CENTER>
<IMG SRC="C:\Users\amiad\Downloads\Notes\durga-pooja.jpg"
Height="400">
<A HREF="Festivals of India.html">To the main page</A></FONT>
</CENTER>
</BODY>
<HTML>
(D) Design Eid-Ul-Fitr (hyperlinked) page:
<HTML>
<HEAD>
<TITLE>Eid-Ul-Fitr</TITLE>
</HEAD>
<BODY BGCOLOR="#80ff80">
(9)
<B><I><FONT SIZE="+10"><P STYLE="COLOR:#006600">Eid-Ul-Fitr-
Marks the End of Ramadan</FONT>
<P><FONT SIZE="+2">Eid-Ul-Fitr is a major festival for Muslims in
India. The festival is marked by people visiting the mosque for an auspicious
prayer, wearing new clothes and preparing delicacies like sewainyan to be
savoured. Children are given idi, a small token of money as a gift and
relatives exchange sweets and gifts with each other. It is a festival that
celebrates brotherhood among humanity.</P></B></I>
<CENTER>
<IMG SRC="C:\Users\amiad\Downloads\Notes\eid-ul-fitr.jpg"
Height="400">
<A HREF="Festivals of India.html">To the main page</A></FONT>
</CENTER>
</BODY>
</HTML>
(E) Design the Christmas (hyperlinked) page:
<HTML>
<HEAD>
<TITLE>Christmas</TITLE>
</HEAD>
<BODY BGCOLOR="#e085c2">
<B><I><FONT SIZE="+10"><P STYLE="COLOR:#b30059">Christmas-
Birth of Jesus Christ</FONT>
<P><FONT SIZE="+2">The birth of Jesus Christ is celebrated with ecstatic
merriment and wonderful joy, throughout India. The warm smell of walnut
cakes can be inhaled in every household. As if captivated by a confetti of
Santa caps, Christmas sees the prevalence of these caps and reindeer
headgear decorating the heads of civilians. Many people decorate Christmas
trees in their homes with colourful stars and hanging balls. People also visit
the Church to seek the holy blessings of Christ on this auspicious
festival.</P>
<CENTER>
(10)

<IMG SRC="C:\Users\amiad\Downloads\Notes\christmas.jpg"
Height="400">
<A HREF="Festivals of India.html">To the main page</A></FONT>
</CENTER>
</BODY>
</HTML>
(F) Design the Holi (hyperlinked) page:
<HTML>
<HEAD>
<TITLE>Holi</TITLE>
</HEAD>
<BODY BGCOLOR="#80ffff">
<B><I><FONT SIZE="+10"><P STYLE="COLOR:#008000">Holi-
Festival of Colors</FONT>
<P><FONT SIZE="+2">The Pandora box of wholesome fun and good
natured pranks characterise the atmosphere in the colourful festival of Holi.
This festival is also slowly gaining popularity in the global sphere. Holi is
celebrated by throwing and applying colours on each other, in myriad hues of
jubilance. The festival is even played by throwing and splashing water on
each other, via a friendly weaponry of water guns and water balloons.
Immerse yourself in the pinks, greens and reds of Holi, and forget all your
blues for this day.</B></I></P>
<CENTER>
<IMG SRC="C:\Users\amiad\Downloads\Notes\holi.jpg" Height="400">
<A HREF="Festivals of India.html">To the main page</A></FONT>
</CENTER>
</BODY>
</HTML>
(11)

References: -
 Introductory Numerical Analysis – Dutta and Jana
 Programming in C – Byron Gottfried
 Numerical Analysis (2nd Edition) – Schield F
 ANSI C – E. Balaguruswamy
 Rudiments Of Computer Science – J. Bhattacharya

Conclusion: -
The project has been completed with the co-operation of the classmates
and the guidance of the teacher concerned and using C language. In the
course of the implementation of the project, various knowledge has been
acquired on various matters of importance. The experience and the
knowledge acquired while using C language will certainly be of much help in
implementing much larger projects in future.
Acknowledgement: -
It is a matter of great privilege for me to record my deep sense of
gratitude and thankfulness to M. Fadikar, Department of Computer Science,
Behala Aryya Vidyamandir, under the WBCHSE, to whom I am greatly
indebted for his ingenious guidance, valuable suggestions in various aspects
without which it would not have been possible for me to present this report. I
also wish to thank my friends for their cheerful smiles and moral support
which opened the gate of encouragement and made my work so much easier.

Signature of the student Signature of the teacher


(18)

You might also like