CSE 110: Programming Language I Afroza Sultana UB 1230.

Slides:



Advertisements
Similar presentations
Chapter 4 Methods F Introducing Methods –Benefits of methods, Declaring Methods, and Calling Methods F Passing Parameters –Pass by Value F Overloading.
Advertisements

Methods Java 5.1 A quick overview of methods
COP 2800 Lake Sumter State College Mark Wilson, Instructor.
Functions. COMP104 Functions / Slide 2 Introduction to Functions * A complex problem is often easier to solve by dividing it into several smaller parts,
Building Java Programs
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 13 Fall 2010.
Return values.
Arithmetic in Pascal (2) Arithmetic Functions Perform arithmetic calculations Gives an argument to the function and it returns the result.
MATLAB MATLAB is a high-level technical computing language and
Pemrograman Dasar - Data Types1 OPERATOR. Pemrograman Dasar - Data Types2 Arithmetic operator  + - * /  / operator denotes integer division if both.
BBS514 Structured Programming (Yapısal Programlama)1 Functions and Structured Programming.
1 Fundamental Data types Overview l Primitive Data Types l Variable declaration l Arithmetical Operations l Expressions l Assignment statement l Increment.
Strings, if/else, return, user input
Copyright 2006 by Pearson Education 1 Building Java Programs Chapter 3: Parameters, Return, and Interactive Programs with Scanner.
Function (L16) * Mathematical Library Functions * Program Components in C++ * Motivations for Functionalizing a Program * Function Prototype * Function.
Datalogi A 3: 26/9. Java Concepts chapter 4 Fundamental Data Types int (long and short) double (and float) boolean char String.
BIL101, Introduction to Computers and Information Systems Chapter 12 A Portable Scientific Visualization Program: GnuPlot Prepared by Metin Demiralp Istanbul.
Computer Science A 2: 6/2. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated.
Introduction to Matlab. Entering Commands Constants and Functions >> pi ans = >> eps ans = e-016 >> sin(pi/2) ans = 1 >> log(1000) ans =
EGR 105 Foundations of Engineering I Session 3 Excel – Basics through Graphing Fall 2008.
1 Data types, operations, and expressions Continued l Overview l Assignment statement l Increment and Decrement operators l Short hand operators l The.
Microsoft® Small Basic The Math Object Estimated time to complete this lesson: 1 hour.
INTRODUCTION TO PYTHON PART 1 CSC482 Introduction to Text Analytics Thomas Tiahrt, MA, PhD.
1 CS101 Introduction to Computing Lecture 38 String Manipulations (Web Development Lecture 13)
1 CS101 Introduction to Computing Lecture 35 Mathematical Methods (Web Development Lecture 12)
CSC 107 – Programming For Science. Announcements  Lectures may not cover all material from book  Material that is most difficult or challenging is focus.
Python  By: Ben Blake, Andrew Dzambo, Paul Flanagan.
1 TAC2000/ Protocol Engineering and Application Research Laboratory (PEARL) MATH Functions in C Language.
Computer Science 111 Fundamentals of Programming I Basic Program Elements.
CSE202: Lecture 4The Ohio State University1 Mathematical Functions.
Object Oriented Programming I
CS 115 OBJECT ORIENTED PROGRAMMING I LECTURE 4 part 3 GEORGE KOUTSOGIANNAKIS.
Java Program Components Java Keywords - Java has special keywords that have meaning in Java. - You have already seen a fair amount of keywords. Examples.
Week 2 - Friday.  What did we talk about last time?  Using Scanner to get input  Basic math operations.
1 Math Expressions and Operators. 2 Some C++ Operators Precedence OperatorDescription Higher ( )Function call +Positive - Negative *Multiplication / Division.
Math With Java The Math Class. First, A Quick Review of Math Operators in Java Primitive Data type in Java that represent numbers: Primitive Data type.
Big Java by Cay Horstmann Copyright © 2009 by John Wiley & Sons. All rights reserved. int: integers, no fractional part: 1, -4, 0 double : floating-point.
CSC 107 – Programming For Science. Announcements  Lectures may not cover all material from book  Material that is most difficult or challenging is focus.
Calculations Chapter 11 Library of math functions, and constants cos, sin, tan, abs, min, max, log, random, sqrt, pow, exp Constants.PI,.E Use care with.
MATH 251: MATH SOFTWARE A N I NTRODUCTION TO MATLAB Exercises sheet Al Imam Mohammad Bin Saud Islamic University College of Sciences Department of Mathematics.
Visual Basic I Programming
Getting Started with MATLAB (part 3) 1. Algebra, 2. Trig 3. The keyword ans 4. Clean up and suppress output: finalizing the software’s presentation 1.
Introduction As programmers, we don’t want to have to implement functions for every possible task we encounter. The Standard C library contains functions.
CSCE 121: Introduction to Program Design and Concepts, Honors J. Michael Moore Spring 2015 Set 14: Plotting Functions and Data 1.
1 Java Library Lecture 9 by Dr. Norazah Yusof. 2 Java Library Java has pre-defined classes that consist of the basic language classes in Java (organized.
PHY 107 – Programming For Science. Announcements  Lectures may not cover all material from readings  Material that is most difficult or challenging.
ICS 3U Math Class. ActionScript 3 – Math Class Rounding ceil – closest integer >= number (rounds up) floor – closest integer
160 as a product of its prime factors is 2 5 x 5 Use this information to show that 160 has 12 factors.
Matlab Tutorial Iman Moazzen First Session – September 11, 2013.
CIS Intro to JAVA Lecture Notes Set 5 26-May-05.
Useful Python CMSC 120: Visualizing Information. Scope def area(diameter): radius = diameter / 2.0 A = PI * radius ** 2 return A def circumference(diameter):
Recursion It is a process of calling the same function itself again and again until some condition is satisfied. Syntax: func1() { ……….. func1(); }
Reviewing Trigonometry Angle Measure Quadrant Express as a function of a positive acute angle Evaluate Find the angle Mixed Problems.
© 2007 D. J. ForemanJS-m1 String, Math & Miscellaneous Methods & Properties.
Some Useful MATLAB Functions
Math class Random() method Floor method Top-level parseInt function
Week 3 - Wednesday CS 121.
Math Class Your favorite class!.
Chapter 4 Mathematical Functions, Characters, and Strings
Chapter 3 Methods.
Chapter 4: Mathematical Functions, Characters, and Strings
String, Math & Miscellaneous Methods & Properties
Functions October 23, 2017.
Java Basics.
4TC00 Model-based systems engineering 2.2 Types and values
Terminal-Based Programs
Php – Math functions.
4.3 Arithmetic Operators and Mathematical Functions
String, Math & Miscellaneous Methods & Properties
Ch 5 : Mathematical Functions, Characters, and Strings
Presentation transcript:

CSE 110: Programming Language I Afroza Sultana UB 1230

Math Class Very useful. Provides many methods in a pre-built class. The following are available in the Math class Trigonometry functions (input in radian instead of in degree): sin, cos, tan, acos, atan, asin

Exponent Methods exp – raise e to a power sqrt – returns the square root pow – raise a number to a power log – natural log of a number

Rounding in Math Class ceil – round up to nearest integer floor – round down to nearest integer

Helpful Math random – Returns a random number greater than or equal to 0.0 and less than 1.0 abs – return absolute value of a number min – return minimum of two numbers max – return max of two numbers

Mathematical Library Functions In MathematicsIn Java | y | or absolute value of yMath.abs(y) xyxy Math.pow(x, y) square root of xEither try, Math.sqrt(x) or try, Math.pow(x, 1.0/2) cube root of xMath.cbrt(x) exex Math.exp(x) log e (x)Math.log(x) log 10 (x)Math.log10(x) log b (x)Either try, Math.log(x) / Math.log(b) or try, Math.log10(x) / Math.log10(b) in radian sin xMath.sin(x) in degree sin xEither try, Math.sin( Math.toRadians(x) ) or try, Math.sin(x * Math.PI/180) cos xMath.cos(x * Math.PI/180) cosec x1 / Math.cos(x * Math.PI/180) tan yMath.tan(y * Math.PI/180) here x and y are of type double. You can find out more from