Exercise 2 Main Module Declare Integer dollars String message

Slides:



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

Java POWERED BY: ARVIND DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING RADHA GOVIND GROUP OF INSTITUTIONS,MEERUT.
Introduction to Programming Lecture 15. In Today’s Lecture Pointers and Arrays Manipulations Pointers and Arrays Manipulations Pointers Expression Pointers.
CS 112 Intro to Computer Science II Sami Rollins Fall 2006.
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
1 Lecture 32 Handling Selected Topics Again!! Structs and Arrays of Structs Special Lectures.
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.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
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.
Objective: Learn to multiply and divide integers.
Module 3 Lesson 8.
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.
Saturday, 09 September 2006 ©RSH Number Square and Cube Numbers.
Module 3 Lesson 7. Objectives Write, read, and relate, base ten number in all forms.
Creating and Managing Content Types Module 9. Overview  Understanding Content Types  Creating and Using Site Columns  Creating and Using Site Content.
The Multiplication of Polynomials Algebra 2 Module 1 Lesson 2.
CLICK THE NUMBERS IN SEQUENCE
Mark Dixon 1 Soft051 Examination Sample Questions.
Module 2.12 Working with Five-Minute Intervals. Count by 5s Point to intervals on the clock and have volunteers identify how many minutes it represents.
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.
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.
Buyer’s Purchasing Power
Census.
Dice Game Pseudocode Module main() Declare String reply
CSCI 3333 Data Structures Recursion Exercises
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 3 Practice.
Begin at 5. Count by 5s to 100. Begin at 30. Count by 10s to 150.
Auburn University COMP 3000 Object-Oriented Programming for Engineers and Scientists Structures Cont. Dr. Xiao Qin Auburn.
More C++ Basics October 4, 2017.
Tara has more money than Keith.
Register Use Policy Conventions
OPERATORS (1) CSC 111.
Chapter 12: Text Processing
Chapter 12: Text Processing
Review of 2 dimension arrays.
Use proper case (ie Caps for the beginnings of words)
Solution Public Class Auto Declare Private String make, model, vin
More Loops.
Lecture 6 – Exercises TCP1201: 2017/2018.
75 Has 7 in the tens place Odd Number Less than 100
Iteration: Beyond the Basic PERFORM
Buyer’s Purchasing Power
Programming Fundamentals
Statements and expressions - java
Exercise Simplify − 7 5.
Bills Exercise Main Module Declare Integer dollars
Counting
Arrays Week 2.
Exercise Solution First questions What's output What's input
SECTION 5-2 Withdrawals pp
CHAPTER FOUR VARIABLES AND CONSTANTS
Objective - To read, write and identify the values of whole numbers.
Multi-Dimensional Arrays
Making Tens.
Variables Here we go.
Making Tens.
12 Has 1 in the tens place Even Number Less than 20
Counting to 100 Counting by ones
2 4 −4 −2 −5 −3 −
Washington State School for the Blind
Exceptions Review Checked Vs. Unchecked Exceptions
Array Fundamentals A simple example program will serve to introduce arrays. This program, REPLAY, creates an array of four integers representing the ages.
Date: ________ Date: ________ Date: ________
Presentation transcript:

Exercise 2 Main Module Declare Integer dollars String message 1/16/2019 Main Module Declare Integer dollars String message Declare Integer twentiesCtr, tensCtr, fivesCtr, onesCtr = 0 Display “What is the dollar amount?” Get dollars While (dollars != 0) twentiesCtr, tensCtr, fivesCtr, onesCtr = 0 twentiesCtr = dollars / 20 dollars = dollars - (twentiesCtr * 20) tensCtr = dollars / 10 dollars = dollars - (tensCtr * 10) fivesCtr = dollars / 5 dollars = dollars - (fivesCtr * 5) onesCtr = dollars

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