Instructions PLEASE READ (notice bold and underlined phrases)

Size: px
Start display at page:

Download "Instructions PLEASE READ (notice bold and underlined phrases)"

Transcription

1 Assignment 2 Writing Basic Java Programs Required Reading Java Foundations Chapter 2 Data and Expressions Chapter 3 Sections , Chapter 4 Sections , Instructions PLEASE READ (notice bold and underlined phrases) This assignment has three parts: A. Written Answer the questions, submit a Word or PDF document B. Programming Code must be well commented, compile/test, then submit C. Submission Submit specified assignment files by deadline 1. This is an individual assignment. You may NOT work in teams for this assignment. You may discuss ideas with others, but you must answer all questions and write all the code yourself. You have reviewed the SFU Plagiarism guidelines. Please abide by them. Do not even copy a variable name that is plagiarism. Plagiarism hurts your learning process. Learn from others but do the work yourself and you will learn the material faster. Plagiarism by students will result penalties that may include receiving zero for the assignment. 2. All Files Submitted for Programming Assignments must include block comments for the Class and each Method. Block comments for the Class must include the name of the Java Class plus a short description of what the Class does. Comments should also include the Student s name and Student Number. Each Method should describe what the Method does, its parameters, and return values using JavaDoc compatible comments. 3. Submission deadline: 11:59pm Sunday Oct 6th. You should be able to complete the work if you have completed the required reading for the assignment. More material is available in the Class Slides. While you have seen most of what is discussed here, some topics discussed in this assignment and needed for your submission may not be seen until another class! You may submit before the deadline, if you so prefer. You may resubmit again later without penalty provided you resubmit before the deadline. 4. Keep a copy of everything you submit in your files. 5. READ. What is TRACE printing? Trace printing is a term to refer to additional printing that the programmer chooses to add while developing and debugging the program. With such printed information we are 1

2 tracing the execution of the program, that is, we, as programmers, are double checking what the execution of the program is and what some intermediate results are. The idea is that once the program is debugged (free of logical errors), those extra printing statements are commented out, as they are not meant to be seen by the user. For the exercises below, you are encouraged to add Trace Printing to your program to TRACE the program flow of control through the statements. Add the word TRACE in front of the trace printing to identify the extra printing so it will be easy to spot and remove. In some IDE s there are special tracing options that automate this process for you. Tracing is a very common (and needed!) practice among programmers in real life! It is an important skill to learn. In a future lab demo, we will learn better methods of watching program flow and for finding logic errors within your program as it runs. For now, you are encouraged to use println to find and correct errors in your program. This process is known as Debugging. The term comes from the days of ENIAC and its descendants that used relays and vacuum tubes to make up its computing circuits. These early computers were known to break down when insects would rest inside the relays. The debugging process was originally coined in those early days when they had to physically pick out the insects, the bugs, from the relays to get the computer working again. Today, the term Debugging is still used to mean finding computer program errors, the bugs, and fixing them. 6. READ. Another common and useful practice to debug programs (used in real life too!) is to run the code by hand (other terms may be used to refer to this activity also). The idea of hand tracing is to follow or simulate manually (using paper and pencil) what the different variable values are as the code is executing. This is particularly useful for small pieces of code and edge cases such as the first and last time through a loop. We will see examples of this during the course. 2

3 A. Written Assignment Answers to be submitted into CourSys Students may discuss the problems with fellow students, but students MUST complete the work on their own and the submitted answers must be your own work. Section A does not require any programming. Write your answers neatly in a document that will be submitted to CourSys as part of the assignment. Your document must be called a2writeup.doc or a2writeup.pdf and must include your name, student number, Course Name, Assignment Number, and Date along with your answers to the following questions. Use Courier font and double-space in your write up. 1. Operator Precedence 10 Marks Determine the operator precedence for the following expressions and evaluate each expression based on this precedence. Assume that the variables are defined as follows: int a = 1; int b = 2, int c = 3, int d = 4; int e = 5; double f = 10; In your submission, list each expression with your computed result, then write the order of evaluation under each operator. For example: (x) a + b + c + d Expected submission: (x) a + b + c + d = Determine operator precedence and evaluate the following: (a) a b c d (b) a b + c d (c) a + b / c / d (d) a + b / c * d (e) a / b * c * d (f) a % b / c * d (g) a % b % c % d (h) a (b c) - d (i) (a (b c)) d (j) a ((b c) d) 3

4 (k) a % (b %c) * d * e (l) a + (b c) * d e (m) (a + b) * c + d * e (n) (a + b) * (c /d) % e (o) (a + b + c + d + e)/ f (p) a + b + c + d + e + f (q) (a < b)!(c == d) (r) (a == b)? c : d (s) --a++ + a (t) a a + a 2. Generating Random Numbers 5 Marks Assuming that a Random object called generator has been created, what is the range of the result of each of the following expressions? (a) generator.nextint(20) (b) generator.nextint(8) + 1 (c) generator.nextint(45) + 10 (d) generator.nextint(100) Definite Loops 5 Marks Write a for loop to print the odd numbers from 1 to 99 (inclusive). You do not need to write a running program, just the for-loop and for-loop body. 4. Indefinite Loops 5 Marks Transform the following while loop into an equivalent do loop int num = 1; while (num < 20) { num++; system.out.println(num); } 4

5 B. Programming To be completed by Students Individually 1. Random Numbers 10 Marks Write a program with Class name RandomAvg that asks the user to specify the number of random numbers to generate. Your program should generate this number of random numbers from 1 to 100, print out each number, and then print the maximum number generated, the average with up to 3 decimal places, and the minimum number generated. Example test run: (user input is in BOLD) Enter how many random numbers you want to average: 3 Your 3 lucky random numbers are: Largest = 99 Average = Smallest= 2 2. Computing a Running Total and Average 10 Marks Write an application that reads a single line of input from the user containing at least one and up to 10 integers. Your program must compute the average. Pay attention to any conversions required. Print the average with to up to 3 decimal places. If any of the values entered by the user on the input line are non-integers or the user supplies too few or too many values, your program must discard the entire set of input and prompt the user to enter a new set of integers between 1 and 10. Your Java Class file should be called AvgNums.java. Example test run: Enter up to 10 numbers to average: 3 4 Average = Using the Math Class 10 Marks Write a program with Class name Distance that asks the user to enter the (x,y) coordinates for two points where both x and y must be integers. Compute the distance between the two points using the formula: distance = If any of the four coordinates are non-integers, your input validation should reject them all and ask for all four coordinates again. Your program must print the result with up to three decimal places. For 5

6 example, here is a sample run with the coordinates (0,0) and (8,2): Example test run: Specify two (x,y) coordinates as x1 y1 x2 y2: Distance from point(0,0) to point(8,2) = Making Change 15 Marks Write a program with a class called MoneyChanger whose main method prompts for and reads a double value representing a monetary amount. Then determine the least number of each Canadian bill and coin needed to represent that amount, starting with the highest (assume that a twentydollar bill is the maximum needed). If the entered value is not a double then your program must report an error and re-prompt the user for a double value. If, for example, the value entered is (fifty-seven dollars and sixty-three cents), then the program should print the equivalent amount as: Example test run: Enter monetary amount: $57.63 "$57.63" is not a double. Please enter a monetary amount as a double: That's equivalent to: 2 twenty dollar bills 1 ten dollar bill 1 five dollar bill 1 toony 0 loonies 2 quarters 1 dime 0 nickels 3 pennies 5. Counting Change and Program Decomposition 30 Marks Write another program with class name MoneyCounter that reads input from a user describing how many bills or coins of each type that they have using the same syntax as the output from Question 4 above. The program must keep a running total of the amount of money and print the final amount. Your program must skip over any input lines that do not start with an integer value or which do not have one of the following currency denominations as the second word on the same input line: 6

7 twenty ten five toonies toony loonies loony quarters quarter dimes dime nickels nickel pennies penny Your program should skip over any additional text on an input line after the number and the currency name. Your program should stop when there is no more input or when the user specifies the number of pennies. The word pennies or penny acts as a sentinel to tell your program to exit the input loop and print the total. Once out of the loop, the program should report how much total money was entered with the number formatted as a currency. Example test run: Enter the number of bills and coins you want counted. Please enter the number followed by the bill or coin name: 1 ten dollar bill But wait, I have more ten dollar bills coming! 5 ten dollar bills 1 quarter 1 ten dollar bills 3 pennies Your total amount of cash is: $70.28 Hint: Having programs read input characters with a specific syntax is called Parsing. Your program will need to use string comparison and if statements to check if a string token returned from the scanner matches any of the denomination strings above. You should use String.toLowerCase so your program is not case sensitive. You should handle the case where the coin or bill type is specified as singular or plural. For example: your code should be able to handle both dime and dimes and interpret both to represent units of ten cents. Parsing can get complicated and your main program should not have to worry about these details. Breaking a complex problem into two or more simpler problems is called Decomposition. This is how we go about solving complex problems. We break up a complex problem into several smaller ones that we can solve more easily. You will use decomposition a lot in this course and in the future. We will use decomposition here as well. This is the heart of Mañana Programming. Focus on the big details now, and worry about all the little details Mañana tomorrow. That is one secret to good design. Define an enum called CurrencyAmt to represent the above currency denominations as an enum data type. Include within the enum a special sentinel value called invalidcurrency. 7

8 Decompose your program by creating a static method within your class called parsecurrency that will accept a String parameter and return the corresponding CurrencyAmt value associated with that String, or return invalidcurrency if there is no matching currency denomination for that string. This will hide the complexity of parsing string currencies from your main program. Even before you fill in the implementation details of parsecurrency, you can continue working on your main program and make method calls to parsecurrency within main where appropriate. Do not worry that parsecurrency is not yet fully implemented, it will be Mañana. Complete the MoneyCounter program and test it by using the output of MoneyChanger as input into this program using cut/paste to copy the output from MoneyCounter into the input to MoneyChanger. The amount that you input into MoneyCounter should equal the amount printed by MoneyChanger when you use the output of first as the input to the later. 8

9 C. Submission To be Completed by Students Individually Student are responsible for submitting the requested work files by the stated deadline for full marks. It is the student s responsibility to submit on time. Submissions via will NOT be accepted. 1. You must submit your final version of the following files before the deadline. All written answers for Part A must be included in a single Word or PDF document which is double spaced and includes the Student s Name and Student Number at the top, along with the Course Number and Assignment Number. Students must ensure that all submitted code compiles and is properly commented and formatted for readability. Part A : a2writeup.doc or a2writeup.pdf Question B1 : RandomAvg.java Question B2 : AvgNums.java Question B3 : Distance.java Question B4 : MoneyChanger.java Question B5 : MoneyCounter.java 2. Files are to be submitted into CourSys under A02 as individuals. No group name is required and none should one be used. See the course website for submission instructions at: 9

Marking rubric for Assignment #2

Marking rubric for Assignment #2 Marking rubric for Assignment #2 The TAs marked the following sections: Yu: Section A Questions -4, Section B Questions -3 Megan: Section B Questions 4-5 Assignment #2 Marking Rubric: A. WriteUp Please

More information

Prerequisites: Read all chapters through Chapter 4 in the textbook before attempting this lab. Read through this entire assignment before you begin.

Prerequisites: Read all chapters through Chapter 4 in the textbook before attempting this lab. Read through this entire assignment before you begin. Assignment Number 5 Lab Assignment Due Date: Wednesday, October 3, 2018 LAB QUESTIONS Due Date: Email before Monday, October 8, 2018 before 5:00 PM CS 1057 C Programming - Fall 2018 Purpose: write a complete

More information

Reviewing for the Midterm Covers chapters 1 to 5, 7 to 9. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013

Reviewing for the Midterm Covers chapters 1 to 5, 7 to 9. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013 Reviewing for the Midterm Covers chapters 1 to 5, 7 to 9 Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013 2 Things to Review Review the Class Slides: Key Things to Take Away Do you understand

More information

Instructions PLEASE READ (notice bold and underlined phrases)

Instructions PLEASE READ (notice bold and underlined phrases) Assignment 4 Recursive and Sorting Methods Solutions Required Reading Java Foundations Chapter 13 Linked Structures Chapter 17 Recursion Chapter 18 Searching and Sorting Chapter 19 Trees Instructions PLEASE

More information

Instructions PLEASE READ (notice bold and underlined phrases)

Instructions PLEASE READ (notice bold and underlined phrases) Assignment 3 Dynamic Arrays and Inheritance Note: This is a Preview! More Questions are coming in Version 1.0 Required Reading Problem Solving with C++ Chapter 7 Arrays Chapter 9 Pointers and Dynamic Arrays

More information

Gateway Regional School District VERTICAL ARTICULATION OF MATHEMATICS STANDARDS Grades K-4

Gateway Regional School District VERTICAL ARTICULATION OF MATHEMATICS STANDARDS Grades K-4 NUMBER SENSE & OPERATIONS K.N.1 Count by ones to at least 20. When you count, the last number word you say tells the number of items in the set. Counting a set of objects in a different order does not

More information

Place Value. Objectives To develop place-value concepts and connect place value in money with place value in base-10 blocks. Assessment Management

Place Value. Objectives To develop place-value concepts and connect place value in money with place value in base-10 blocks. Assessment Management Place Value Objectives To develop place-value concepts and connect place value in money with place value in base-10 blocks. www.everydaymathonline.com epresentations etoolkit Algorithms Practice EM Facts

More information

Lesson 5: Introduction to the Java Basics: Java Arithmetic THEORY. Arithmetic Operators

Lesson 5: Introduction to the Java Basics: Java Arithmetic THEORY. Arithmetic Operators Lesson 5: Introduction to the Java Basics: Java Arithmetic THEORY Arithmetic Operators There are four basic arithmetic operations: OPERATOR USE DESCRIPTION + op1 + op2 Adds op1 and op2 - op1 + op2 Subtracts

More information

n! = 1 * 2 * 3 * 4 * * (n-1) * n

n! = 1 * 2 * 3 * 4 * * (n-1) * n The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion Objectives By completing this lab exercise, you should learn to Recognize simple self-similar problems which are

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

Primitive Data, Variables, and Expressions; Simple Conditional Execution

Primitive Data, Variables, and Expressions; Simple Conditional Execution Unit 2, Part 1 Primitive Data, Variables, and Expressions; Simple Conditional Execution Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Overview of the Programming Process Analysis/Specification

More information

SELECTION IDIOMS. Here is a summary of appropriate selection idioms: Selection Idioms. Action Condition Construct to Use. Sequential if statements

SELECTION IDIOMS. Here is a summary of appropriate selection idioms: Selection Idioms. Action Condition Construct to Use. Sequential if statements SELECTION IDIOMS The programming idioms for selection statements depend on the concept of mutual exclusion. Two truth values are mutually exclusive if no more than one of them can be true. Two actions

More information

Counting and Cardinality (CC) K 2 Know number names and the count sequence.

Counting and Cardinality (CC) K 2 Know number names and the count sequence. Counting and Cardinality (CC) K 2 Know number names and the count sequence. K.1 Count to 100 by ones and by tens. Essence: Counting E1: Count up to 50 by 1s or 10s. E2: Count up to 20 by 1s. E3: Using

More information

CS 112: Intro to Comp Prog

CS 112: Intro to Comp Prog CS 112: Intro to Comp Prog Lecture Review Data Types String Operations Arithmetic Operators Variables In-Class Exercises Lab Assignment #2 Upcoming Lecture Topics Variables * Types Functions Purpose Parameters

More information

1 Short Answer (5 Points Each)

1 Short Answer (5 Points Each) COSC 117 Exam #1 Solutions Fall 015 1 Short Answer (5 Points Each) 1. What is the difference between a compiler and an interpreter? Also, discuss Java s method. A compiler will take a program written in

More information

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, August 28th, before 11:55 PM Out of 100 points

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, August 28th, before 11:55 PM Out of 100 points CS 2316 Individual Homework 1 Python Practice Due: Wednesday, August 28th, before 11:55 PM Out of 100 points Files to submit: 1. HW1.py For Help: - TA Helpdesk Schedule posted on class website. - Email

More information

Project 1: How to Make One Dollar

Project 1: How to Make One Dollar Project Objective: Project 1: How to Make One Dollar Posted: Wednesday February 16, 2005. Described: Thursday February 17, 2005. Due: 11:59PM, Sunday March 6, 2005. 1. get familiar with the process of

More information

Instructions PLEASE READ (notice bold and underlined phrases)

Instructions PLEASE READ (notice bold and underlined phrases) Lab Exercises wk02 Lab Basics First Lab of the course Required Reading Java Foundations - Section 1.1 - The Java Programming Language Instructions PLEASE READ (notice bold and underlined phrases) Lab Exercise

More information

Welcome to the Primitives and Expressions Lab!

Welcome to the Primitives and Expressions Lab! Welcome to the Primitives and Expressions Lab! Learning Outcomes By the end of this lab: 1. Be able to define chapter 2 terms. 2. Describe declarations, variables, literals and constants for primitive

More information

Mississippi College and Career Readiness Standards for Mathematics Scaffolding Document. Grade 2

Mississippi College and Career Readiness Standards for Mathematics Scaffolding Document. Grade 2 Mississippi College and Career Readiness Standards for Mathematics Scaffolding Document Grade 2 Operations and Algebraic Thinking Represent and solve problems involving addition and subtraction 2.OA.1

More information

Chapter 2. Elementary Programming

Chapter 2. Elementary Programming Chapter 2 Elementary Programming 1 Objectives To write Java programs to perform simple calculations To obtain input from the console using the Scanner class To use identifiers to name variables, constants,

More information

pset1: C Tommy MacWilliam Grading Getting Started pset1: C Style Pennies Greedy Chart September 11, 2011

pset1: C Tommy MacWilliam Grading Getting Started pset1: C Style Pennies Greedy Chart September 11, 2011 tmacwilliam@cs50.net September 11, 2011 Today s Music 3OH!3 Deja Vu Hey See you Go Streets of Gold Axes scope: does it have everything? correctness: does it work? design: how efficiently does it work,

More information

Grade 2 Mathematics Curriculum Map

Grade 2 Mathematics Curriculum Map 1 st Unit 1A: Underst Place Value *2.NBT.2 is repeated in Units 2 3, each time extending the skill. The skill focused on in this unit is bolded in the S.L.O. 2.NBT.1 Underst that the 3 digits of a 3-digit

More information

CEN 414 Java Programming

CEN 414 Java Programming CEN 414 Java Programming Instructor: H. Esin ÜNAL SPRING 2017 Slides are modified from original slides of Y. Daniel Liang WEEK 2 ELEMENTARY PROGRAMMING 2 Computing the Area of a Circle public class ComputeArea

More information

Instructions PLEASE READ (notice bold and underlined phrases)

Instructions PLEASE READ (notice bold and underlined phrases) Lab Exercises wk12 Practice with Linked Lists Required Reading Chapter 13 - Pointers and Linked Lists Lecture Slides on Linked Lists, Presented in class wk11 Instructions PLEASE READ (notice bold and underlined

More information

Assignments 3 & 4. COMP248/Winter Assignment 3 & 4 Page 1 of 7

Assignments 3 & 4. COMP248/Winter Assignment 3 & 4 Page 1 of 7 Concordia University Comp 248 Winter 2016 Introduction to Programming Combined Assignments 3 & 4 - Due by 11:59 PM Sunday March 20, 2016 Assignments 3 & 4 Purpose: The purpose of these assignments is to

More information

COMP 202 Java in one week

COMP 202 Java in one week COMP 202 Java in one week... Continued CONTENTS: Return to material from previous lecture At-home programming exercises Please Do Ask Questions It's perfectly normal not to understand everything Most of

More information

Gateway Regional School District VERTICAL ALIGNMENT OF MATHEMATICS STANDARDS Grades 3-6

Gateway Regional School District VERTICAL ALIGNMENT OF MATHEMATICS STANDARDS Grades 3-6 NUMBER SENSE & OPERATIONS 3.N.1 Exhibit an understanding of the values of the digits in the base ten number system by reading, modeling, writing, comparing, and ordering whole numbers through 9,999. Our

More information

Understanding Addition and Subtraction Strategies Unit

Understanding Addition and Subtraction Strategies Unit Understanding Addition and Subtraction Strategies Unit PA EC: M3.D.1.1.1 E: Extend or find a missing element in a pattern of numbers. *Pattern must show 3 repetitions *When multiples are used limit to

More information

Com S 227 Spring 2018 Topics and review problems for Exam 1 Monday, February 19, 6:45 pm Exam locations by last name:

Com S 227 Spring 2018 Topics and review problems for Exam 1 Monday, February 19, 6:45 pm Exam locations by last name: Com S 227 Spring 2018 Topics and review problems for Exam 1 Monday, February 19, 6:45 pm Exam locations by last name: A-B Food Science 2432 C-J LeBaron 1210 *** You must bring your ID to the exam *** K-Q

More information

Lab 7: Change Calculation Engine

Lab 7: Change Calculation Engine Lab 7: Change Calculation Engine Summary: Practice assembly language programming by creating and testing a useful cash register change calculation program that will display results on an LCD display. Learning

More information

Math in Focus Vocabulary. Kindergarten

Math in Focus Vocabulary. Kindergarten Math in Focus Vocabulary Kindergarten Chapter Word Definition 1 one 1 * 1 two 2 * * 1 three 3 * * * 1 four 4 * * * * 1 five 5 * * * * * 1 same things that have a common property 1 different things that

More information

Lesson 13: Converting Between Fractions and Decimals Using Equivalent Fractions

Lesson 13: Converting Between Fractions and Decimals Using Equivalent Fractions Lesson 13: Converting Between and Decimals Using Equivalent Student Outcomes Students understand that the context of a real-life situation often determines whether a rational number should be represented

More information

Lecture 2: Operations and Data Types

Lecture 2: Operations and Data Types Lecture 2: Operations and Data Types Building Java Programs: A Back to Basics Approach by Stuart Reges and Marty Stepp Copyright (c) Pearson 2013. All rights reserved. Data types type: A category or set

More information

Common Core State Standards - Standards for Mathematical Practice

Common Core State Standards - Standards for Mathematical Practice Common Core State Standards - Standards for Mathematical Practice The Standards for Mathematical Practice describe varieties of expertise that mathematics educators at all levels should seek to develop

More information

Grade 2 Yearlong Mathematics Map

Grade 2 Yearlong Mathematics Map Grade 2 Yearlong Mathematics Map Resources: Approved from Board of Education Assessments: Performance Series, District Benchmark Assessments Common Core State Standards Standards for Mathematical Practice:

More information

Chapter 2.6: Testing and running a solution

Chapter 2.6: Testing and running a solution Chapter 2.6: Testing and running a solution 2.6 (a) Types of Programming Errors When programs are being written it is not surprising that mistakes are made, after all they are very complicated. There are

More information

Slide 1 CS 170 Java Programming 1 Real Numbers Duration: 00:00:54 Advance mode: Auto

Slide 1 CS 170 Java Programming 1 Real Numbers Duration: 00:00:54 Advance mode: Auto CS 170 Java Programming 1 Real Numbers Understanding Java's Floating Point Primitive Types Slide 1 CS 170 Java Programming 1 Real Numbers Duration: 00:00:54 Floating-point types Can hold a fractional amount

More information

3rd Grade Mathematics

3rd Grade Mathematics 3rd Grade Mathematics 2012-2013 MONTH CONTENT/ THEME CORE GOALS/SKILLS WRITTEN ASSESSMENT TEN MINUTE MATH VOCABULARY September 17 days Trading Stickers, Combining Coins Unit 1 *NOT CC NUMBERS AND Addition,

More information

2nd Grade Iowa Core - I Cans...

2nd Grade Iowa Core - I Cans... Operations and Algebraic Thinking 2.OA Operations and Algebraic Thinking 2.OA Represent and solve problems involving addition Represent and solve problems involving addition and subtraction. and subtraction.

More information

Instructions PLEASE READ (notice bold and underlined phrases)

Instructions PLEASE READ (notice bold and underlined phrases) Lab Exercises wk05 More Debugging with NetBeans Required Reading None Instructions PLEASE READ (notice bold and underlined phrases) Lab Exercise has three parts: A. Lab Demo Watch Demo, reproduce it, show

More information

Add and subtract within 20.

Add and subtract within 20. Represent and solve problems involving addition and subtraction. 2.OA.1. Use addition and subtraction within 100 to solve one- and twostep word problems involving situations of adding to, taking from,

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan Lecture 08-1 Programming in C++ PART 1 By Assistant Professor Dr. Ali Kattan 1 The Conditional Operator The conditional operator is similar to the if..else statement but has a shorter format. This is useful

More information

Lab: PiggyBank. Defining objects & classes

Lab: PiggyBank. Defining objects & classes Lab: PiggyBank Defining objects & classes Review: Basic class structure public class ClassName { Fields Constructors Methods } Three major components of a class: Fields store data for the object to use

More information

CMPT 120 Control Structures in Python. Summer 2012 Instructor: Hassan Khosravi

CMPT 120 Control Structures in Python. Summer 2012 Instructor: Hassan Khosravi CMPT 120 Control Structures in Python Summer 2012 Instructor: Hassan Khosravi The If statement The most common way to make decisions in Python is by using the if statement. The if statement allows you

More information

HOW TO DIVIDE: MCC6.NS.2 Fluently divide multi-digit numbers using the standard algorithm. WORD DEFINITION IN YOUR WORDS EXAMPLE

HOW TO DIVIDE: MCC6.NS.2 Fluently divide multi-digit numbers using the standard algorithm. WORD DEFINITION IN YOUR WORDS EXAMPLE MCC6.NS. Fluently divide multi-digit numbers using the standard algorithm. WORD DEFINITION IN YOUR WORDS EXAMPLE Dividend A number that is divided by another number. Divisor A number by which another number

More information

Curriculum at a Glance Kindergarten- Grade 5

Curriculum at a Glance Kindergarten- Grade 5 Curriculum at a Glance Kindergarten- Grade 5 Students learn to reason and communicate, be problem-solvers, value mathematics and feel confident in their ability to apply concepts and skills. Creating such

More information

Dublin Unified School District Suggested Pacing Guide for Grade 2 Text: Scott Foresman-Addison Wesley envision Math

Dublin Unified School District Suggested Pacing Guide for Grade 2 Text: Scott Foresman-Addison Wesley envision Math Trimester 1 8 Topic 1: Understanding Addition and Subtraction 1 1-1: s: Writing Addition Sentences, 1 1-2: s: Stories About Joining AF 1.0,, 1 1-3: s: Writing Subtraction Sentences, 1 1-4: s: Stories About

More information

Computer Science E-50a: Introduction to Computer Science Using Java, I Handout #7 part 2

Computer Science E-50a: Introduction to Computer Science Using Java, I Handout #7 part 2 Computer Science E-50a: Introduction to Computer Science Using Java, I Handout #7 part 2 part 2 These problems are due prior to the start of lecture on Monday night, March 31. Part A The Reading You may

More information

CS 240 Fall 2015 Section 004. Alvin Chao, Professor

CS 240 Fall 2015 Section 004. Alvin Chao, Professor CS 240 Fall 2015 Section 004 Alvin Chao, Professor Today Course overview Data Structures / Algorithms Course policies The C language Motivation Computers are digital Data is stored in binary format (1's

More information

Programming Paradigms: Overview to State Oriented

Programming Paradigms: Overview to State Oriented Programming Paradigms: Overview to State Oriented There are many ways to view programming! Four Principal Programming Paradigms are: COP: Control Oriented DOP: Data Oriented Input hr hr > 7*4 Emphasizes

More information

Computational Expression

Computational Expression Computational Expression Variables, Primitive Data Types, Expressions Janyl Jumadinova 28-30 January, 2019 Janyl Jumadinova Computational Expression 28-30 January, 2019 1 / 17 Variables Variable is a name

More information

Simpson Elementary School Curriculum Prioritization and Mapping 2nd Grade Math - Revised 6/2014

Simpson Elementary School Curriculum Prioritization and Mapping 2nd Grade Math - Revised 6/2014 Simpson lementary School Curriculum Prioritization and Mapping Timeline Topic Priority Standard Learning Targets On-Going 2.OA.2 - Fluently add and subtract within 20 using mental strategies by end of

More information

Introduction to Programming COIT 20245

Introduction to Programming COIT 20245 Introduction to Programming COIT 20245 Assessment item 1 Java Console Program Due date: Weighting: Length: Week 7 T318 24 December 2018 Refer below for complete assessment item 1 requirements (Assignment

More information

WEST VIRGINIA ADULT BASIC EDUCATION SKILLS CHECKLIST ABE MATHEMATICS Federal Functioning Level 1 Beginning Literacy (0 1.9)

WEST VIRGINIA ADULT BASIC EDUCATION SKILLS CHECKLIST ABE MATHEMATICS Federal Functioning Level 1 Beginning Literacy (0 1.9) Student: Instructor: WEST VIRGINIA ADULT BASIC EDUCATION SKILLS CHECKLIST ABE MATHEMATICS Federal Functioning Level 1 Beginning Literacy (0 1.9) Program: Enrolled: M.0 PRE-COMPUTATIONAL MATH SKILLS 0.1.1

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Fall 2018 Miniassignment 1 40 points Due Date: Friday, October 12, 11:59 pm (midnight) Late deadline (25% penalty): Monday, October 15, 11:59 pm General information This assignment is to be done

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Spring 2018 Miniassignment 1 40 points Due Date: Thursday, March 8, 11:59 pm (midnight) Late deadline (25% penalty): Friday, March 9, 11:59 pm General information This assignment is to be done

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

Casey County Schools- 2 nd Grade Math Curriculum Map

Casey County Schools- 2 nd Grade Math Curriculum Map Week(s) Concept (Big Ideas) Weeks 1 Topic 1 Understanding Addition and Subtraction Standards I can statement Critical Vocabulary 2.OA.1 Use addition and subtraction within 100 to solve oneand two-step

More information

Lesson 02 Data Types and Statements. MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL

Lesson 02 Data Types and Statements. MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Lesson 02 Data Types and Statements MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Topics Covered Statements Variables Constants Data Types

More information

ROCHESTER COMMUNITY SCHOOL MATHEMATICS SCOPE AND SEQUENCE, K-5 STRAND: NUMERATION

ROCHESTER COMMUNITY SCHOOL MATHEMATICS SCOPE AND SEQUENCE, K-5 STRAND: NUMERATION STRAND: NUMERATION Shows one-to-one correspondence for numbers 1-30 using objects and pictures Uses objects and pictures to show numbers 1 to 30 Counts by 1s to 100 Counts by 10s to 100 Counts backwards

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming Java Syntax Program Structure Variables and basic data types. Industry standard naming conventions. Java syntax and coding conventions If Then Else Case statements Looping (for,

More information

Homeschool Programming, Inc.

Homeschool Programming, Inc. Online Course Overview Course Title: TeenCoder: Java Programming TeenCoder: Java Programming Online Course Syllabus and Planner Updated November, 2015 Online ISBN: 978-0-9887070-2-3, published 2015 by

More information

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager Points Possible: 100 Submission via Canvas No collaboration among groups. Students in one group should NOT share any project

More information

Objective: Combine shapes to create a composite shape; create a new shape from composite shapes.

Objective: Combine shapes to create a composite shape; create a new shape from composite shapes. NYS COMMON CORE MATHEMATICS CURRICULUM Lesson 6 2 8 Lesson 6 Objective: Combine shapes to create a composite shape; create a new shape Suggested Lesson Structure Fluency Practice Application Problem Concept

More information

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode STUDENT OUTLINE Lesson 8: Structured Programming, Control Structures, if- Statements, Pseudocode INTRODUCTION: This lesson is the first of four covering the standard control structures of a high-level

More information

Monroe County School District Elementary Pacing Guide

Monroe County School District Elementary Pacing Guide Date Taught: Second Grade Unit 1: Numbers and Operations in Base Ten Timeline: August Fall Break CMA: October 6-7 M.NO.2.1 Understand that the three digits of a three-digit number represent amounts of

More information

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++ Repetition Contents 1 Repetition 1.1 Introduction 1.2 Three Types of Program Control Chapter 5 Introduction 1.3 Two Types of Repetition 1.4 Three Structures for Looping in C++ 1.5 The while Control Structure

More information

Math Vocabulary Grades PK - 5

Math Vocabulary Grades PK - 5 Math Vocabulary ades P - 5 P 1 2 3 4 5 < Symbol used to compare two numbers with the lesser number given first > Symbol used to compare two numbers with the greater number given first a. m. The time between

More information

Due: Tuesday 29 November by 11:00pm Worth: 8%

Due: Tuesday 29 November by 11:00pm Worth: 8% CSC 180 H1F Project # 3 General Instructions Fall 2016 Due: Tuesday 29 November by 11:00pm Worth: 8% Submitting your assignment You must hand in your work electronically, using the MarkUs system. Log in

More information

Computers and programming languages introduction

Computers and programming languages introduction Computers and programming languages introduction Eugeniy E. Mikhailov The College of William & Mary Lecture 01 Eugeniy Mikhailov (W&M) Practical Computing Lecture 01 1 / 19 Class goals and structure Primary

More information

Investigations in Number, Data, and Space for the Common Core 2012

Investigations in Number, Data, and Space for the Common Core 2012 A Correlation of Investigations in Number, Data, and Space for the Common Core 2012 to the Common Core State s with California Additions s Map Grade 2 Mathematics Common Core State s with California Additions

More information

1.OA.6 I can fluently add and subtract within NBT.1 I can read, write and sequence numerals NBT.6

1.OA.6 I can fluently add and subtract within NBT.1 I can read, write and sequence numerals NBT.6 Updated for -2013 Interim 1 Timeline: Aug. 3-17 CMA: none because review 1.OA.6 I can fluently add and subtract within 10. 1.NBT.1 I can read, write and sequence numerals 0-120. 1.OA.5 I can relate addition

More information

DEPARTMENT OF ACADEMIC UPGRADING

DEPARTMENT OF ACADEMIC UPGRADING DEPARTMENT OF ACADEMIC UPGRADING COURSE OUTLINE WINTER 2013 INTRODUCTION TO MATH 0081 INSTRUCTOR: Aidarus Farah PHONE: (780) 539-2810 OFFICE: Math Lab A210 E-MAIL: afarah@gprc.ab.ca OFFICE HOURS: &, 5:30

More information

Mathematics Curriculum Elaborations K 5. Developed by Janice Novakowski, Jennifer Barker and Sandra Ball. June 2015

Mathematics Curriculum Elaborations K 5. Developed by Janice Novakowski, Jennifer Barker and Sandra Ball. June 2015 Mathematics Curriculum Elaborations K 5 Developed by Janice Novakowski, Jennifer Barker and Sandra Ball June 2015 Kindergarten number concepts to 10 one- to- one correspondence conservation cardinality

More information

Warm-up and Memoization

Warm-up and Memoization CSE341 Spring 05 Due Wednesday, May 11 Assignment 4 Part I Warm-up and Memoization Warm-up As a warm-up, write the following Scheme functions: 1. Write the function foldl of the form (foldl func initial

More information

CSE 303 Lecture 8. Intro to C programming

CSE 303 Lecture 8. Intro to C programming CSE 303 Lecture 8 Intro to C programming read C Reference Manual pp. Ch. 1, 2.2-2.4, 2.6, 3.1, 5.1, 7.1-7.2, 7.5.1-7.5.4, 7.6-7.9, Ch. 8; Programming in C Ch. 1-6 slides created by Marty Stepp http://www.cs.washington.edu/303/

More information

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE Program 10: 40 points: Due Tuesday, May 12, 2015 : 11:59 p.m. ************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE *************

More information

CS Homework 11 p. 1. CS Homework 11

CS Homework 11 p. 1. CS Homework 11 CS 111 - Homework 11 p. 1 Deadline 11:59 pm on Monday, May 2, 2016 How to submit Each time you would like to submit your work: CS 111 - Homework 11 If your files are not already on nrs-labs, be sure to

More information

Instructions PLEASE READ (notice bold and underlined phrases)

Instructions PLEASE READ (notice bold and underlined phrases) Assignment 3 Dynamic Arrays and Classes Required Reading Problem Solving with C++ Chapter 7 Arrays Chapter 9 Pointers and Dynamic Arrays Chapter 10 Classes Chapter 11 Classes and Arrays Optional Reading

More information

COMP 412, Fall 2018 Lab 1: A Front End for ILOC

COMP 412, Fall 2018 Lab 1: A Front End for ILOC COMP 412, Lab 1: A Front End for ILOC Due date: Submit to: Friday, September 7, 2018 at 11:59 PM comp412code@rice.edu Please report suspected typographical errors to the class Piazza site. We will issue

More information

What did we talk about last time? Examples switch statements

What did we talk about last time? Examples switch statements Week 4 - Friday What did we talk about last time? Examples switch statements History of computers Hardware Software development Basic Java syntax Output with System.out.print() Mechanical Calculation

More information

Lab 2: Structured Program Development in C

Lab 2: Structured Program Development in C Lab 2: Structured Program Development in C (Part A: Your first C programs - integers, arithmetic, decision making, Part B: basic problem-solving techniques, formulating algorithms) Learning Objectives

More information

Sand Springs Public Schools 3rd Grade Math Common Core State Standards

Sand Springs Public Schools 3rd Grade Math Common Core State Standards 1 st Six Weeks Patterns and Relationships Algebraic Reasoning: Patters and Re la tio n s h ip s The student will use a variety of problem-solving approaches to extend and create patterns. A 1.1 Describe

More information

The source code for this lab must be submitted in a file named lab4.py. The source code file must contain a file header formatted as in previous labs.

The source code for this lab must be submitted in a file named lab4.py. The source code file must contain a file header formatted as in previous labs. CS 112 - Lab Assignment #4 Conversions) Specification (If Statements and Numeric The purpose of this lab is to gain experience if statements, String to numeric conversions with multiple number bases. The

More information

in normal arithmetic = == = == 5 7 x 2 = 24 7 * 2 == = 3 remainder 1 7 / 2 7 % 2

in normal arithmetic = == = == 5 7 x 2 = 24 7 * 2 == = 3 remainder 1 7 / 2 7 % 2 2 Arithmetic 2.1 The Natural Numbers We have all used natural counting numbers such as 1, 2 and 3 in simple arithmetic calculations. In C, the natural counting numbers between 0 and 65535 inclusive are

More information

Programming. Dr Ben Dudson University of York

Programming. Dr Ben Dudson University of York Programming Dr Ben Dudson University of York Outline Last lecture covered the basics of programming and IDL This lecture will cover More advanced IDL and plotting Fortran and C++ Programming techniques

More information

Programming Assignment 5 (100 Points) START EARLY!

Programming Assignment 5 (100 Points) START EARLY! Programming Assignment 5 (100 Points) Due: 11:59PM Thursday, November 2 START EARLY! Mining is arduous and dangerous work. Miners need to be taught how to mine minerals in the most efficient manner possible.

More information

More About Objects and Methods

More About Objects and Methods More About Objects and Methods Chapter 6 Objectives Define and use constructors Write and use static variables and methods Use methods from class Math Use predefined wrapper classes Use stubs, drivers

More information

Activity 1: Introduction

Activity 1: Introduction Activity 1: Introduction In this course, you will work in teams of 3 4 students to learn new concepts. This activity will introduce you to the process. We ll also take a first look at how to store data

More information

CSC172 LAB 22 CHANGE IS GOOD

CSC172 LAB 22 CHANGE IS GOOD LAB 22 CSC172 LAB 22 CHANGE IS GOOD 1 Introduction The labs in CSC172 will follow a pair programming paradigm. This requires every student to have a lab partner. Labs will typically have an even number

More information

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS Objective PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS Explain what is meant by compiler. Explain how the compiler works. Describe various analysis of the source program. Describe the

More information

CS 116. Lab Assignment # 1 1

CS 116. Lab Assignment # 1 1 Points: 2 Submission CS 116 Lab Assignment # 1 1 o Deadline: Friday 02/05 11:59 PM o Submit on Blackboard under assignment Lab1. Please make sure that you click the Submit button and not just Save. Late

More information

Exercise: Using Numbers

Exercise: Using Numbers Exercise: Using Numbers Problem: You are a spy going into an evil party to find the super-secret code phrase (made up of letters and spaces), which you will immediately send via text message to your team

More information

Russell County Schools Grade 2 Math Pacing

Russell County Schools Grade 2 Math Pacing Operations and Algebraic Thinking [OA] Represent and solve problems involving addition and subtraction. Add and subtract within 20. Work with equal groups of objects to gain foundations for multiplication.

More information

K-5 Mathematics Missouri Learning Standards: Grade-Level Expectations

K-5 Mathematics Missouri Learning Standards: Grade-Level Expectations K-5 Mathematics Missouri Learning Standards: Grade-Level Expectations Missouri Department of Elementary and Secondary Education Spring 06 Number Sense NS Kindergarten Grade Grade Grade 3 Grade 4 Grade

More information

Motivations. Chapter 2: Elementary Programming 8/24/18. Introducing Programming with an Example. Trace a Program Execution. Trace a Program Execution

Motivations. Chapter 2: Elementary Programming 8/24/18. Introducing Programming with an Example. Trace a Program Execution. Trace a Program Execution Chapter 2: Elementary Programming CS1: Java Programming Colorado State University Original slides by Daniel Liang Modified slides by Chris Wilcox Motivations In the preceding chapter, you learned how to

More information

Chapter 7 Arithmetic

Chapter 7 Arithmetic Chapter 7 Arithmetic 7-1 Arithmetic in C++ Arithmetic expressions are made up of constants, variables, operators and parentheses. The arithmetic operators in C++ are as follows + (addition) - (subtraction)

More information