Program #2 Cell Phone Usage ….Let’s start with understanding the problem!

Slides:



Advertisements
Similar presentations
Linear equations Revision. 4 kinds Easy 4 kinds Easy Two step.
Advertisements

CALCULATOR MANIPULATION. Due to the differences in calculators you will have to be able to use your own effectively.
Multiplication Practice Do you know how to multiply with double digits?
PRIME FACTORIZATION.
Solving Equations with the Variable on Both Sides Objectives: to solve equations with the variable on both sides.
5th Grade Module 2 – Lesson 19
Logo Lesson 5 TBE Fall 2004 Farah Fisher. Prerequisites  Given a shape, use basic Logo commands and/or a procedure to draw the shape, with and.
Mr Barton’s Maths Notes
Solving Equations with the Variable on Both Sides
MODELING THE SOFTWARE “PRODUCT DESIGN” By: Dejan Ahmetovic SWE 3633 Assignment 1 Dr. Frank Tsui 1/22/2015.
So You Want to Buy a Cell Phone !. What You Need To Decide How many minutes a month will I use it? What features do I want? What areas will I use it in?
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
You can’t put chickens and lions in the same cage!
Today in CS161 Lecture #4 Solving Problems with Computers Walk through the Tic Tac Toe Algorithm Getting ready for Creating Programs Turn the Inches to.
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
Do Now Review Quantitative and Qualitative observations.
CPSC 171 Introduction to Computer Science 3 Levels of Understanding Algorithms More Algorithm Discovery and Design.
Multiplication by multiples of 10 and 100 Objective to multiply numbers when 0’s are involved.
Outlines Chapter 3 –Chapter 3 – Loops & Revision –Loops while do … while – revision 1.
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
© The McGraw-Hill Companies, 2006 Chapter 4 Implementing methods.
Significant Figure Notes With scientific notation too.
CMSC 104, Section 301, Fall Lecture 06, 9/18/02 Algorithms, Part 3 of 3 Topics Disk Quota Exceeded. Using Pine. More Algorithms Reading Read.
Dimensional Analysis Instructions & Practice Monday, September 13, 2010.
ACO 101 Making a program. mb_your_brain_on_improv.html mb_your_brain_on_improv.html.
Scratch Programming Lesson 4 Question asking and answering.
5-Minute Check 1 Use elimination using addition to find the solution Bell Ringer 3-17 (4 minutes ) 1. In order to use elimination with addition, what do.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Multigroup Models Byrne Chapter 7 Brown Chapter 7.
EXERCISES for ALGORITHMS WRITING
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Prime Factorization. Prime Numbers A Prime Number is a whole number, greater than 1, that can be evenly divided only by 1 or itself.
Write a recursive routine that describes each sequence. Find the 7 th term. 1.7, 4, 1, −2, … 2.9, 17, 25, 33, … 3. Warm-Up
Positive and Negative numbers. Negative numbers A positive or negative whole number, including zero, is called an integer. For example, –3 is an integer.
My Python Programmes NAME:.
Example 1 Understanding and Planning The table shows the biking and running speeds (in meters per minute) for both you and your friend. Who has the better.
Program #2 Algorithm for Parking at PSU. Understanding the Assignment You will be writing a program to find out how much someone at PSU might be spending.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
One-Step Equations I can show that solving an equation leads to finding the value that makes the equation true.
STRANGE ! Here is a little mathematical exercise sure to surprise you all! Hit [enter] to view next slide.
WHAT IS THIS? Clue…it’s a drink SIMPLE SEQUENCE CONTROL STRUCTURE Introduction A computer is an extremely powerful, fast machine. In less than a second,
Boat Racing Game Challenge #4 By Chris Brown Under the direction of Professor Susan Rodger Duke University, January 2013 Based off of the Boat Racing Game.
Cell phone addictions How many people have a cell phone addiction?
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
No Pencil or Paper Needed!.  Make sure you know your multiplication tables up to 10.
BY: KAYLEE J. KAMRYN P. CLOE B. EXPRESSIONS * EQUATIONS * FUNCTIONS * AND INEQUALITIES.
Simultaneous Equations with Different Numbers in the Middles 4x + 3y = 15 5x – 2y = 13 Different Numbers.
< > < < Solving Inequalities < < < >.
Multiplying Decimals.
Integer Rules Memorize the Rules.
Solving Equations with the Variable on Both Sides
Solver & Optimization Problems
Social networking tools (powerpoint extract)
Unit 1 Day 1: Solving One- and Two-Step Equations
Multiplying Decimals.
“Finding the difference”
Programming in JavaScript
CST-115 Introduction to Computer Programming
1. > < ≥ ≤ Signs of Inequality Term Definition Example
Programming in JavaScript
Programming in JavaScript
Basic Lessons 5 & 6 Mr. Kalmes.
Simultaneous Equations with Different Numbers in the Middles
Software Development Techniques
Simplifying Algebraic Expressions
Subtracting integers without number line 3 digit.
Adding integers without number line 2 digit.
Presentation transcript:

Program #2 Cell Phone Usage ….Let’s start with understanding the problem!

Understanding the Problem What is the input? Where does the input come from? What is the output? Where should the output go? Any calculations we need to worry about? Who is the user?

Writing the Algorithm Step #1: Welcome the User Decide what you want to say, plan it out here in the algorithm Think about who your user is…to make sure the tone/words used are appropriate Be creative

Algorithm Step #2: Get the Regular monthly charges from the user Prompt the user for the monthly access charges Read in the monthly access charges What kind of variable do you think we will need? Echo the monthly access charges

Algorithm Step #3: Get the Voice Charges from the user Prompt the user for the number of minutes allowed (allowance), number of minutes currently used, and cost of minutes over the allowance. Spend some time planning what this prompt looks like. You could do 3 separate prompts if you’d like…. Read in the allowance, used minutes, and cost of overages Echo the allowance, used minutes and cost of overages. Plan out how you want this echo to look like!

Alternate Step #3 Get the Voice Usage Charges Prompt for the # minutes allowed Read in the allowance and echo it Prompt for the # minutes used Read in the minutes used and echo it Prompt for the cost overages for too many minutes used Read in the cost and echo it

Step #4 Get the Data Usage charges Prompt for the Text messaging allowance (# of messages allowed before charged), number of messages already sent, and the rate per minute over the allowance Read in the allowance, number of messages, and rate (think about what data types you will need) Echo the allowance, number of messages or rate

Alternate Step #4 Step #4: Get the Data Usage Charges Prompt for the # text messages allowed Read in the # text messages allowed Echo the # text messages allowed Prompt for the # text messages sent Read in the # text messages sent Echo the # text messages sent Prompt for the cost of texting Red in the cost of texting Echo the cost

Step #5 Step #5: Calculate the total charges so far… Calculate Voice Charges For voice, subtract the allowance from the number of minutes used… If the result is greater than zero, the result needs to be multiplied by the cost Otherwise, there are no additional charges

More Step #5 Calculate Data Charges Subtract the allowance (# messages allowed) from the # of messages used If the result is greater than zero Then the result should be multiplied by the cost of texting Otherwise, there are no additional charges

Last part of Step #5 Now calculate the grand total Add together the monthly access charges, the voice usage charges, and the data usage charges (Think about what kind of variable you are going to need for this! Where should your answer be saved….?)

Steps #6 and #7 Display the results to the user Plan out what you want to say as part of your algorithm Time to sign off! Send a termination message thanking the user Again, think about who your user is and make an appropriate message!

Deck Check it now… Now, go through the algorithm Is it in order? Does it make sense? Do you understand each sentence Is it precise enough that you can now create a C++ program from this? Let’s try in class on a few of the steps!

Create a Test Plan But, we are not yet done with the planning stage It is now time to create a test plan Create a list of what you think the user will type in, and what the answers should be when you run your program!