CS 135 Lab Assignments Week 1

Size: px
Start display at page:

Download "CS 135 Lab Assignments Week 1"

Transcription

1 CS 135 Lab Assignments Week 1 Professor: Matt B. Pedersen This handout is the assignment that you must finish for the lab portion of the course in week 1. You must finish the assignments yourself; if you need any help ask the TA or the professor. You may not work together with other students in solving the assignments. The weekly assignments must be handed in on a piece of paper, typed neatly (spell checked etc.) and look nice. The assignments are due in the the professor s mailbox labeled Matt Pedersen in TBE-A211 the following Wednesday before the computer science office closes at 5pm. All lab assignments must be handed in if you wish to attend the final exam. Late assignments are not accepted for any reason except sickness or family emergencies, and the former requires a doctors notice. 1 Question 1 Consider a simple expression in everyday arithmetic like 1+2. Using the rules of arithmetic we can calculate its value, which is 3. Let us call expressions that consist of only one operator and two operands for simple. What about a more complicated expressions like (i.e., one that is not simple)? What is its value? It is well known that parentheses can be placed in such a way that, if evaluated according to the rules of arithmetic, all expressions are simple when they are evaluated. For example, can be written as 4+(2+1) or if you like (4+2)+1. Either way if we evaluate the expression we get: 4+(2+1) = 4+3 = 7 or (4+2)+1 = 6+1 = 7. When the operand is + the placement of the parentheses does not matter, but what if the expression was 4-2-1? (4-2)-1 is not the same as 4-(2-1). The former evaluates to (4-2)-1 = 2-1 = 1 and the latter to 4-(2-1) = 4-1 = 3. The same problem arises when we use division (/): the placement of the parentheses matter. Which one is the correct one? (4-2)-1 is. Therefore, the correct answer is 1. The arithmetic we use is left associative if we do not use parentheses. Be careful though, because some operators like * and / take 1

2 precedence over others like + and -. For example, 4-8/2 is not the same as (4-8)/2, because / has higher precedence than -. The correct expression with parentheses is 4-(8/2). Using parentheses, convert the following non-simple expressions into expressions using parentheses such that when we evaluate it, we only evaluate simple expressions. The parentheses should be placed such that the value of the converted expressions is the same as the value of the expressions without the parentheses. For example, 4/2-3 has the value -1, so the correct way to convert this expressions is (4/2)-3. Also state what the value of the expression is *8/ /4/2+1 2 Question 2 Expressions can also contain variables. You know this from math when we have expressions like x + 2. The value of x + 2 depends on the value of x. If x has the value 5 then x + 2 is equal to 5+2=7. If x has the value 4 and y has the value 5 what is the value of the expressions x + 2 y? Using parentheses, transform x + 2 y like we did in question 1. What should the value of x be for the expressions x/y 2 to be equal to 3 if y is equal to 5? 2

3 Find at least 2 sets of values for x and y such that the expression x y/2 is equal to 0. 3 Question 3 In math you will have seen expressions like y = 2 x 1 We can determine the value of y if we know the value of x (and if we draw a graph, then we get a straight line with a slope of 2 crossing the y-axis at -1. y gets a new value every time we evaluate the expression on the right (2 x 1). Consider the following more complex equation: y = x x 3 and fill in the correct values for y in the table below with the given values for x. 4 Question 4 x As mentioned earlier, different operators have different precedences, for example in the non-parenthesized expression x y 2 the multiplication has higher precedence than subtraction. Some operators like + and - have the same precedence. y b + b 2 4 a c 2 a in this rather complex expression (which you will probably recognize as the positive solution of the quadratic equation) we have used both + and - as well as * and /; furthermore, we have used a unary minus (in front of the b; this could have been written as (0-b)) as well as exponentiation (b 2, which 3

4 of course could have been written as (b b)). Write out the expression using parentheses (and only simple expressions) such that when evaluated it produces the same result as in the expression above. Also list the operators used in order of precedence from highest to lowest. 5 Question 5 I am going to invent a new operator which we will call gets the value of, and its use looks like this: x 5 and it reads x gets the value of 5. After evaluating and expressions using this operator, the value of the expression on the right will be placed in the variable on the left. Naturally the following is illegal: and so is x + 6 as you cannot change the value of a number! The following is legal though: x 5 1 y x + 2 After the first expression has been evaluated, x has the value of 5-1 (i.e., 4), and when we subsequently evaluate x + 2 we get 4-2 which is 2 and that becomes the value of y. Consider this sequence of expressions: x 2 y x 5 x y 2 What is the value of x and the value of y once we have evaluated all three expressions? After the first expressions clearly x has the value 2! At this point we cannot say anything about the value of y. To evaluate the second expression we need to evaluate the expression x 5, which is 10 (as x was 4

5 2), and we now know that y is 10 and x has not changed (we only used the value of x on the right hand side of the second expression, not changed it!), so it remains 2. But what happens after the third expression? The right hand side of the this expression is y 2 which is 10-2 which is 8, so x get the value of 8 (changing it from its old value of 2). So in the end, y is 10 and x is 8. What is the value of x, y and z after the following expressions have been evaluated (always evaluate expressions in order starting from the top and then move down, one at a time remembering the values of variables already given values): x 4 y 5 x 2 x y 2 z x + y When evaluating expressions with the operator it is important to think of the right hand side as something that evaluates to a value (by using arithmetic and remembering what values were stored in any variables used in the expression) and the left hand side (which is always a variable) as a container that can hold a single value, which can change only when using the operator. The way an expression with the is evaluated is always Compute the value of the right hand side using arithmetic and by using the values of any variables, and once you have a single value, that value now gets given to the variable on the left. With this in mind we can write something like this: x 1 x x + 1 What is the value of x after these two expressions? 5

CS 135 Lab Assignments Week 12

CS 135 Lab Assignments Week 12 CS 135 Lab Assignments Week 12 Professor: Matt B. Pedersen This handout is the assignment that you must finish for the lab portion of the course in week 12. You must finish the assignments yourself; if

More information

CS 135 Lab Assignments Week 13

CS 135 Lab Assignments Week 13 CS 135 Lab Assignments Week 13 Professor: Matt B Pedersen This handout is the assignment that you must finish for the lab portion of the course in week 13 You must finish the assignments yourself; if you

More information

Lecture 2: Variables & Assignments

Lecture 2: Variables & Assignments http://www.cs.cornell.edu/courses/cs1110/2018sp Lecture 2: Variables & Assignments (Sections 2.1-2.3,2.5) CS 1110 Introduction to Computing Using Python [E. Andersen, A. Bracy, D. Gries, L. Lee, S. Marschner,

More information

DOWNLOAD PDF BIG IDEAS MATH VERTICAL SHRINK OF A PARABOLA

DOWNLOAD PDF BIG IDEAS MATH VERTICAL SHRINK OF A PARABOLA Chapter 1 : BioMath: Transformation of Graphs Use the results in part (a) to identify the vertex of the parabola. c. Find a vertical line on your graph paper so that when you fold the paper, the left portion

More information

} Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2.

} Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2. Class #10: Understanding Primitives and Assignments Software Design I (CS 120): M. Allen, 19 Sep. 18 Java Arithmetic } Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = 2 + 5 / 2; 3.

More information

Chapter 1: Foundations for Algebra

Chapter 1: Foundations for Algebra Chapter 1: Foundations for Algebra Dear Family, The student will follow the order of operations, a set of rules that standardize how to simplify expressions. Order of Operations 1. Perform operations within

More information

Chapter 12: Quadratic and Cubic Graphs

Chapter 12: Quadratic and Cubic Graphs Chapter 12: Quadratic and Cubic Graphs Section 12.1 Quadratic Graphs x 2 + 2 a 2 + 2a - 6 r r 2 x 2 5x + 8 2y 2 + 9y + 2 All the above equations contain a squared number. They are therefore called quadratic

More information

Midterms Save the Dates!

Midterms Save the Dates! University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Primitive Data Types Arithmetic Operators Readings Your textbook is Big Java (3rd Ed). This Week s Reading: Ch 2.1-2.5, Ch 4.1-4.2.

More information

Only to be used for arranged hours. Order of Operations

Only to be used for arranged hours. Order of Operations Math 84 Activity # 1 Your name: Order of Operations Goals: 1) Evaluate Real numbers with Exponents. ) Use the Order of Operations to Evaluate Expressions. ) Review Exponents and Powers of Ten Integer exponents

More information

Here redirection. Case statement. Advanced Unix Tools Lecture 6 CS214 Spring 2004 Friday March 5, 2004

Here redirection. Case statement. Advanced Unix Tools Lecture 6 CS214 Spring 2004 Friday March 5, 2004 Advanced Unix Tools Lecture 6 CS214 Spring 2004 Friday March, 2004 Here redirection Recall that redirection allows you to redirect the input to a command from a file (using

More information

Welcome to CS 115 (Winter 2019)

Welcome to CS 115 (Winter 2019) Welcome to CS 115 (Winter 2019) Web page (the main information source): http://www.student.cs.uwaterloo.ca/ cs115/ Course Personnel: Contact information and office hours for all staff: instructors, ISAs

More information

ENGI Introduction to Computer Programming M A Y 2 8, R E Z A S H A H I D I

ENGI Introduction to Computer Programming M A Y 2 8, R E Z A S H A H I D I ENGI 1020 - Introduction to Computer Programming M A Y 2 8, 2 0 1 0 R E Z A S H A H I D I Last class Last class we talked about the following topics: Constants Assignment statements Parameters and calling

More information

Topic 3: Fractions. Topic 1 Integers. Topic 2 Decimals. Topic 3 Fractions. Topic 4 Ratios. Topic 5 Percentages. Topic 6 Algebra

Topic 3: Fractions. Topic 1 Integers. Topic 2 Decimals. Topic 3 Fractions. Topic 4 Ratios. Topic 5 Percentages. Topic 6 Algebra Topic : Fractions Topic Integers Topic Decimals Topic Fractions Topic Ratios Topic Percentages Duration / weeks Content Outline PART (/ week) Introduction Converting Fractions to Decimals Converting Decimals

More information

Specific Objectives Students will understand that that the family of equation corresponds with the shape of the graph. Students will be able to create a graph of an equation by plotting points. In lesson

More information

Operators. Lecture 3 COP 3014 Spring January 16, 2018

Operators. Lecture 3 COP 3014 Spring January 16, 2018 Operators Lecture 3 COP 3014 Spring 2018 January 16, 2018 Operators Special built-in symbols that have functionality, and work on operands operand an input to an operator Arity - how many operands an operator

More information

Welcome to CS 115 (Winter 2018)

Welcome to CS 115 (Winter 2018) Welcome to CS 115 (Winter 2018) Web page (the main information source): http://www.student.cs.uwaterloo.ca/ cs115/ Course Personnel: Contact information and office hours for all staff: instructors, ISAs

More information

Expressions and Casting. Data Manipulation. Simple Program 11/5/2013

Expressions and Casting. Data Manipulation. Simple Program 11/5/2013 Expressions and Casting C# Programming Rob Miles Data Manipulation We know that programs use data storage (variables) to hold values and statements to process the data The statements are obeyed in sequence

More information

Project 2: How Parentheses and the Order of Operations Impose Structure on Expressions

Project 2: How Parentheses and the Order of Operations Impose Structure on Expressions MAT 51 Wladis Project 2: How Parentheses and the Order of Operations Impose Structure on Expressions Parentheses show us how things should be grouped together. The sole purpose of parentheses in algebraic

More information

Expressions and Casting

Expressions and Casting Expressions and Casting C# Programming Rob Miles Data Manipulation We know that programs use data storage (variables) to hold values and statements to process the data The statements are obeyed in sequence

More information

SAMS Programming A/B. Lecture #1 Introductions July 3, Mark Stehlik

SAMS Programming A/B. Lecture #1 Introductions July 3, Mark Stehlik SAMS Programming A/B Lecture #1 Introductions July 3, 2017 Mark Stehlik Outline for Today Overview of Course A Python intro to be continued in lab on Wednesday (group A) and Thursday (group B) 7/3/2017

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #23 Loops: Precedence of Operators

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #23 Loops: Precedence of Operators Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #23 Loops: Precedence of Operators This one more concept that we have to understand, before we really understand

More information

LECTURE 3 C++ Basics Part 2

LECTURE 3 C++ Basics Part 2 LECTURE 3 C++ Basics Part 2 OVERVIEW Operators Type Conversions OPERATORS Operators are special built-in symbols that have functionality, and work on operands. Operators are actually functions that use

More information

9/10/10. Arithmetic Operators. Today. Assigning floats to ints. Arithmetic Operators & Expressions. What do you think is the output?

9/10/10. Arithmetic Operators. Today. Assigning floats to ints. Arithmetic Operators & Expressions. What do you think is the output? Arithmetic Operators Section 2.15 & 3.2 p 60-63, 81-89 1 Today Arithmetic Operators & Expressions o Computation o Precedence o Associativity o Algebra vs C++ o Exponents 2 Assigning floats to ints int

More information

BIG IDEAS. A.REI.D.10: Interpret Graphs as Sets of Solutions. Lesson Plan

BIG IDEAS. A.REI.D.10: Interpret Graphs as Sets of Solutions. Lesson Plan A.REI.D.10: Interpret Graphs as Sets of Solutions EQUATIONS AND INEQUALITIES A.REI.D.10: Interpret Graphs as Sets of Solutions D. Represent and solve equations and inequalities graphically. 10. Understand

More information

CS1 Lecture 3 Jan. 18, 2019

CS1 Lecture 3 Jan. 18, 2019 CS1 Lecture 3 Jan. 18, 2019 Office hours for Prof. Cremer and for TAs have been posted. Locations will change check class website regularly First homework assignment will be available Monday evening, due

More information

Lesson Plan -- Multiplying and Dividing Integers

Lesson Plan -- Multiplying and Dividing Integers Lesson Plan -- Multiplying and Dividing Integers Chapter Resources - Lesson 3-9 Multiply Integers - Lesson 3-9 Multiply Integers Answers - Lesson 3-10 Divide Integers - Lesson 3-10 Divide Integers Answers

More information

Lecture 2. Variables & Assignment

Lecture 2. Variables & Assignment Lecture 2 Variables & Assignment Announcements for Today If Not Done Already Enroll in Piazza Sign into CMS Fill out the Survey Complete AI Quiz Read the tetbook Chapter 1 (browse) Chapter 2 (in detail)

More information

2.2 Order of Operations

2.2 Order of Operations 2.2 Order of Operations Learning Objectives Evaluate algebraic expressions with grouping symbols. Evaluate algebraic expressions with fraction bars. Evaluate algebraic expressions using a graphing calculator.

More information

CS1 Lecture 3 Jan. 22, 2018

CS1 Lecture 3 Jan. 22, 2018 CS1 Lecture 3 Jan. 22, 2018 Office hours for me and for TAs have been posted, locations will change check class website regularly First homework available, due Mon., 9:00am. Discussion sections tomorrow

More information

Excel Functions & Tables

Excel Functions & Tables Excel Functions & Tables Fall 2014 Fall 2014 CS130 - Excel Functions & Tables 1 Review of Functions Quick Mathematics Review As it turns out, some of the most important mathematics for this course revolves

More information

ENGG1811 Computing for Engineers Week 1 Introduction to Programming and Python

ENGG1811 Computing for Engineers Week 1 Introduction to Programming and Python ENGG1811 Computing for Engineers Week 1 Introduction to Programming and Python ENGG1811 UNSW, CRICOS Provider No: 00098G W4 Computers have changed engineering http://www.noendexport.com/en/contents/48/410.html

More information

Chapter 4: Basic C Operators

Chapter 4: Basic C Operators Chapter 4: Basic C Operators In this chapter, you will learn about: Arithmetic operators Unary operators Binary operators Assignment operators Equalities and relational operators Logical operators Conditional

More information

Math 1525: Lab 4 Spring 2002

Math 1525: Lab 4 Spring 2002 Math 1525: Lab 4 Spring 2 Modeling---Best Fit Function: In this lab we will see how to use Excel to find a "best-fit equation" or model for your data. Example: When a new motion picture comes out, some

More information

Welcome to 5 th Grade Math Review Properties of Operations

Welcome to 5 th Grade Math Review Properties of Operations Welcome to 5 th Grade Math Review Properties of Operations What do you notice in this chart? Are there any patterns? Powers of Ten Strategy Time Interactive Math Journal Today s Lesson: Review of Properties

More information

Slide 1 CS 170 Java Programming 1 Expressions Duration: 00:00:41 Advance mode: Auto

Slide 1 CS 170 Java Programming 1 Expressions Duration: 00:00:41 Advance mode: Auto CS 170 Java Programming 1 Expressions Slide 1 CS 170 Java Programming 1 Expressions Duration: 00:00:41 What is an expression? Expression Vocabulary Any combination of operators and operands which, when

More information

Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore

Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore Lecture - 5 Elementary concepts and basic counting principles So, welcome

More information

Introduction to the workbook and spreadsheet

Introduction to the workbook and spreadsheet Excel Tutorial To make the most of this tutorial I suggest you follow through it while sitting in front of a computer with Microsoft Excel running. This will allow you to try things out as you follow along.

More information

CSI Lab 02. Tuesday, January 21st

CSI Lab 02. Tuesday, January 21st CSI Lab 02 Tuesday, January 21st Objectives: Explore some basic functionality of python Introduction Last week we talked about the fact that a computer is, among other things, a tool to perform high speed

More information

2 Unit Bridging Course Day 2 Linear functions I: Gradients

2 Unit Bridging Course Day 2 Linear functions I: Gradients 1 / 33 2 Unit Bridging Course Day 2 Linear functions I: Gradients Clinton Boys 2 / 33 Linear functions Linear functions are a particularly simple and special type of functions. They are widely used in

More information

VARIABLES & ASSIGNMENTS

VARIABLES & ASSIGNMENTS Fall 2018 CS150 - Intro to CS I 1 VARIABLES & ASSIGNMENTS Sections 2.1, 2.2, 2.3, 2.4 Fall 2018 CS150 - Intro to CS I 2 Variables Named storage location for holding data named piece of memory You need

More information

ENCM 369 Winter 2019 Lab 6 for the Week of February 25

ENCM 369 Winter 2019 Lab 6 for the Week of February 25 page of ENCM 369 Winter 29 Lab 6 for the Week of February 25 Steve Norman Department of Electrical & Computer Engineering University of Calgary February 29 Lab instructions and other documents for ENCM

More information

STACKS. A stack is defined in terms of its behavior. The common operations associated with a stack are as follows:

STACKS. A stack is defined in terms of its behavior. The common operations associated with a stack are as follows: STACKS A stack is a linear data structure for collection of items, with the restriction that items can be added one at a time and can only be removed in the reverse order in which they were added. The

More information

CMSC201 Computer Science I for Majors

CMSC201 Computer Science I for Majors CMSC201 Computer Science I for Majors Lecture 03 Operators All materials copyright UMBC and Dr. Katherine Gibson unless otherwise noted Variables Last Class We Covered Rules for naming Different types

More information

1.8 Intro to Variables, Algebraic Expressions, and Equations

1.8 Intro to Variables, Algebraic Expressions, and Equations 1.8 Intro to Variables, Algebraic Expressions, and Equations Professor Tim Busken M.S. Applied Mathematics with a Concentration in Dynamical Systems San Diego State University 2011 Southwestern College

More information

Programming Lecture 3

Programming Lecture 3 Programming Lecture 3 Expressions (Chapter 3) Primitive types Aside: Context Free Grammars Constants, variables Identifiers Variable declarations Arithmetic expressions Operator precedence Assignment statements

More information

Logical Operators and switch

Logical Operators and switch Lecture 5 Relational and Equivalence Operators SYS-1S22 / MTH-1A66 Logical Operators and switch Stuart Gibson sg@sys.uea.ac.uk S01.09A 1 Relational Operator Meaning < Less than > Greater than

More information

(Refer Slide Time: 00:03:51)

(Refer Slide Time: 00:03:51) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 17 Scan Converting Lines, Circles and Ellipses Hello and welcome everybody

More information

COMP Primitive and Class Types. Yi Hong May 14, 2015

COMP Primitive and Class Types. Yi Hong May 14, 2015 COMP 110-001 Primitive and Class Types Yi Hong May 14, 2015 Review What are the two major parts of an object? What is the relationship between class and object? Design a simple class for Student How to

More information

AP Computer Science Summer Work Mrs. Kaelin

AP Computer Science Summer Work Mrs. Kaelin AP Computer Science Summer Work 2018-2019 Mrs. Kaelin jkaelin@pasco.k12.fl.us Welcome future 2018 2019 AP Computer Science Students! I am so excited that you have decided to embark on this journey with

More information

Algebra 2 Semester 1 (#2221)

Algebra 2 Semester 1 (#2221) Instructional Materials for WCSD Math Common Finals The Instructional Materials are for student and teacher use and are aligned to the 2016-2017 Course Guides for the following course: Algebra 2 Semester

More information

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types

More information

Use the Associative Property of Multiplication to find the product.

Use the Associative Property of Multiplication to find the product. 3-1 1. The Associative Property of Multiplication states factors can be grouped differently and the product remains the same. Changing the grouping of the factors changes the factors that are multiplied

More information

Microsoft Excel 2010 Handout

Microsoft Excel 2010 Handout Microsoft Excel 2010 Handout Excel is an electronic spreadsheet program you can use to enter and organize data, and perform a wide variety of number crunching tasks. Excel helps you organize and track

More information

More Complicated Recursion CMPSC 122

More Complicated Recursion CMPSC 122 More Complicated Recursion CMPSC 122 Now that we've gotten a taste of recursion, we'll look at several more examples of recursion that are special in their own way. I. Example with More Involved Arithmetic

More information

MAT 003 Brian Killough s Instructor Notes Saint Leo University

MAT 003 Brian Killough s Instructor Notes Saint Leo University MAT 003 Brian Killough s Instructor Notes Saint Leo University Success in online courses requires self-motivation and discipline. It is anticipated that students will read the textbook and complete sample

More information

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials Fundamentals We build up instructions from three types of materials Constants Expressions Fundamentals Constants are just that, they are values that don t change as our macros are executing Fundamentals

More information

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators Operators Overview Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators Operands and Operators Mathematical or logical relationships

More information

Introduction and Functions

Introduction and Functions Introduction and Functions Math 131, Section 501 January 17, 2017 Math 131, Section 501 Introduction and Functions January 17, 2017 1 / 26 Introduction Paul Gustafson 4th year PhD student Topological phases

More information

Lesson 6: Manipulating Equations

Lesson 6: Manipulating Equations Lesson 6: Manipulating Equations Manipulating equations is probably one of the most important skills to master in a high school physics course. Although it is based on familiar (and fairly simple) math

More information

Functions and Families

Functions and Families Unit 3 Functions and Families Name: Date: Hour: Function Transformations Notes PART 1 By the end of this lesson, you will be able to Describe horizontal translations and vertical stretches/shrinks of functions

More information

Lab 7 1 Due Thu., 6 Apr. 2017

Lab 7 1 Due Thu., 6 Apr. 2017 Lab 7 1 Due Thu., 6 Apr. 2017 CMPSC 112 Introduction to Computer Science II (Spring 2017) Prof. John Wenskovitch http://cs.allegheny.edu/~jwenskovitch/teaching/cmpsc112 Lab 7 - Using Stacks to Create a

More information

Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore

Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore Module No. # 10 Lecture No. # 16 Machine-Independent Optimizations Welcome to the

More information

Math 3 Coordinate Geometry Part 2 Graphing Solutions

Math 3 Coordinate Geometry Part 2 Graphing Solutions Math 3 Coordinate Geometry Part 2 Graphing Solutions 1 SOLVING SYSTEMS OF EQUATIONS GRAPHICALLY The solution of two linear equations is the point where the two lines intersect. For example, in the graph

More information

Operators And Expressions

Operators And Expressions Operators And Expressions Operators Arithmetic Operators Relational and Logical Operators Special Operators Arithmetic Operators Operator Action Subtraction, also unary minus + Addition * Multiplication

More information

Think: 5 5 5, or 25. Think: Think: Evaluate Multiply. So, when s 2, the value of. 5(s 3) is 125. Then divide.

Think: 5 5 5, or 25. Think: Think: Evaluate Multiply. So, when s 2, the value of. 5(s 3) is 125. Then divide. 7 Multiply first. Think: 9 8 Then divide. Think: 8 Finally, subtract. Think: Replace a with 9. o, when a 9, the value of a is. 8 9 a ubtract.. Replace a with 5. The value of a is a a 5 b Add. is Divide.

More information

State the domain and range of the relation shown in the graph. Is the relation a function? You try: A relation is represented by

State the domain and range of the relation shown in the graph. Is the relation a function? You try: A relation is represented by 1 State the domain and range of the relation shown in the graph. Is the relation a function? 1a A relation is represented by! Remember: A relation is a set of ordered pairs that can be represented by a

More information

Exponential Notation

Exponential Notation Exponential Notation INTRODUCTION Chemistry as a science deals with the qualitative and quantitative aspects of substances. In the qualitative part, we deal with the general and specific properties of

More information

Department of Computer Science

Department of Computer Science Department of Computer Science Definition An operator is a symbol (+,-,*,/) that directs the computer to perform certain mathematical or logical manipulations and is usually used to manipulate data and

More information

Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions

Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions Variable is a letter or symbol that represents a number. Variable (algebraic)

More information

Summer Math Assignments for Students Entering Algebra II

Summer Math Assignments for Students Entering Algebra II Summer Math Assignments for Students Entering Algebra II Purpose: The purpose of this packet is to review pre-requisite skills necessary for the student to be successful in Algebra II. You are expected

More information

Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology. Scotland T 3. Matrices. Teachers Teaching with Technology (Scotland)

Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology. Scotland T 3. Matrices. Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology (Scotland) Teachers Teaching with Technology T 3 Scotland Matrices Teachers Teaching with Technology (Scotland) MATRICES Aim To demonstrate how the TI-83 can be used to

More information

SEQUENCES AND SERIES Sequences CC Standard

SEQUENCES AND SERIES Sequences CC Standard N Sequences and Series, Lesson 1, Sequences (r. 2018) SEQUENCES AND SERIES Sequences CC Standard NG Standard F-IF.A.3 Recognize that sequences are functions, sometimes defined recursively, whose domain

More information

Assessment of Programming Skills of First Year CS Students: Problem Set

Assessment of Programming Skills of First Year CS Students: Problem Set Assessment of Programming Skills of First Year CS Students: Problem Set Notes to the working group participants. Enclosed in this file are the three problems. They are in ascending order of difficulty.

More information

ECE Object-Oriented Programming using C++ and Java

ECE Object-Oriented Programming using C++ and Java 1 ECE 30862 - Object-Oriented Programming using C++ and Java Instructor Information Name: Sam Midkiff Website: https://engineering.purdue.edu/~smidkiff Office: EE 310 Office hours: Tuesday, 2:30 to 4:00

More information

Welcome back! Sit down and work on the warm up!

Welcome back! Sit down and work on the warm up! Welcome back! Sit down and work on the warm up! 1 Rewrite 4 4 4 4 4 4 4 4 4 using exponents 2 Circle the coefficient and square the constant of the function y=3x+7 3 Rewrite the expression using multiplication:

More information

Lab 4 Projectile Motion

Lab 4 Projectile Motion b Lab 4 Projectile Motion What You Need To Know: x = x v = v v o ox = v + v ox ox + at 1 t + at + a x FIGURE 1 Linear Motion Equations The Physics So far in lab you ve dealt with an object moving horizontally

More information

Summer Math Assignments for Students Entering Integrated Math

Summer Math Assignments for Students Entering Integrated Math Summer Math Assignments for Students Entering Integrated Math Purpose: The purpose of this packet is to review pre-requisite skills necessary for the student to be successful in Integrated Math. You are

More information

Operators & Expressions

Operators & Expressions Operators & Expressions Operator An operator is a symbol used to indicate a specific operation on variables in a program. Example : symbol + is an add operator that adds two data items called operands.

More information

Dealing with Output. Producing Numeric Output CHAPTER 3. Task. Figure 3-1. The program in action

Dealing with Output. Producing Numeric Output CHAPTER 3. Task. Figure 3-1. The program in action CHAPTER 3 You already know all the main steps that you should take when developing a program in the C# language. In addition, you have already seen the important statement Console. WriteLine, which displays

More information

Technical Arts 101 Prof. Anupam Saxena Department of Mechanical engineering Indian Institute of Technology, Kanpur. Lecture - 7 Think and Analyze

Technical Arts 101 Prof. Anupam Saxena Department of Mechanical engineering Indian Institute of Technology, Kanpur. Lecture - 7 Think and Analyze Technical Arts 101 Prof. Anupam Saxena Department of Mechanical engineering Indian Institute of Technology, Kanpur Lecture - 7 Think and Analyze Last time I asked you to come up with a single funniest

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 14: OCT. 25TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 14: OCT. 25TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 14: OCT. 25TH INSTRUCTOR: JIAYIN WANG 1 Notice Assignments No new homework this week. Please make up the homework 1 5 & class exercises this week.

More information

Lecture 9. Monday, January 31 CS 205 Programming for the Sciences - Lecture 9 1

Lecture 9. Monday, January 31 CS 205 Programming for the Sciences - Lecture 9 1 Lecture 9 Reminder: Programming Assignment 3 is due Wednesday by 4:30pm. Exam 1 is on Friday. Exactly like Prog. Assign. 2; no collaboration or help from the instructor. Log into Windows/ACENET. Start

More information

4. Write sets of directions for how to check for direct variation. How to check for direct variation by analyzing the graph :

4. Write sets of directions for how to check for direct variation. How to check for direct variation by analyzing the graph : Name Direct Variations There are many relationships that two variables can have. One of these relationships is called a direct variation. Use the description and example of direct variation to help you

More information

CS Introduction to Data Structures How to Parse Arithmetic Expressions

CS Introduction to Data Structures How to Parse Arithmetic Expressions CS3901 - Introduction to Data Structures How to Parse Arithmetic Expressions Lt Col Joel Young One of the common task required in implementing programming languages, calculators, simulation systems, and

More information

CS112 Lecture: Making Choices

CS112 Lecture: Making Choices CS112 Lecture: Making Choices Objectives: Last revised 1/19/06 1. To review the Java if and if... statements 2. To introduce relational expressions and boolean operators 3. To discuss nested if statements

More information

What we will do today Explain and look at examples of. Programs that examine data. Data types. Topic 4. variables. expressions. assignment statements

What we will do today Explain and look at examples of. Programs that examine data. Data types. Topic 4. variables. expressions. assignment statements Topic 4 Variables Once a programmer has understood the use of variables, he has understood the essence of programming -Edsger Dijkstra What we will do today Explain and look at examples of primitive data

More information

DECIMALS are special fractions whose denominators are powers of 10.

DECIMALS are special fractions whose denominators are powers of 10. Ch 3 DECIMALS ~ Notes DECIMALS are special fractions whose denominators are powers of 10. Since decimals are special fractions, then all the rules we have already learned for fractions should work for

More information

Section 1.2 Fractions

Section 1.2 Fractions Objectives Section 1.2 Fractions Factor and prime factor natural numbers Recognize special fraction forms Multiply and divide fractions Build equivalent fractions Simplify fractions Add and subtract fractions

More information

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

CSCI 204 Introduction to Computer Science II. Lab 6: Stack ADT

CSCI 204 Introduction to Computer Science II. Lab 6: Stack ADT CSCI 204 Introduction to Computer Science II 1. Objectives In this lab, you will practice the following: Learn about the Stack ADT Implement the Stack ADT using an array Lab 6: Stack ADT Use a Stack to

More information

Coefficient Constant Equivalent expressions Equation. 3 A mathematical sentence containing an equal sign

Coefficient Constant Equivalent expressions Equation. 3 A mathematical sentence containing an equal sign 8.4.0 Lesson Date Algebra Vocabulary and Generating Equivalent s Student Objectives I can identify how many terms an expression has and what the coefficients, constants, and like terms of that expression

More information

Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008

Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008 Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008 Ten questions, each worth the same amount. Complete six of your choice. I will only grade the first six I see. Make sure your name

More information

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment 60-212 subir@cs.uwindsor.ca Phone # 253-3000 Ext. 2999 web site for course www.cs.uwindsor.ca/60-212 Dr. Subir Bandyopadhayay Website has detailed rules and regulations All assignments and labs will be

More information

CS1110 Lab 1 (Jan 27-28, 2015)

CS1110 Lab 1 (Jan 27-28, 2015) CS1110 Lab 1 (Jan 27-28, 2015) First Name: Last Name: NetID: Completing this lab assignment is very important and you must have a CS 1110 course consultant tell CMS that you did the work. (Correctness

More information

Perl: Arithmetic, Operator Precedence and other operators. Perl has five basic kinds of arithmetic:

Perl: Arithmetic, Operator Precedence and other operators. Perl has five basic kinds of arithmetic: Perl: Arithmetic, Operator Precedence and other operators Robert A. Fulkerson College of Information Science and Technology http://www.ist.unomaha.edu/ University of Nebraska at Omaha http://www.unomaha.edu/

More information

Mathematical Reasoning. Lesson 37: Graphing Quadratic Equations. LESSON 37: Graphing Quadratic Equations

Mathematical Reasoning. Lesson 37: Graphing Quadratic Equations. LESSON 37: Graphing Quadratic Equations LESSON 37: Graphing Quadratic Equations Weekly Focus: quadratic equations Weekly Skill: graphing Lesson Summary: For the warm-up, students will solve a problem about mean, median, and mode. In Activity

More information

Section 1.1 Definitions and Properties

Section 1.1 Definitions and Properties Section 1.1 Definitions and Properties Objectives In this section, you will learn to: To successfully complete this section, you need to understand: Abbreviate repeated addition using Exponents and Square

More information

Marketing Research Participation for BUAD 307

Marketing Research Participation for BUAD 307 Marketing Research Participation for BUAD 307 Note that this handout amends your syllabus regarding the Market Research Participation Questions about registering and participating: mkt.sona@marshall.usc.edu

More information

In math, the rate of change is called the slope and is often described by the ratio rise

In math, the rate of change is called the slope and is often described by the ratio rise Chapter 3 Equations of Lines Sec. Slope The idea of slope is used quite often in our lives, however outside of school, it goes by different names. People involved in home construction might talk about

More information

Section we will not cover section 2.11 feel free to read it on your own

Section we will not cover section 2.11 feel free to read it on your own Operators Class 5 Section 2.11 we will not cover section 2.11 feel free to read it on your own Data Types Data Type A data type is a set of values and a set of operations defined on those values. in class

More information