© 2012 EMC Publishing, LLC Slide 1 Chapter 7 The Math Class  Includes shared methods that perform common math functions.  Math Class methods include:

Slides:



Advertisements
Similar presentations
Lists, Loops, Validation, and More
Advertisements

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5- 1 STARTING OUT WITH Visual Basic 2008 FOURTH EDITION Tony Gaddis.
Formulas, Ranges, and Functions. Formulas n Formulas perform operations such as addition, multiplication, and comparison on worksheet values. n Formulas.
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 1Advanced Formatting, Formulas, and Data Management Chapter 2Advanced Functions and Formulas.
Excel Notes Phys244/246 © 2007, B.J. Lieb. Calculating Velocity The velocity is calculated by entering the following: =(B3-B2) / (A3-A2). Then drag the.
Introduction In the real world, if you needed to verify the size of a television, you could get some measuring tools and hold them up to the television.
Chapter 3: Expressions and Interactivity. Outline cin object Mathematical expressions Type Conversion and Some coding styles.
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
Evaluating Sine & Cosine and and Tangent (Section 7.4)
Microsoft Visual Basic: Reloaded Chapter Six Repeating Program Instructions.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
VB Default Controls List Box, Combo Box
List-based Controls. Slide 2 Introduction There are several controls that work with lists ComboBox ListBox CheckedListBox.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Microsoft® Small Basic The Math Object Estimated time to complete this lesson: 1 hour.
MS-Excel XP Lesson 8. Inserting and Formatting a Comment 1.Select cell or cell range 2.Insert menu, comment menu item 3.Type message to comment 4.Minimize.
5-5 Solving Right Triangles. Find Sin Ѳ = 0 Find Cos Ѳ =.7.
Inverses  How do we know if something has an inverse? ○ Vertical line tests tell us if something is a function ○ Horizontal line tests will tell us if.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 9 Car Payment Calculator Application Introducing the Do While...Loop and Do Until...Loop.
Chapter 5 new The Do…Loop Statement
Section 5.5 Inverse Trigonometric Functions & Their Graphs
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Computer Science 1000 Spreadsheets II Permission to redistribute these slides is strictly prohibited without permission.
Expressions and Interactivity Chapter 3. 2 The cin Object Standard input object Like cout, requires iostream file Used to read input from keyboard Often.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
EG280 - CS for Engineers Chapter 2, Introduction to C Part I Topics: Program structure Constants and variables Assignment Statements Standard input and.
Intrinsic Functions Pre-coded Functions Used to improve developer productivity Broad Range of Activities Math calculations Time/Date functions String.
ME 142 Engineering Computation I Excel Functions.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Six Repeating Program Instructions.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Shipping Hub Application Introducing Generic Collections, LINQ, For Each...Next.
110 M - 1 ListBoxes & ComboBoxes Provide a list for the user to select from Various styles, choose based on –Amount of data to be displayed –Space available.
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Seven More on the Repetition Structure.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 4 Trigonometric Functions.
Copyright © 2011 Pearson, Inc. 4.7 Inverse Trigonometric Functions.
Chapter 4 Trigonometric Functions Inverse Trigonometric Functions Objectives:  Evaluate inverse sine functions.  Evaluate other inverse trigonometric.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 8: Chapter 5: Slide 1 Unit 8 List Boxes and the Do While Looping Structure.
13.7 I NVERSE T RIGONOMETRIC F UNCTIONS Algebra II w/ trig.
4.7 Inverse Trig Functions. By the end of today, we will learn about….. Inverse Sine Function Inverse Cosine and Tangent Functions Composing Trigonometric.
Visual Basic I Programming
1 © 2011 Pearson Education, Inc. All rights reserved 1 © 2010 Pearson Education, Inc. All rights reserved © 2011 Pearson Education, Inc. All rights reserved.
8.1-Law of the Sines Law of the Sines & Requirements Examples Practice Problems.
Chapter 8.  Visual Basic includes several built-in mathematical functions ◦ Abs ◦ Sqr ◦ Sgn ◦ IsNumeric ◦ Round ◦ Format ◦ Pmt ◦ PV ◦ FV.
7-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Controls Part 2. DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
 A ListBox control displays a list of items and allows the user to select one or more  Drag from Toolbox to create this control on a form.
Solving Right Triangles Use trigonometric ratios to find angle measures in right triangles and to solve real-world problems.
Unit 6 Repetition Processing Instructor: Brent Presley.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Input Boxes, List Boxes, and Loops Chapter 5. 2 Input Boxes Method for getting user’s attention to obtain input. InputBox() for obtaining input MessageBox()
Copyright © 2011 Pearson, Inc. 4.7 Inverse Trigonometric Functions.
21/03/ Working with Controls Text and List Boxes.
© 2006 Lawrenceville Press Slide 1 Chapter 4 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration statement. For example: Dim.
8-3 Trigonometry Part 2: Inverse Trigonometric Functions.
10.4: Inverses of Trigonometric Functions Algebra 2.
© 2010 Lawrenceville Press Slide 1 Chapter 5 The Do…Loop Statement  Loop structure that executes a set of statements as long as a condition is true. 
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Third Edition by Tony Gaddis.
Microsoft Visual Basic 2008: Reloaded Third Edition
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Repeating Program Instructions
Microsoft Visual Basic 2005: Reloaded Second Edition
Inverse Trigonometric Functions
CIS 16 Application Development Programming with Visual Basic
Evaluating Inverse Trig Expressions
Presentation transcript:

© 2012 EMC Publishing, LLC Slide 1 Chapter 7 The Math Class  Includes shared methods that perform common math functions.  Math Class methods include: Abs(num)returns the absolute value of num. Sqrt(num)returns the square root of num. Sign(num)returns 1, -1, or 0 when num is positive, negative, or 0 respectively. Round(num, places)returns a Double representing num rounded to ( a specified number ) places places.

© 2012 EMC Publishing, LLC Slide 2 Chapter 7 The IsNumeric() Function  Returns True if an argument can be evaluated to a number. False returned otherwise. For example: text = "123" Me.lblAns.Text = IsNumeric(text)'True text = "1 + 2" Me.lblAns.Text = IsNumeric(text)'False  Member/Method of Information module

© 2012 EMC Publishing, LLC Slide 3 Chapter 7 The Format() Function  Converts a number to a formatted string.  Member/Method of Strings Class/Module  Include: Currency, Fixed, Percent, Scientific and True/False: '$4, Me.lblNum.Text = Format(4568, "Currency") ' Me.lblNum.Text = Format(4568, "Fixed") '45% Me.lblNum.Text = Format(.45, "Percent") 'True Me.lblNum.Text = Format(1, "True/False") ‘3.14E-09 Me.lblNum.Text = Strings.Format(Math.PI / , "Scientific")

© 2012 EMC Publishing, LLC Slide 4 Chapter 7 Business Functions  An annuity is a set of payments made on a regular basis for a specified period.  Functions that return information about an annuity: - Pmt(rate, term, principal) calculates the daily/monthly/yearly payment on a loan->rate and term must match: daily/monthly/yearly - PV(rate, term, amount) returns the present value of an annuity->rate, term and amount must match - FV(rate, term, amount) returns the future value of an annuity->rate, term and amount must match

© 2012 EMC Publishing, LLC Slide 5 Chapter 7 Processing Business Data  Business applications that prompt the user for currency values and percentage rates should be written to accept a variety of formats. User should be allowed to enter $45000 or If code not written to accept both formats a run-time error will occur.  The IsNumeric() function returns True when a string of numbers begins with a $. However Val() returns 0 for Val(“$45”) because $ is not recognized.

Chapter 7 Processing Business Data  The Replace() String method can be used to find and replace the $ and any commas with empty strings before converting the string using the Val() function.  The TrimEnd() String method can be used to remove the % before converting the string using the Val() function. © 2012 EMC Publishing, LLC Slide 6

© 2012 EMC Publishing, LLC Slide 7 Chapter 7 The ListBox Control  (Name) should begin with lst.  Items is used to add a set of strings to the box.  Sorted is set to True to display the list items in alphabetical order.  SelectedItem is the selected item.  SelectedIndex is the index of the selected item.

© 2012 EMC Publishing, LLC Slide 8 Chapter 7 The ListBox Control Class Methods  Items.Add() is used to add an item to a list box at run time.  Items.Remove() is used to delete a specified item from the list box.  Items.Clear() deletes the contents of the list box.

© 2012 EMC Publishing, LLC Slide 9 Chapter 7 The ComboBox Control  (Name) should begin with cbo.  Items is used to add a set of strings to the box.  Text is the text displayed in the text box of the combo box.  Sorted is set to True to display the list items in alphabetical order.  SelectedItem is the selected item.  SelectedIndex is the index of the selected item.

© 2012 EMC Publishing, LLC Slide 10 Chapter 7 The ComboBox Control Class Methods  Items.Add() is used to add an item to a combo box at run time.  Items.Remove() is used to delete a specified item from the combo box.  Items.Clear() deletes the contents of the combo box.

© 2012 EMC Publishing, LLC Slide 11 Chapter 7 Windows Application Standards

 The object with focus( contains insertion point/prompt ) will receive the user input from the keyboard.  An access key is the key pressed while holding down the Alt key to select an object. (&) is used in the Text property to define an access key. Access keys are not displayed until Alt is pressed.  A disabled object cannot be selected by the user. Enabled property is used.  A logical tab order can be set by the order in which objects are added to a form. This order can be changed by setting the TabIndex property of the objects ( first is 0 = initial focus ). © 2012 EMC Publishing, LLC Slide 12

© 2012 EMC Publishing, LLC Slide 13  Math class trig methods include: Sin(angle)returns the sine of angle. Cos(angle)returns the cosine of angle. Tan(angle)returns the tangent of angle.  The Sin(), Cos(), and Tan() methods require an argument in radians.  To convert from degrees to radians, use the Math class PI constant: radians = (Math.PI / 180) * degrees Chapter 7 The Math Class Trigonometric Methods

© 2012 EMC Publishing, LLC Slide 14 Math class inverse trig methods include:  Asin(num)returns the arcsine of num (in radians)  Ac os(num)returns the arccosine of num (in radians)  At an(num)returns the arctangent of num (in radians). Chapter 7 The Math Class Inverse Trigonometric Methods

© 2012 EMC Publishing, LLC Slide 15  Math class logarithmic methods include: Log(num)returns the natural logarithm (base e) of num. Log(num, base)returns the logarithm of num in the specified base base. Log10(num)returns the base 10 logarithm of num. Exp(power) returns e raised to a power. Pow(num, power)returns num raised to the power power.  The Math also includes the constant E which represents the base of natural logarithms. Chapter 7 The Math Class Logarithmic and Exponential Methods