In Class Exercises. Chapter 3, problem 25  Develop an application to compute the total cost of an order for MyJava Coffee Outlet including the boxes.

Slides:



Advertisements
Similar presentations
Chapter 4 Computation Bjarne Stroustrup
Advertisements

Primitive Recursive Functions (Chapter 3)
Repetition Control Structures School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 9, Friday 3/07/2003)
Mathematical Literacy Tweak of the Week Mathematical Literacy Tweak of the Week.
Chapter 5 Number Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Saturday, 09 September 2006 ©RSH Number Prime Numbers and Prime factors.
Lecture 03 – Sequences of data.  At the end of this lecture, students should be able to:  Define and use functions  Import functions from modules 
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette Sept 9, 2004 Last update:
Recursion. Binary search example postponed to end of lecture.
Monday, 12/9/02, Slide #1 CS 106 Intro to CS 1 Monday, 12/9/02  QUESTIONS??  On HW #5 (Due 5 pm today)  Today:  Recursive functions  Reading: Chapter.
Lecture 7 Sept 17 Goals: Complete Chapter 4 Chapters 5 and 6.
11.3 Function Prototypes A Function Prototype contains the function’s return type, name and parameter list Writing the function prototype is “declaring”
In Class Exercises.
 2002 Prentice Hall. All rights reserved. 1 Chapter 6 - Methods Outline Note: Inconsistent with textbook subsection numbering […] 6.14Recursion 6.15 Example.
A number that divides evenly into a larger number without a remainder Factor- Lesson 7 - Attachment A.
Motivate the study of number relationships Is a branch of mathematics, mainly concerned with the integers, that has been a topic of study for centuries.
Data Structures Using C++ 2E Chapter 6 Recursion.
COMPE 111 Introduction to Computer Engineering Programming in Python Atılım University
PYTHON PROGRAMMING Week 10 – Wednesday. TERMS – CHAPTER 1 Write down definitions for these terms:  Computation  Computability  Computing  Artificial.
Loop Exercise 1 Suppose that you want to take out a loan for $10,000, with 18% APR, and you're willing to make payments of $1,200/month. How long will.
Data Structures Using C++ 2E Chapter 6 Recursion.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 17: Recursion.
C++ Beginner Tutorial: Functions IV Recursion. What is recursion? A property of function to be able to call itself… Get factorial of a given number: Factorial.
 Continue queries ◦ You completed two tutorials with step-by-step instructions for creating queries in MS Access. ◦ Now must apply knowledge and skills.
Math Warm-Up Week 7 Questions Wednesday. 1. Write the next 5 multiples of 9. 9, 18, 27,
Recursion.
More on Functions (Part 2) Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Lecture 8: Choosing the Correct Loop. do … while Repetition Statement Similar to the while statement Condition for repetition only tested after the body.
Agenda Review C++ Library Functions Review User Input Making your own functions Exam #1 Next Week Reading: Chapter 3.
Lecture 3.4: Recursive Algorithms CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
Object Oriented Programming Lecture 4: Flow Control Mustafa Emre İlal
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 9.
COP 3275 COMPUTER PROGRAMMING USING C Instructor: Diego Rivera-Gutierrez
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Solving an equation with one unknown From arithmetic to algebra Modifying equations in algebra.
Factor A factor of an integer is any integer that divides the given integer with no remainder.
JavaScript Functions. CSS Inheritance Which formatting applies? x y z input { display: block; } input.pref { background:red; } If you have a selector.
Lesson 9 Power Up BPage 54 Prime Numbers. A counting number greater than 1, has exactly two factors (the number itself and 1) 2, 3, 5, 7, 11, 13, 17,
C# Programming Methods.
1 Lecture03: Control Flow 9/24/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction to C.
Review. Problem 1 What is the output of the following piece of code void increment(int x) { x++; } int main() { int y = 10; increment(y); cout
 2012 Pearson Education, Inc. Slide Chapter 5 Number Theory.
CSCI 3328 Object Oriented Programming in C# Chapter 6: Methods – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
Repetition Looping. Types for while do..while for The for loop allows you to iterate through a variable for a specific range of values. You must supply.
1 Recursive Definitions and Structural Induction CS/APMA 202 Rosen section 3.4 Aaron Bloomfield.
More on Functions (Part 2) Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Pre-Calculus Section 8.6A Counting Principles. 1. Eight pieces of paper are numbered 1 to 8 and placed in a box. One piece of paper is drawn from the.
GCSE COMPUTER SCIENCE Practical Programming using Python
生查子 ~ 歐陽修 去年元夜時,花市燈如晝, 月上柳梢頭,人約黃昏後; 今年元夜時,月與燈依舊, 不見去年人,淚濕春衫袖。
Multiplying and Dividing Fractions
1-1 Patterns and Inductive Reasoning
Calculated Fields Exercises Queries
Exercise 24 ÷ 2 12.
Midterm Review Problems
Chapter 5.2 Sequences.
Introduction to Computer Science - Alice
Chapter 6 Decision Making and Looping
Intro to Nested Looping
Python: Algorithms Damian Gordon.
Lecture 3.2: Induction and Strong Induction (contd.)
More on Functions (Part 2)
Applied Discrete Mathematics Week 9: Integer Properties
Intro to Nested Looping
Prime numbers.
Composite Number.
Functions and Recursion
Sequences Tuesday, 30 April 2019.
List of Values and Parameter Queries
Week 1 - Thursday COMP 4100.
COMPUTING.
Presentation transcript:

In Class Exercises

Chapter 3, problem 25  Develop an application to compute the total cost of an order for MyJava Coffee Outlet including the boxes used to ship it.  Coffee is sold in 2-lb bags which cost $5.50 each.  SizeHoldsCost Large20$1.80 Medium10$1.00 Small5$0.60

Output Format Number of Bags ordered: 52 Cost of Coffee: $ Boxes Used: 2 Large - $ Medium - $ Small - $0.60 Your total cost is: $291.20

Development Process  Any questions about the specification?  What classes do we need to use?  Which do we need to write?  How should we break down the development?

Adding Arrival date  Use today's date as the date of order  Expected arrival date is two weeks from date of order. Date of Order: September 13, 2005 Expected Arrival: September 13, 2005

Prime Numbers  A prime number is a number greater than 1 which is divisible only by 1 and itself.  Write a method that returns true if its parameter is a prime number  Write code to generate a list of all the primes between 1 and some number.

Fibonacci Numbers  The Fibonacci sequence is defined by f(1) = f(2) = 1 f(n) = f(n-1) + f(n-2)  Write code to calculate the first N Fibonacci numbers