Вы находитесь на странице: 1из 15

TOPIC: SCIENTIFIC CALCULATOR

Submitted To:- Ms. Rupinder Kaur Cheema Submitted By:- Nupur Ahluwalia Roll No.:- B66 Section:- K1004 Date Of Submission:- 09-Nov-2011 Date Of Allotment:27-Aug-2011

CONTENTS
1. INTRODUCTION 2. FUNCTIONS 3. USES 4. BLOCK DIAGRAM/FLOW CHART 5. SOURCE CODE 6. REFERENCES

Introduction
A scientific calculator is a type of electronic calculator, usually but not always handheld, designed to calculate problems in science (especially physics), engineering, andmathematics. They have almost completely replaced slide rules in almost all traditional applications, and are widely used in both education and professional settings. In certain contexts such as higher education, scientific calculators have been superseded by graphing calculators, which offer a superset of scientific calculator functionality along with the ability to graph input data and write and store programs for the device. There is also some overlap with the financial calculator market.

FUNCTIONS

Modern scientific calculators generally have many more features than a standard four or five-function calculator, and the feature set differs between manufacturers and models; however, the defining features of a scientific calculator include: scientific notation floating point arithmetic logarithmic functions, using both base 10 and base e trigonometric functions (some including hyperbolic trigonometry) exponential functions and roots beyond the square root quick access to constants such as pi and e

In addition, high-end scientific calculators will include: hexadecimal, binary, and octal calculations, including basic Boolean math complex numbers fractions statistics and probability calculations programmability see Programmable calculator equation solving calculus conversion of units physical constants

While most scientific models have traditionally used a single-line display similar to traditional pocket calculators, many of them have at the very least more digits (10 to 12), sometimes with extra digits for the floating point exponent. A few have multi-line

displays, with some recent models from Hewlett-Packard, Texas Instruments, Casio, Sharp, andCanon using dot matrix displays similar to those found on graphing calculators.

Uses
Scientific calculators are used widely in any situation where quick access to certain mathematical functions is needed, especially those such as trigonometric functions that were once traditionally looked up in tables; they are also used in situations requiring back-of-the-envelope calculations of very large numbers, as in some aspects of astronomy,physics, and chemistry. They are very often required for math classes from the junior high school level through college, and are generally either permitted or required on many standardized testscovering math and science subjects; as a result, many are sold into educational markets to cover this demand, and some high-end models include features making it easier to translate the problem on a textbook page into calculator input, from allowing explicitoperator precedence using parentheses to providing a method for the user to enter an entire problem in as it is written on the page using simple formatting tools.

SOURCE CODE

#include<iostream.h> #include<dos.h> #include<windows.h> #include<process.h> #include<conio.h> #include<math.h> class simple { float a,b; public: void simple_arith(); void scientific_arith(); void menu(); void getdata() { cout<<"\n-----------------"; cout<<"\nEnter Values .. "; cout<<"\n-----------------"; cout<<"\n\nEnter A: "; cin>>a; cout<<"\nEnter B: "; cin>>b; } int sum() { return(a+b); }

int diff() { return(a-b); } int mul() { return(a*b); } float div() { return(a/b); }

};

void simple :: menu() { clrscr(); int ch; cout<<" \n ||||| CalculaTR Main Menu ||||| "; cout<<"\n\n1.Simple Arithmetic"; cout<<"\n\n2.Scientific Arithmetic"; cout<<"\n\n3.Exit"; cout<<"\n\nEnter your choice[1-3]: "; cin>>ch; switch(ch) { case 1: simple_arith(); break; case 2:

cout<<"Still to Program .."; scientific_arith(); break; case 3: cout<<"\nExiting ..."; getch(); exit(0); break; default: cout<<"\n\aInvalid Choice .. Try Again !!"; menu(); break;

void simple :: simple_arith() { clrscr(); int a,ch; float b; cout<<"||||| Simple Arithmetic Menu |||||"; cout<<"\n\n1.Add"; cout<<"\n\n2.Subtract"; cout<<"\n\n3.Multiply"; cout<<"\n\n4.Divide"; cout<<"\n\n5.Return to Previous Menu"; cout<<"\n\nEnter your choice [1-5]: "; cin>>ch; switch(ch) { case 1: getdata();

a=sum(); cout<<"\n\nSum = "<<a; getch(); cout<<"\n\nRedirecting to Main Menu .. "; getch(); menu(); break; case 2: getdata(); a=diff(); cout<<"\nDifference = "<<a; getch(); cout<<"\n\nRedirecting to Main Menu .. "; getch(); menu(); break; case 3: getdata(); a=mul(); cout<<"\nMultiplication = "<<a; getch(); cout<<"\n\nRedirecting to Main Menu .. "; getch(); menu(); break; case 4: getdata(); b=div(); cout<<"\nQuotient:"<<b; getch(); cout<<"\n\nRedirecting to Main Menu .. "; getch(); menu();

break; case 5: cout<<"\n\nRedirecting to Previous Menu .."; getch(); menu(); break; default: cout<<"\n\aInvalid .. Try Again .."; getch(); menu(); break; }

void simple :: scientific_arith() { clrscr(); int ch; int ang; int x,y; cout<<" ||||| Scientific Arithmetic Menu |||||"; cout<<"\n\n1. sin()"; cout<<"\n2. cos()"; cout<<"\n3. tan()"; cout<<"\n4. log()"; cout<<"\n5. Square Root"; cout<<"\n6. x^y"; cout<<"\n\nEnter your choice: "; cin>>ch; switch(ch) {

case 1: cout<<"\nEnter Angle in radians:"; cin>>ang; cout<<"\nSin("<<ang<<")"<<" = "<<sin(ang); cout<<"\n\nRedirecting to Main Menu ..."; sleep(2); menu(); break; case 2: cout<<"\nEnter Angle in radians:"; cin>>ang; cout<<"\nCos("<<ang<<")"<<" = "<<cos(ang); cout<<"\n\nRedirecting to Main Menu ..."; sleep(2); menu(); break; case 3: cout<<"\nEnter Angle in radians:"; cin>>ang; cout<<"\ntan("<<ang<<")"<<" = "<<tan(ang); cout<<"\n\nRedirecting to Main Menu ..."; sleep(2); menu(); break; case 4: cout<<"\nEnter Value:"; cin>>ang; cout<<"\nLog("<<ang<<")"<<" = "<<log(ang); cout<<"\n\nRedirecting to Main Menu ..."; sleep(2); menu(); break; case 5:

cout<<"\nEnter Value to find Square Root:"; cin>>ang; cout<<"\nSqrt("<<ang<<")"<<" = "<<sqrt(ang); cout<<"\n\nRedirecting to Main Menu ..."; sleep(2); menu(); break; case 6: cout<<"\nEnter Value for x in x^y: "; cin>>x; cout<<"\nEnter Value for y in x^y: "; cin>>y; cout<<"\n"<<x<<" raised to "<<y<<" = "<<pow(x,y); cout<<"\n\nRedirecting to Main Menu ..."; sleep(2); menu(); break; default: cout<<"\n\aInvalid Selection !!!! Try Again ..."; sleep(2); menu(); break; } }

void main() { clrscr();

simple s1; s1.menu(); getch();

Вам также может понравиться