1 Lab Session-3 CSIT 121 Spring’05 Division rules Operator precedence rules Lab Exercise.

Slides:



Advertisements
Similar presentations
Division & Divisibility. a divides b if a is not zero there is a m such that a.m = b a is a factor of b b is a multiple of a a|b Division.
Advertisements

Lesson 5-4 Example Find 19 ÷ 3. Show the remainder. Step 1Rewrite the problem in vertical format.
Al-Karma Language School Computer Department Prep. 3.
÷ 2 0 = 1 0.
Long Division by One-Digit Numbers.
1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV:
1 Session-16 CSIT 121 Spring 2006 Demo for switch-case due now Demo for switch-case due now String comparison String comparison Slide 23; sample case.
1 Lab Session-3 CSIT221 Spring 2003 b Group Worksheet 3 Exercise (Demo Required) b No new lab demo will be assigned to allow you to focus on HW#1.
1 Session-7 CSIT 121 Spring 2006 Lab Demo of NiMo Lesson 3-2 Exercises 1,2,3,4,5,6 (Arithmetic Operators with Program ‘Convert.cpp’) Q&A about operators.
1 Session-15 CSIT 121 Spring 2006 Selection with Switch~Case Selection with Switch~Case Need an integer or character to test for Need an integer or character.
1 Session-11 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-4 due Now Chapter 4 topics –Using get and ignore to control input data (3-19) –Prompting.
1 Lab Session-6 CSIT-121 Spring 2005 Structured Choice The do~While Loop Lab Exercises.
1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise.
1 Lab Session-11 CSIT 121 Fall 2003 Using arrays in functions Programming Exercise.
Understanding Value of Places
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
1 Lab Session-7 CSIT-121 Fall Introducing Structured Choice 4 The do~While Loop 4 Lab Exercises.
Prerequisite Skills VOCABULARY CHECK. Prerequisite Skills VOCABULARY CHECK 1. The result of adding two or more numbers is a ?. 2. The result of dividing.
division algorithm Before we study divisibility, we must remember the division algorithm. r dividend = (divisor ⋅ quotient) + remainder.
1 Lab Session-III CSIT-120 Fall 2000 Revising Previous session Data input and output While loop Exercise Limits and Bounds Session III-B (starts on slide.
5th Grade Module 2 – Lesson 23
By Lexi. A dot used to separate the tenths and the ones place in decimal numbers. DECIMAL POINT 2.
PRESENTATION 1 Whole Numbers. PLACE VALUE The value of any digit depends on its place value Place value is based on multiples of 10 as follows: UNITS.
7 Chapter Decimals: Rational Numbers and Percent
Decimals.
+ Division Objective: I can divide multi-digit whole numbers by whole numbers divisors with and without remainders.
Lesson 5-6 Example Find 312 ÷ 8. Use short division. Step 1Look at the first digit in the dividend. Since the divisor is greater than the first digit,
Ch 11.5 Dividing Polynomials
Divisibility Rules!.
Aim: How do we divide polynomials? Divide each term of the polynomial by the monomial. Factor each expression. Divide out the common factors in each.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
Continued Four Operations-Division
5th Grade unit 4 vocabulary By: Ben Witkowski. Decimal point A decimal point is a small dot that separates the whole number from the partial number. Example:
DIVISION. Standards G4.1M.C2.PO4A. Use multiple strategies to divide whole numbers using 4-digit dividends and divisors from 1 to 12 with remainders.
My Book of Divisibility. THE 2’s Example: 30, 42, 24, 76, 98, Must be an even number Number must end in a 0, 2, 4, 6, or 8.
Division by a 1-Digit Number How many candies will each girl receive? Divide 6 candies into 3 girls. Intro 2 candies.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
Logic Number Problems Grades Puzzles Challenge Puzzles.
Products and Factors of Polynomials (part 2 of 2) Section 440 beginning on page 442.
Chapter 1 Whole Numbers Digit – number from 0-9
Dividing Polynomials. Long Division of Polynomials Arrange the terms of both the dividend and the divisor in descending powers of any variable. Divide.
5th Grade Module 2 – Lesson 21
Bell Ringer
Discrete Mathematics Numbering System.
Chapter 1 Introduction to Java
Dividing Polynomials Algebra
Week 1 Real Numbers and Their Properties
Division Using “Lucky Seven”
The partial- Quotients Division Algorithm
Long Division by One-Digit Numbers.
Comparing Numbers.
Objective - To compare numbers.
K.V. I.A.t. girinagar, pune 25 Slides prepared By Mrs. Pushpa prakash
Dividing Whole Numbers
Division by One Digit Divisors
Section 5.3 The Rational Numbers
“Day E” Thursday October 15, 2015
Long Division by One-Digit Numbers.
“Day D” Wednesday Oct. 14, 2015 English Science Math Math Express
Divisibility 2,5 and 10.
Decimal A number that is written in a system based on multiples of 10. Examples: ,
Long Division by One-Digit Numbers.
Week 1 Real Numbers and Their Properties
Exercise Use long division to find the quotient. 180 ÷ 15.
Divisibility 4,8 and 11.
divide dividend divisor inverse operations quotient
Warm Up There are 36 students participating in the math challenge teams this year. There is an even number of teams. The teachers want the greatest number.
Chapter 1 Whole Numbers.
Comparing Numbers.
Presentation transcript:

1 Lab Session-3 CSIT 121 Spring’05 Division rules Operator precedence rules Lab Exercise

2 Division and Precedence Rules How can we obtain only the remainder of a division operation? What data type of dividend and divisor would result in only the quotient after the division? If two operators are of equal precedence in an expression, which one is applied first? How can we change the default precedence of operators?

3 Lab Exercise (Demo due Feb 16) Write a program that asks the user to input a number between 1 and 5,000. If the user enters a number greater than 5,000, the program terminates with an appropriate message. If the number is valid, the program displays the thousands digit, hundreds digit, tens digit and ones digit of the number, each on a separate line. Finally, the program displays the original number reversed on one line. See example interactions on next two slides.

4 Sample Run-1 of Number Separator Program Please enter a number between 1 and 5000: 3927 Here are the digits one by one Here is the number in reverse 7293 Press any key to continue

5 Run-2 Please enter a number between 1 and 5000: 21 Here are the digits one by one Here is the number in reverse 12 Press any key to continue

6 Practice Questions (Not Graded) Exam Preparation Exercise 5 Page th ed. Exam Preparation Exercise 7 Page th ed. Programming Problem 1 Page th ed.