Free Essay

Calculater

In:

Submitted By vinodgoyal
Words 1832
Pages 8
[pic]

CSE-151

TERM PAPER
TOPIC: CALCULATOR

SUBMITTED TO: SUBMITTED BY:
Mr. Anand Kumar Kumar Gaurav Roll No.: 27 Dept. Of CSE Section: 257(G2) Regd. No.: 10805952

ACKNOWLEDGEMENT

I would like to express my gratitude to all those who have helped me in the successful completion of my project. I want to thank the Department of CSE of Lovely Professional University for giving me permission to commence on this project. I would like to thank MR. ANAND KUMAR for helping me somehow and encouraged me to go ahead with my project.
Especially, I would like to give my special thanks to my mother whose patient love enabled me to complete this work.

TABLE OF CONTENTS

1. INTRODUCTION

2. INTRODUCTION OF PROJECT

3. PROPOSED SYSTEM

(i) DESCRIPTION

(ii) SYSTEM REQUIREMENTS

3. REQUIREMENTS ANALYSIS

4. USING FUNCTIONS

5. SOURCE CODE

6. FUTURE SCOPE OF PROJECT

7. BIBLIOGRAPHY

Introduction:

C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dannis Ritchie. In the late seventies C began to replace the more familiar language of that time like PL/I, ALGOL, etc. No one pushed C. It was not made the ‘official’ Bell Labs language. Thus, without any advertisement, C’s reputation spread and its pool of users grew. Ritchie seems to have been rather surprised that so many programmers preferred C to older language like FORTRAN or PL/I, or the newer ones like Pascal and APL. But, that’s what happened.

Possibly why C seems so popular is because it is reliable, simple and easy to use. Moreover, in an industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that survived for more than three decades has to be really good.

An opinion that is often heard today is - “ C has been already superceded by language like C++, C# and Java, so why bother to learn C today”. I seriously bag to differ with this opinion. There are several reasons for this:

a) I believe that nobody can learn C++ or Java directly. This is because while learning these languages you have things like classes, objects, inheritance, polymorphism, templates, exception handling, references, etc. do deal with apart from knowing the actual language elements. Learning these complicated concepts when you are not even comfortable with the basic language elements is like putting the cart before the horse. Hence one should first learn all the language elements very thoroughly using C language before migrating to C++, C# or Java. Though this two step learning process may take more time, but at the end of it you will definitely find it worth the trouble.

b) C++, C# or Java make use of a principle called Object Oriented Programming (OOP) to organize the program. This organizing principle has lots of advantage to offer. But even while using this organizing principle you would still need a good hold over the language elements of C and the basic programming skills.

c) Though many C++ and Java based programming tools frameworks have evolved over the years the importance of C is still unchallenged because knowingly or unknowingly while using these frameworks and tools you would be still required to use core C language elements- another good reason why one should learn C before C++, C# or Java.

d) Major parts of popular operating system like windows UNIX, Linux are still written in C. This is because even today when it comes to performance (speed of execution) nothing beats C. Moreover, if one is to extend the operating system to work with new devices one needs to write device driver programs. These programs are exclusively written in C.

e) Mobile device like cellular phones and palmtops have become rage of today. Also, common consumer device like microwave ovens, washing machines and digital cameras getting smatter by the day. This smartness comes from the microprocessors, an operating system and program embedded in these devices. These programs not only have to run fast but also have to work in limited amount of memory. No wonder that such programs are written in C. With these constrains on time and space c is language of choice while building such operating systems and programs.

f) You must have seen several professional 3D computer games where the user navigates some objects, like say a spaceships and fires bullets at the invaders. The essence of all such games is speed. Needless to say, such games won’t become popular if they takes a long time to spaceship or to fire a bullet. To match expectation of the player the game has to react fast to the user input. This is where C language scores over other languages. many popular gaming frameworks have been built using C language.

g) At times one is required to very closely interact with the hardware devices. Since C provides several language elements that makes this interaction feasible without compromising the performance it is the preferred choice of the programmer.

Introduction of project:

The topic of my project is “CLCULATOR”. This program has main focus on scientific calculation. It makes calculation very easier. It will definitely help to solve the calculation. My project is very different to the older version in such a way that it is more users friendly and stores records than usual. All and over it is compact and easy to use.

PROPOSED SYSTEM

DESCRIPTION:

My software deals with calculator. I have used various decision statements like switch, if and else and various functions. C language really proved to be very helpful in building of my software as it is very user friendly and is structured language. It allows the programmer to work in small modules called functions. Thus my software will help in reducing the various scientific calculation.

SYSTEM REQUIREMENTS:

OPERATING SYSTEM: WINDOWS XP OR WINDOW VISTA

VERSION OF C: TURBO C++ (VERSION 4.5)

PROCESSOR: PENTIUM 4 @ 2.00 GHz OR HIGHER

MEMORY (RAM): 128 MB OR HIGHER

SYSTEM TYPE: 32 BIT OPERATING SYSTEM

REQUIREMENT ANALYSIS:

My system model is Lenovo Vista PC. The processor is Intel core 2 duo. With Intel Core 2 Duo desktop processor, the PC experiences a revolutionary performance, unbelievable system responsiveness, and energy-efficiency second to none. It gives

• Up to 6MB L2 cache
• Up to 1333 MHz front side bus
The RAM memory of my computer is 2 GB. Here goes the function of RAM: All of the data is held on the Hard Disk Drive - even Windows is stored there. When the computer is running, whenever it needs to open a program, file, or run a process that it hasn't in a while, it accesses the Hard Drive and runs the process that it's looking for through the processor. While it is processing, it may need to store and access numbers. These numbers are stored in the RAM (Random Access Memory). It completes processes by doing this routine over and over until the computer is turned off. RAM does not hold any amount of data that we can access - only the machine can. The breakdown of RAM is:
1 Gigabyte = 1024 Megabyte
1 Megabyte = 1024 Kilobytes
1 Kilobyte = 1024 Bytes
1 Byte = 8 bits
1 bit = 1 binary number (a 1 or a 0)

So, 2 Gigs of ram holds appx. 8.60 x 10^9 bits.
My PC works as a 32-BIT operating system. A 32-bit operating system is
A binary digit, or bit, is the smallest unit of data that a computer

can process. All other things being equal, the more bits your computer

can process at the same time, the faster it is.

Most desktop computers manipulate bits in groups of 16 or 32. If you

have two computers whose clock (processing) speed is identical, and one

processes 32 bits at a time while the other processes 16, the 32-bit

computer will be about twice as fast.

USING FUNCTION
In my software program used following types of functions:- 1. PRINTF function: - This function used for display the given data by the user through the keyboard. 2. SCANF function:- This function used for input the data by the user. 3. IF & ELSE statement:- This function used for check the condition where the condition is true, executed the body of true block and if the true condition is false else body will be executed. 4. SWITCH statement:- It is used for generally for menu driven program, while using this function user directly go to the case where the user want to go, respected body will be executed. 5. BREAK statement:- It is used for getting out from the switch case. 1. Header files

Ex. , etc.

2. Switch case

Ex. Case1,case2.

1.3. Break

4. Function

Ex. Void.

5. Control statement

Ex. And, or,not etc.

6. logical statement

Ex. If,ifelse,nestedif etc.

SOURCE CODE

#include
#include
#include
#include
#include
#include
void main()
{
clrscr(); int i; printf("**** WELCOME TO THE CALCULATION WORLD ****"); printf(" \n****NOW CHOOSE ONE OF THE FOLLOWING OPTIONS ****"); printf("\n {1} ADDDITION "); printf("\n {2} SUBTRACTION "); printf("\n {3} MULTIPLICATION "); printf("\n {4} DIVIDE "); printf("\n {5} POWER "); printf("\n {6} SQUAREROOT"); printf("\n {7} INVERSE"); printf("\n {8} FACTORIAL"); printf(“\n {9} EXIT “); printf("\n PLEASE ENTER THE VALUE \n"); printf(" "); scanf(" %d",&i);

switch(i)
{
case 1:

int a,b,z,sum=0; printf("\n ENTER FIRST NUMBER "); scanf("%d",&a); printf("\n ENTER SECOND NUMBER "); scanf("%d",&b); z=a+b; sum=z; printf("\nSUM IS %d",sum); break; case 2: int c,d,subtraction=0; printf("\n ENTER FIRST NUMBER "); scanf("%d",&c); printf("\n ENTER SECOND NUMBER "); scanf("%d",&d); if(c>d)
{
subtraction=c-d; printf("SUBTRACTION IS =%d",subtraction);
}
else
{
subtraction=d-c; printf("SUBTRACTION IS -%d",subtraction);
}
break;

case 3: int e,f,multiplication=0; printf("ENTER THE FIRST NUMBER "); scanf("%d",&e); printf("\nENTER SECOND NUMBER "); scanf("%d",&f); multiplication=e*f; printf("MULTIPLICATION IS =%d",multiplication); break; case 4: int g,h,remainder=0,quotient=0; printf("ENTER THE FIRST NUMBER "); scanf("%d",&g); printf("\nENTER SECOND NUMBER "); scanf("%d",&h); remainder=g%h; quotient=g/h; printf("REMAINDER=%d",remainder); printf("\nQUOTIENT=%d",quotient); break;

case 5: int j,k,power=0; printf("FIRST NUMBER IS BASE AND SECOND IS POWER\n"); printf("ENTER FIRST NUMBER "); scanf("%d",&j); printf("\nENTER SECOND NUMBER "); scanf("%d",&k); power=pow(j,k); printf("POWER VALUE IS=%d",power); break; case 6: float l,squareroot=0; printf("ENTER THE VALUE OF WHICH WE HAVE TO FIND SQUARE ROOT "); scanf("%d",&l); squareroot=sqrt(l); printf("THE SQUARE ROOT =%d",squareroot); break; case 7: float m; float n; printf("ENTER THE VALUE FOR WHICH WE HAVE TO FIND INVERSE "); scanf("%f",&m); n=1/m; printf("INVERSE IS =%f",n); break; case 8: int fact=1,o,p,q;

printf("ENTER THE VALUE FOR WHICH WE HAVE TO FIND FACTORIAL "); scanf("%d",&o); for(p=1;p

Similar Documents

Free Essay

Visual Basic Calculater

...Public Class Form1 Dim m, num, count As Double Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click TextBox1.AppendText("7") End Sub Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click TextBox1.AppendText("9") End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.AppendText("1") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.AppendText("2") End Sub Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click TextBox1.AppendText("3") End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click TextBox1.AppendText("4") End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click TextBox1.AppendText("5") End Sub Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click TextBox1...

Words: 858 - Pages: 4

Free Essay

Give the Marits of a Spreadsheet over a Calculater

...HCS210-Exercise 1 The following information was obtained from the books of JB Ncube , sole proprietor who operates a grocery shop in Gweru Central District for the month of January 2011. Jan 1 : JB Ncube deposited $30 000 capital in the business bank account. : paid rent by cheque $ 2000. Jan 3 : Bought goods and issued a cheque $ 12000. Jan 4 : Sold goods for cash $ 15000. Jan 7 : Bought goods on credit from the following suppliers; Makanakaishe traders $ 5000 Jaggers Wholesalers $ 7000 Chic Traders $ 15000. Jan 10: Returned goods to the following suppliers ; Makanakaishe $ 500 Jaggers $ 1000. Jan 12: JB Ncube used goods worth $ 2000 at cost for personal use. Jan 15: Issued cheques to the following suppliers: Makanakishe $3 900 in full settlement of the amount owing. Jaggers Wholesalers $ 5000. Chic Traders $ 13000. Jan 17: Obtained a bank Loan for $ 40 000 from CBZ Ltd. Jan 20: Sold goods on credit to the following customers; Mashanda $ 14 500 Mangwaya $ 15 500 Jan 22: The following customer returned goods they had bought on credit; Mashanda $ 500 Mangwaya $ 1000. Jan 23: The following deposits were made by debtors into the business bank account Mashanda $ 14 000 in full settlement of the amount owing Mangwaya $ 10 000. Jan 25: Bought a Motor vehicle for use in business by cheque $ 10 000. Jan 27 : JB Ncube introduced his personal equipment with a value of $ 5000 . Jan 30 : Paid for...

Words: 321 - Pages: 2

Premium Essay

Time Value for Money

...four years in the savings account with 3% interest on $5000 compounded annually I would have $5627.54 Compounded semiannually $5632.46 Now change the interest rate to a lower rate. How much will you have at the end of four years if interest is compounded annually at a rate of 2%? How much would you have at the end of four years if interest is compounded semiannually? After four years in the savings account with 2% interest on $5000 compounded annually I would have $5412.16 Compounded semiannually $5414.28 You have $10,000 in credit card debt, at a 14% interest rate. When is it beneficial to pay off the debt vs. putting money in a savings account? Explain the pros and cons of either option. By using the bankrate.com site calculater I was able to find that if I had $10,000 in credit card debt with a 14% interest rate it would take me over 27 years to pay off this debt only paying the minimum balance. Also I would pay $11,166.66 in interest charges. If I paid on this debt with a fixed monthly amount ,such as $217, I can have this credit card debt paid off in about 5 and a half years. Paying only $4432.09 in interest charges. Depending on my income I might be able to save alittle and py on my debt. I think that in the end it will be better to pay...

Words: 428 - Pages: 2

Premium Essay

Using Material for Item a and Elsewhere, Asses the Importance of Cultural Factors in Causing Social Class Differences in Education Achievement.

...Achievement. working-class students have usually underachieved in school, in contrast to middle-class students, this is due to external and internal factors. External cultural factors are claimed to be a key cause of social class differences in educational achievement according to various sociologist. These factors consist of Cultural deprivation, cultural capital and material deprivation. working class students' backgrounds are often linked with poverty more than any other class, this explains to material deprivation which these pupils are going through, as the students cannot afford money to buy all the equipment that they need for education, tanner et al found that the cost of items such as transport, uniform, books, coputer, calculater and sports equipment places a very heavy burden on poorer families . To support this claim sociologist Flaherty also states that having money problems in the family were a significant factor in younger children’s low attendance at school, which links to under achievements at school. The idea that children from working class backgrounds is also supported by sociologist Howard. Her claim is that children from poorer homes tend to have lower intakes of energy, vitamins and minerals. This will ten result in absences from school which is proven to have a big impact on education achievement. In addition to this Wilkinson has studied a series of ten year olds, the lower the social background the higher the rate of hyperactivity, anxiety...

Words: 265 - Pages: 2

Premium Essay

Mobile Phone a Ban or Boon

...Since the dawn of human civlisation man has been creating things to meet his needs. Mobile phone is one such , portable electronic device. They are now inexpensive, easy to use, comfortable and equipped with almost every latest feature we desire such as calculater internet games camer and many more. They are also known as lifesavers as they can help people in emergencies. For instance disaster response crews can locate trapped or injured people using the signals from their mobile phones or the small detonator of flare in the battery of every cell phone; and for students also they are equally applicable . A coin has 2 faces. Likewise,mobile phones has its own demerits. Mobile phone - A boon You can carry a mobile phone with you so you don 't miss important calls If you are lost, you can call for directions. If you are in an accident, you can call the police or ambulance - and if the phone has a camera, you can take pictures of the accident. You can listen to music, text, play games when you 're bored. Most mobile phones have a calculator and a phone book. You can use a mobile phone to call your customers or boss if you are running late to a meeting. You can surf Internet & Connect with the whole world by Mobile. You can chat & video conference. Keep in touch with friends and family Good for emergencies Employees can keep in touch at all times. Customers can contact staff 24/7 Phones have internet connection More work available They have cameras You can check your emails Can be...

Words: 413 - Pages: 2

Premium Essay

It- 3rd Year

...E-COMMERCE (TIT-501) UNIT I Introduction What is E-Commerce, Forces behind E-Commerce Industry Framework, Brief history of ECommerce, Inter Organizational E-Commerce Intra Organizational E-Commerce, and Consumer to Business Electronic Commerce, Architectural framework Network Infrastructure for E-Commerce Network Infrastructure for E-Commerce, Market forces behind I Way, Component of I way Access Equipment, Global Information Distribution Network, Broad band Telecommunication. UNIT-II Mobile Commerce Introduction to Mobile Commerce, Mobile Computing Application, Wireless Application Protocols, WAP Technology, Mobile Information Devices, Web Security Introduction to Web security, Firewalls & Transaction Security, Client Server Network, Emerging Client Server Security Threats, firewalls & Network Security. UNIT-III Encryption World Wide Web & Security, Encryption, Transaction security, Secret Key Encryption, Public Key Encryption, Virtual Private Network (VPM), Implementation Management Issues. UNIT - IV Electronic Payments Overview of Electronics payments, Digital Token based Electronics payment System, Smart Cards, Credit Card I Debit Card based EPS, Emerging financial Instruments, Home Banking, Online Banking. UNIT-V Net Commerce EDA, EDI Application in Business, Legal requirement in E -Commerce, Introduction to supply Chain Management, CRM, issues in Customer Relationship Management. References: 1. Greenstein and Feinman, “E-Commerce”, TMH 2. Ravi Kalakota, Andrew Whinston...

Words: 2913 - Pages: 12