Bills Exercise Main Module Declare Integer dollars

Slides:



Advertisements
Similar presentations
Exercises for CS1512 Week 12 Sets (questions).
Advertisements

Problem 1: Balls Problem 2: Josephine Problem 3: Alternating List.
Introduction to Programming Lecture 15. In Today’s Lecture Pointers and Arrays Manipulations Pointers and Arrays Manipulations Pointers Expression Pointers.
Computer Programming Lab 8.
CS 112 Intro to Computer Science II Sami Rollins Fall 2006.
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
11.3 Function Prototypes A Function Prototype contains the function’s return type, name and parameter list Writing the function prototype is “declaring”
Exercise Exercise Exercise Exercise
Exercise Exercise Exercise Exercise
Exercise Exercise6.1 7 Exercise6.1 8 Exercise6.1 9.
In Class Exercises. TV  Think about your television as an object.  You send messages to it using the remote control. What messages can you send?  What.
Decimal Place Value Whole numbers show whole amounts. The decimal point in a whole number always goes just to the right of the ones place. But, with whole.
3nd Grade Mathematics Ms. Coleman
Module 3 Lesson 8.
pennynickeldimequarter $1.00$5.00$10.00$20.00 Click on the money to learn more about it! Click on the “Next” button to test what you’ve learned!
Working With Money Yorubah Banks.  Content Area: Mathematics  Grade Level: Grade 2  Summary: The purpose of this power point is to give the students.
MONEY By: Jerrica Graves COINS A penny is copper and worth $0.01 one cent to the dollar. A nickel is silver and worth$0.05 five cents to the dollar.
I wonder who has more money…. 1 dollar, 3 nickels, 5 dimes 6 dimes, 3 pennies, 5 quarters 8 pennies, 6 nickels, 3 dimes 2 half dollars, 5 pennies, 8 nickels.
U.S CURRENCY By: Danielle Ritter. DIRECTIONS Next Back Home.
Money 2 nd Grade Mathematics Miss Marouchoc NEXT.
Arithmetic Operations. Review function statement input/output comment #include data type variable identifier constant declaration.
Saturday, 09 September 2006 ©RSH Number Square and Cube Numbers.
Nikki Keesee.  We will be learning how to count coins  Quarters  Dimes  Nickels  Pennies  Use a decimal point for coins (.)  Use a dollar sign.
Module 3 Lesson 7. Objectives Write, read, and relate, base ten number in all forms.
MATH AND MONEY.
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Special Methods in Java. Mathematical methods The Math library is extensive, has many methods that you can call to aid you in your programming. Math.pow(double.
Dictionaries and File I/O George Mason University.
Comparing and Ordering Integers LESSON 6-2 Compare –12 and –10. Since –12 is to the left of –10, –12 < –10. Graph –12 and –10 on the same number line.
Loops Review. How to generate random numbers Math.random() will return a random decimal value in the form of a double. double num1 = Math.random(); num1.
Counting by Fives with Nickels. 5 cents 5, 10 cents.
Problem Solving and Program Design. Problem Solving Process Define and analyze the problem. Develop a solution. Write down the solution steps in detail.
Census.
CSC111 Quick Revision.
Dice Game Pseudocode Module main() Declare String reply
Exercise 1- I/O Write a Java program to input a value for mile and convert it to kilogram. 1 mile = 1.6 kg. import java.util.Scanner; public class MileToKg.
Chapter 1 Introduction to Java
Chapter 2 Elementary Programming
Chapter 3 Practice.
Objectives Identify the built-in data types in C++
Auburn University COMP 3000 Object-Oriented Programming for Engineers and Scientists Structures Cont. Dr. Xiao Qin Auburn.
Tara has more money than Keith.
Introduction to Programming
OPERATORS (1) CSC 111.
Review of 2 dimension arrays.
Use proper case (ie Caps for the beginnings of words)
More Loops.
More Loops.
SELECTION STATEMENTS (2)
CS322D Tutorials.
Iteration: Beyond the Basic PERFORM
For Loops.
Control Structures Part B - Message and Input Boxes
Programming Fundamentals
Exercise 2 Main Module Declare Integer dollars String message
Exercise Simplify − 7 5.
Arrays.
CS 206D Computer Organization
Counting
Exercise Solution First questions What's output What's input
SECTION 5-2 Withdrawals pp
CHAPTER FOUR VARIABLES AND CONSTANTS
Process Exchange Transactions Activity
Variables Here we go.
Counting to 100 Counting by ones
Washington State School for the Blind
Repetition - Counting and Accumulating
Algorithms, Part 3 of 3 Topics In-Class Project: Tip Calculator
Exceptions Review Checked Vs. Unchecked Exceptions
Date: ________ Date: ________ Date: ________
Presentation transcript:

Bills Exercise Main Module Declare Integer dollars 1/17/2019 Main Module Declare Integer dollars Declare String message Declare Integer twentiesCtr, tensCtr, fivesCtr, onesCtr Display “What is the dollar amount?” Input dollars While (dollars != 0) twentiesCtr, tensCtr, fivesCtr, onesCtr = 0 While (dollars >= 20) twentiesCtr++ dollars = dollars – 20 End While While (dollars >= 10) tensCtr++ dollars = dollars – 10

Exercise 2 While (dollars >= 5) fivesCtr++ dollars = dollars – 5 1/17/2019 Exercise 2 While (dollars >= 5) fivesCtr++ dollars = dollars – 5 End While onesCtr = dollars message = twentiesCtr , " twenty(ies), ” , tensCtr ,“ ten(s), ” , fivesCtr , “five(s) and ”, onesCtr ,“ one(s)” Display message Display “What is the dollar amount?” Input dollars End Module