#Trigonometric Formulas for Class 10
Explore tagged Tumblr posts
speedywonderlandtrash · 8 months ago
Text
Class 9 Math Annual Exam with Model 3
Tumblr media
Class 9 Math Annual Exam with Model 3
  Class 9 math exam preparation guide,last minute math exam tips for Class 9,Class 9 math practice questions and solutions,model 3 math prep for Class 9 exam,effective study techniques for Class 9 math exam Math Time: 3                              Hours Class: 9                     Total Marks: 100 Section A: Objective (25 Marks) Multiple Choice Questions: (Write the correct answer on the answer sheet) 1 × 15 = 15 1. a, ar, ar², ar³ is which type of sequence? (a) Geometric (b) Arithmetic (c) Infinite (d) Constant 2. If 7x + 2, 5x + 12, 2x - 1 form an arithmetic progression, what is the value of x? (a) -23 (b) 23 (c) ±23 (d) 21 3. What is the 15th term of the sequence 4 + 8 + 16 + ........? (a) 65536 (b) 131072 (c) 146384 (d) 32768 4. logb n , what is the argument? (a) k (b) n (c) b (d) log 5. What is the base of lnx? (a) e (b) 10 (c) x (d) y 6. What is logbAx? (a) x (b) A (c) b (d) xlogbA 7. If the sum and difference of the digits of a two-digit number are 10 and 4 respectively, what is the number? (a) 47 (b) 27 (c) 37 (d) 57 8. Which point is on the x-axis? (a) (2, 0) (b) (-3, 5) (c) (0, 3) (d) (-2, -2) 9. For θ = 45° - i. sin2 θ + tan2 θ = ii. sin2 θ + cos2 θ = iii. 1 - sin2 θ = Which of the following is correct? (a) i and ii (b) i and iii (c) ii and iii (d) i, ii, and iii 10. Based on the following information, answer questions 10 and 11: In right-angled triangle ABC, ∠C = β, ∠B = α, AB = 7, BC = 25 cm, and AC = 24 cm. What is the length of the side opposite to angle β? (a) 7
Tumblr media
(b) 24 (c) 25 (d) 6 11. For which of the following angles is the length of the adjacent side 24 cm? (a) α (b) β (c) α + β (d) α - β 12. In the first quadrant, how are all trigonometric ratios? (a) Positive (b) Negative (c) 0 (d) Even 13. What is cos 150°? (a) (b) (c) - (d) - 14. How many types of data are there? (a) 2 (b) 3 (c) 4 (d) 5 Class 9 Math Annual Exam with Model 2 15. If ∑fi|xi - Mo| = 216.92 and n = 20, what is the mean deviation calculated from the median? (a) 8×85 (approximately) (b) 10×85 (approximately) (c) 9×85 (approximately) (d) 7×85 (approximately) 16. Write the condition for a, b, c to be in a geometric progression. 17. What is the sum of the first n natural numbers? 18. What is log₂ 16? 19. Write the formula for logb () 20. What is the discriminant of the equation ax² + bx + c = 0? 21. What is the meaning of the word 'Metron'? 22. In the second quadrant, what is the sign of cos θ? 23. What is cot(90° - θ)? 24. What is the range typically represented by? 25. What is the relationship between the mean deviation M.D and the range R for two unequal data sets? 1. Answer the following questions: 2 × 13 = 26 (a) If the third term and fifth term of an arithmetic progression are -12 and 26, respectively, find the first term and common difference. (b) For the series 2 + 4 + 6 + 8 + ..., if the sum of the first n terms is 2550, find the value of n. (c) Find the general term of the arithmetic progression 5, 12, 19, 26, ... (d) If log₅ x = 3, what is the value of x? (e) At a 10% compound interest rate, in how many years will the principal triple? (f) Solve the system of equations using substitution method: 2x + 3y = 32 11y - 9x = 3 (g) Solve the equation 3x² - 2x - 1 = 0 using the quadratic formula. (h) If 12 cot θ = 7, find the value of cos θ. (i) From a point 15 meters away from the base of a tower, the angle of elevation to the top of the tower is 30°. Find the height of the tower. (j) Convert radians to degrees. (k) For the angle θ = ∠XOP in standard position, find the trigonometric ratios for the point A(-4, -3) on the terminal arm. (l) Find the range of the data set: 7, 5, 12, -5, 0, 10. (m) Find the cumulative frequency distribution for the given data: x 60 61 62 63 64 65 66 67 f 2 0 15 30 25 12 11 5 Answer the following descriptive questions (based on the visual context):                                       7 × 7 = 49 2. Consider the following two geometric progressions: (i) x + 1, x + 5, x + 10, ....... (ii) 2 - 4 + 8 - 16 + .... (a) Find the value of x in the first geometric progression x + 1, x + 5, x + 10, ....... (3 marks) (b) Which term of the second geometric progression 2 - 4 + 8 - 16 + ..... is equal to 256? (4 marks) 3. In Arup's school hall, there are 30 rows of benches. The first, second, and third rows have seats in the following quantities: (k + 12), (3k + 10), and (7k + 4) respectively. (a) Find the value of k if the number of seats forms an arithmetic progression. (2 marks) (b) How many seats are there in the last row? (2 marks) (c) Find the total number of seats in the hall. (3 marks) 4. Given that: A = B = , and C = (a) If A = 128, find the value of p. (3 marks) (b) Prove that B ÷ C = . (4 marks) 5. An earthquake is felt in two locations in Bangladesh, Sylhet and Chittagong, on the same day. The magnitude of the earthquake in Sylhet is 6.5, and the earthquake in Chittagong is 17 times stronger. The magnitude of the earthquake in India, which is located near Bangladesh, is 7.1. (a) Find the magnitude of the earthquake in Chittagong. (3 marks) (b) Compare the intensity of the earthquakes in Sylhet and India, and determine which place has a higher risk. (4 marks) 6. Setu's mother bought 25 ducklings and 30 chicks for 5000 taka. If she had bought 20 ducklings and 40 chicks at the same rate, she would have spent 500 taka less. (a) What is the cost of one duckling and one chick? (4 marks) (b) After some time, if each duck is sold for 250 taka and each chicken for 160 taka, what will be her total profit? (3 marks) 7. Samiya bought 4 pens and 2 notebooks for 100 taka from a shop. Lamiya bought 2 pens and 3 notebooks for 110 taka from the same shop at the same price. (a) Form the system of equations from the given information and determine its nature. (3 marks) (b) Find the price of each notebook and pen. (4 marks) 8. Roni and Tahmid were walking along the riverbank when they saw the top of a 100-meter tall tree on the opposite bank. The angle of elevation to the top of the tree from their position was 60°. Later, Tahmid moved back a little and saw that the angle of elevation from his new position was 45°. (a) Calculate the distance from Roni and Tahmid to the opposite bank of the river. (3 marks) (b) How much further back did Tahmid move from Roni? (4 marks) 9. A car travels from Dhaka to Khulna. The rear wheel of the car rotates 12 times per second, and the radius of the wheel is 0.5 meters. The distance from Dhaka to Khulna subtends an angle of 2° at the center of the Earth. (a) How far will the car travel in one full rotation of the wheel? (2 marks) (b) Calculate the speed of the car. (2 marks) (c) How long will it take the car to reach Khulna from Dhaka? (3 marks) 10. The frequency distribution table for the mathematics marks of 125 students of Class 9 is given below: Marks Obtained 10 - 20 20 - 30 30 - 40 40 - 50 50 - 60 60 - 70 Number of Students 10 17 30 40 20 8 (a) What is the average mark of the students in Class 9 in mathematics? (3 marks) (b) Using the assumed mean method or direct method, calculate the deviation from the mean. (4 marks) 11. The following is the frequency distribution table for the number of absences of 40 students in a class last month: Absence Days 1 - 4 5 - 8 9 - 12 13 - 16 17 - 20 Number of Students 5 11 7 2 1 (a) What is the range of the first 12 prime numbers? (2 marks) (b) How many students attended the class every day last month? (2 marks) (c) Calculate the range from the frequency distribution table. (3 marks) Read the full article
0 notes
thepenpostblog · 2 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deals with the relationships between the angles and sides of triangles. It’s a fundamental topic in mathematics and finds applications in various fields, from physics and engineering to astronomy and navigation. To master trigonometry, one needs to be well-versed in its numerous formulas and identities. In this comprehensive guide, we will explore a wide range of trigonometry formulas, making them accessible and understandable. Whether you’re a student looking to ace your trigonometry exams or a professional seeking to apply trigonometric principles in real-life scenarios, this article has got you covered.
Trigonometry Formulas List:
Let’s kick things off by presenting a list of the fundamental trigonometry formulas that we will delve into in more detail:
Basic Trigonometric Function Formulas
Reciprocal Identities
Trigonometry Table
Periodicity Identities (in Radians)
Cofunction Identities (in Degrees)
Sum & Difference Identities
Double Angle Identities
Triple Angle Identities
Half Angle Identities
Product Identities
Sum to Product Identities
Inverse Trigonometry Formulas
Trigonometry Formulas from Class 10 to Class 12
Trigonometry Formulas in Major Systems
1 note · View note
sarthakseconnect · 4 years ago
Text
0 notes
onlinelearningcourseguide · 4 years ago
Text
NCERT Solutions For Class 10 Maths Chapter 8
Tumblr media
Class 10 maths chapter 8 is Introduction to Trigonometry. Trigonometry is one of the important and scoring chapter of class 10. But most of the children face problems during solving the trigonometric equation and learning the formulas. Reminding the trigonometry formula always be the trouble, but there are some simple tips to solve the trigonometry formulas.
Tip 1) Always Start from the More Complex Side.
Tip 2) Express everything into Sine and Cosine.
Tip 3) Combine Terms into a Single Fraction.
Tip 4) Use Pythagorean Identities to transform between sin²x and cos²x.
Tip 5) Know when to Apply Double Angle Formula (DAF)
Topic Names of Chapter 8
8.1 Introduction
8.2 Trigonometric Ratios
8.3 Trigonometric Ratios Of Some Specific Angles
8.4 Trigonometric Ratios Of Complementary Angles
8.5 Trigonometric Identities
8.6 Summary
Who is known as Father of Trigonometry
The first known table of chords was produced by the Greek mathematician Hipparchus in about 140 BC. Although these tables have not survived, it is claimed that twelve books of tables of chords were written by Hipparchus. This makes Hipparchus the founder of trigonometry.
Trigonometry Formulas
Here are some important trigonometry formulas for class 10 chapter 8, which will definitely work during the time of exams. The formulas chart is given below-
Tumblr media
1 note · View note
edubull · 5 years ago
Text
Edubull’s CBSE Class 9 Courses Module
Class 9 is a pivotal year for the students as the topics learned during the year is a foundation to the topics; they are going to learn in class 10. In order for the students to have ample revision and practice of the subject, they should refer to Edubull, the online learning platform. The various subjects and modules that are available in CBSE Class 9 courses of Edubull are described below.
Five Modules to learn from in Mathematics
There are five modules which students have to refer to from Edubull’s CBSE Class 9 courses. IX Maths and IX Maths (Hindi) gives the student knowledge about topics like Introduction to Euclid’s Geometry, Polynomials, Heron’s Formula. IX Maths Resources – I make the student understand the concept of Rationalising Factors of Binomial Surd, Degree of Polynomial, Equal Sides. The module of IX Maths Resources – II teaches the students about lengths using Trigonometric Ratios, Complementary Angles and other such topics. The IX Maths Resources – III helps the students to understand the various concepts of Algebra, Geometry, Statistics and probability.
Six Modules in the Class 9 courses of Science in Edubull
The Edubull’s CBSE Class 9 courses have six modules for the students to study from, the module of IX Science and IX Science (Hindi) gives the students an understanding about topics like Matter in our surroundings, Tissues, The Fundamental Unit of Life, Motion to name a few in English and Hindi respectively. IX Science Resources teaches the student about the Symbols of Atom, Immunization Principle, Cells in Human Body and more topics. The module of IX Physics Resources, IX Biology Resources, IX Chemistry Resources covers various topics of Physics, Biology and Chemistry respectively as per the syllabus of CBSE Class 9.
Two Modules of Hindi to learn from for the students
The Saras Hindi Vyakaran module of Hindi helps the students in learning the various elements of Hindi Grammar and understand Ramcharitmanas and Lord Hanuman. The IX Hindi Grammar Resources gives the students more understanding of Hindi Grammar and the usage of those elements.
Two Modules of English for the CBSE Class 9 students in Edubull
IX English Resource module in the CBSE Class 9 courses in Edubull covers the chapter like The Brook, Song of the Rain, The Road Not taken, Villa for Sale and several other chapters. IX English Novel Resources has two novels that students can read the first one is Three Men in Boat, which is in English and Gulliver’s Travel which is in the Hindi Language.
Four Modules in Social Science for building a strong foundation in the subject
IX Civics Resources will teach the students about their democratic rights, working of Institutions, Democracy in the Contemporary World and some of the topics in similar lines. IX History Resources helps the student to learn about various historical events like the French Revolution, Nazism and Rise of Hitler, the Story of cricket, to name a few.
One Module of Sanskrit to get a grip of the language
The one module in Sanskrit with its 151 lectures helps the students understand the language better than in Class 7. It is done through various interactive and engaging multimedia which helps in making the students interested in the lessons.
Others Related Post
Importance of Learning a Foreign Language
How online education websites helpful
Professional online courses to upgrade your skills
Why online courses in India and what are the benefits of online courses in India?
Most promising Education Courses in India 2020
Online Education in India
1 note · View note
learncbse-hindi · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
learnenglishcbsein · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
learncbse6 · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
ncertsolutionsbooks · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
shravyasharma190 · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
saralasharm · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
mastiadda · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
learncbse · 7 years ago
Text
Trigonometry Formulas
Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulasare essential for solving questions in Trigonometry Ratios and Identities in…
View On WordPress
0 notes
solutions-ncert · 7 years ago
Text
RS Aggarwal Solutions Class 10 Chapter 7 Trigonometric Identities
Trigonometry Formulas For Class 10. Our RS Aggarwal Textbook Solutions are considered extremely helpful for solving the tough questions which are asked in the CBSE Class 10 board exam. RS Aggarwal Textbook Solutions are compiled by subject experts. Herein, you can find all the answers to the textbook questions for Chapter 8.
Tumblr media
4 notes · View notes
chanakyadefence · 4 years ago
Text
How to prepare for NDA 2021 (2) Mathematics
The Mathematics section of NDA will carry 120 objective type multiple-choice questions. Total marks allotted to this section are 300. Candidates will get two hours 30 minutes to solve the question paper. For the correct answer, candidates will score 2.5 marks while 0.83 marks will be deducted for wrong answers.
Syllabus and important topics for Mathematics
NDA syllabus comprises topics from Algebra, Matrices and Determinants, Trigonometry, Analytical Geometry of two and three dimensions, Differential Calculus, Integral Calculus and Differential Equations, Vector Algebra and Statistics and Probability. The topic-wise distribution of questions in Mathematics are given below:
Subjects
Number of Question
Algebra
30
Trigonometry
20
Determinants  and matrices
10
Analytical  Geometry
20
Vector  Algebra
10
Statistics  and Probability
10
Differential  calculus and Integral calculus
20
Total
120
Follow the tips and tricks below for the Mathematics section:
·         Candidates must have a clear understanding of the NDA syllabus and mark the important topics after analyzing the previous years’ question papers.
·         Start preparing the important topics first, at the same time, delegate time for the difficult topics.
·         Solve mock tests to decide how much time to dedicate to each type of question. Also, candidates must solve previous year question papers to get an idea about the type of questions asked in the exam.
·         Candidates must learn tips, tricks and shortcuts for efficient time management.
·         Memorise simple calculations such as squares and cubes.
·         Make notes of shortcuts and formula to refer to during last-minute revision.
·         As there is negative marking in the exam, they should mark the answer only if they are sure about it. Do not guess the answers during the exam.
·         Candidates must refer to good Mathematics books and Coaching classes for NDA preprations.
·         During the final phase of preparation, devote at least three hours for going through the formula.
·         Do not get confused while converting the numbers from decimal to a binary system.
·         Trigonometry can be tricky. So be clear with the concepts such as Properties of Triangles and Inverse Trigonometric functions. Hence, solve such questions at the end.
·         Vector Algebra is the most important unit in the syllabus. Practice questions from Vector Product or Cross Product of two vectors.
·         The statistics part can be easy to crack but be careful while taking the figures.
·         In Probability, the Elementary Theorems, Bayes' Theorem and Binomial Distribution are important.
Best books for Mathematics
It is important that candidates must choose a good book for the Mathematics section of NDA.
·         NCERT Class 11 and 12 books
·         Mathematics for NDA and NA: National Defense Academy and Naval Academy by R S Aggarwal
·         Quantitative Aptitude for Competitive exam by RS Aggarwal
·         NDA and NA examination: Previous solved papers by R Gupta
·         JOIN COACHING CLASSES FOR NDA WRITTEN AND SSB.
·         For better results in NDA written, Join Chanakya Defence Group India’s No.1 Defence coaching institute with renowned faculty from various IIT’s & IIM’s with team of Retd. Defence officers for SSB and Persnality Development sessions. CDG working in the field of NDA, Sainik School, RIMC, RMS, CDS, AFCAT, AIRFORCE & NAVY since 2006 with best results in India. Till now more than 3700+ candidates crack the various defence exam with the help of Chanakya Defence Group.
·         For more Information Kindly contact us at
·         78887-14322 | 85569-70887
·         Website:- www.chanakyadefencegroup.com
·         CLICK:  NDA COACHING IN PATHANKOT
·         Email:- [email protected]
0 notes
bloggallery882 · 4 years ago
Text
Visual Basic Code For Simple Calculator
Tumblr media
Building a calculator program is one of the best ways to train one’s mind when it comes to creating an algorithm and forming logic. Though a calculator sounds easy to create, it might not that as simple to create as you think even the most basic one that compose only of the MDAS (Multiplication, Division, Addition and Subtraction) operations. Obviously, these operations can be processed by human brain easily but teaching a program to think that way is another thing.
In this tutorial, we are going to create a basic calculator application in Microsoft Visual C# that performs the four basic mathematical operations.
Step 1: Create a New Project
A simple calculator in Visual Basic The following Visual Basic project contains the source code and Visual Basic examples used for A simple calculator. Though everybody is developing a simple calculator, being a civil engineer i've developed one.
If you pick up a cheap calculator, you will find that this is how they work. If you press 3 × 4 +, pressing + instructs the calculator to complete the previous calculation of 3 × 4 and puts + on the operator stack. Then if you press 2 = it uses the value in the accumulator (12) and completes the next operation + 2 resulting in 14. To design the interface, we just to need to modify the interface of the basic calculator that we have created earlier using Visual Basic 6. In this calculator, we have added five more buttons, they are Sin, Cos, Tan, Log and Ln. The common trigonometric functions in Visual Basic 6 are Sin, Cos, Tan and Atn. In this example, you build a very simple calculator named SimpleCalculator. The goal of SimpleCalculator is to create a console application that accepts basic arithmetic commands, in the form '5+3' or '6-2', and returns the correct answers. Using MEF, you will be able to add new operators without changing the application code. Open your Visual Studio or Visual C# Express Edition and create a new project. Set its type to.
First things first, create a new C# project by going to File > New and choose Windows Form Application template in order for you to create an application with a Windows Forms user interface. Change the project name into “Basic Calculator” to easily find the project later on though you can name it whatever you want. Click OK!
Tumblr media
After creating the project, you will now have the basic Windows form in your screen. When you double click the form, it will open the program window and it should already have the basic code such as the using directive, namespace declaration.
Step 2: Declaring Variables
Though variable is not required to perform the functions of a calculator, we are still going to declare for the sake of good practice. Declare the following variables after the public partial class Form1 : Form
Variables Explained:
operation: Save the operation to be used in the form of “+”, “-“, “*” and “/”
firstOperand: Save the first number
secondOperand: Save the second numbe
answer: Save the calculated result
clear: Determine what kind of clear function to be used. “S” for single digit and “A” for all digits.
Step 3: Build the Calculator Interface
You can now add the controls necessary to create the calculator interface using the Toolbox located in the left side of the screen. In this case, we are going to use Button and TextBox.
Add the following:
A TextBox where you can enter numbers and show result
Buttons that will serve as keypad containing the following:
Numbers from 0-9
Decimal point
Clear function
Four operations to be used (+. -, *, /)
Equal button using the equals sign.
Note: When creating a program, it is suggested to use a consistent naming convention to easily distinguish controls from one another at a glance.
To rename a control, go to the property window in the right side and use a naming convention like below (or create your own):
Button Number 0: btnNum0
Button Number 1: btnNum1
Button Number 2: btnNum2
Button Number 3: btnNum3
Button Number 4: btnNum4
Button Number 5: btnNum5
Button Number 6: btnNum6
Button Number 7: btnNum7
Button Number 8: btnNum8
Button Number 9: btnNum9
Button Decimal Point: btnDecimal
Button Equal: btnEqual
Button Clear Function: btnClear
Button Addition: btnAdd
Button Subtraction: btnSubtract
Button Multiplication: btnMultiply
Button Division: btnDivide
Result Textbox: txtInput
Simple Calculator In Visual Studio
Step 4: Program the Number Buttons (0-9) and Decimal Point
Like a typical calculator application, we would like to display the number in the textbox based from whatever button is clicked by the user. To display a value in a textbox control, we will use the text property of the textbox. The syntax for using the said property is something like this:
There is, however, a problem if you are going to use the syntax above. Every time the the button is clicked, it will always be a single digit and the number that will appear in the textbox is the last clicked button. To fix this problem, use the syntax below instead:
Double click the Button 0 to create a btnNum0_click event handler and add the above code between the curly braces. After adding the code, it will look like this:
The above code simply gets the initial value of the textbox first, add another digit based from whatever number button is clicked and finally display the result in the textbox. Since the value of the textbox is a String, it will only concatenate the numbers.
Tip: You can also simplify the code by using a “+=” operator. The code will look like this: txtInput.Text += “0”.
Repeat the above step for all the numerical input event handlers (number buttons) as well as the decimal button event handler. Change the “0” value from the code and replace it depending which button handler you are in. Your code will now look like this:
Step 5: Program the Clear Function
The clear function will perform two different forms. The first form is to remove a single digit from a group of numbers. This second form is to remove all digits in the textbox which is normally performed after getting the result. The variable clear will determine which among the forms will be performed by the button.
Code Explained:
Line 3: Since the default value of clear variable is “S”, it will only remove a single digit form the right every time the button is clicked.
Line 7: This will be activated only when the value of the variable is changed into “A” which will be coded in the equal button (after getting the answer).
Create Calculator In Visual Basic
Step 6: Program the Mathematical Operations
For the buttons designated to the mathematical operations, a series of actions will be needed to perform to make sure that the calculator will work as expected. This is where the importance of algorithm (step-by step procedure) will be seen. The said actions are as follows:
Save the value of the textbox into a variable.
Clear the textbox to give way to the next operand.
Save the operation to be used.
Double click the Button + to create a btnAdd_click event handler and add the code like below:
Code Explained:
Line 2: Save the value of txtInput textbox into firstOperand variable
Line 3: Place an empty value in the textbox to give way to the next operand
Line 4: Save the operation into operation variable to determine what operation to be used
Repeat the above step for all the mathematical operations event handlers (+, -, *, and / buttons). Change the “+” value and replace it depending which operation button you are in.
Your code will now look like this:
Step 7: Program the Equal Button
Just like the buttons intended for mathematical operations, the equal button requires a series of action as well. The said actions are as follows:
Save the value of the textbox into a variable.
Convert the two operands into integer.
Determine which operation will be used and perform it.
Convert the answer to string and display it in the textbox.
Double click the Button = to create a btnEqual_click event handler and add the code like below:
Code Explained:
Visual Basic Calculator Project
Line 2: Save the value of txtInput textbox into secondOperand variable
Line 3: Place an empty value in the textbox to give way to the next operand.
Lines 4 and 5: Convert the value of the two operands from String to Double so that it can be used in mathematical operations.
Lines 7, 13, 19 and 25: Determine which operation to be used based from the value of the variable operation.
Lines 8, 14, 20 and 26: Perform the operations to the two operands.
Lines 9, 15, 21 and 27: Convert the answer to String so that it can be displayed in the textbox.
Lines 10, 16, 22 and 28: Display the answer into the textbox.
Line 30: Activate the clear function for all the digits.
Conclusion
After successfully creating the C# calculator program, it is expected that you have gained a basic understanding of how algorithm works as well as how to create a simple program in Visual C#.
As a challenge, you can add more buttons and mathematical formulas and convert this basic program into scientific calculator. You can also add design to make the calculator more appealing.
Download Basic Microsoft Visual C# Calculator
If you want to experiment with the C# code of this basic calculator, you can download this free Visual C# calculator project file below.
Visual Basic Code For Simple Calculator Online
Calculator Code For Visual Studio
basic-calculator.rar 327.27 KB='margin-left:>
Tumblr media
0 notes