Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.217, Problem 04.

Slides:



Advertisements
Similar presentations
Introduction to Programming Java Lab 7: Loops 22 February JavaLab7 lecture slides.ppt Ping Brennan
Advertisements

Looping while … do …. Condition Process 2 Process 1 Y Repeated Loop.
Unintentional Injury and Violence-Related Behaviors.
1 Percentage Questions Choosing Part and Whole. 2 Decide what the numbers mean Janet got 34 correct on an exam for a score of 85%. How many were on the.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
1 CS150 Introduction to Computer Science 1 Relational Operators and the If Statement 9/22/08.
CMSC 104, Version 8/061L22Arrays1.ppt Arrays, Part 1 of 2 Topics Definition of a Data Structure Definition of an Array Array Declaration, Initialization,
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 4.
Chapter 6 – Repetition Statements : Objectives After you have read and studied this chapter, you should be able to Implement repetition control in a program.
Functions Teacher Twins©2014.
ICS 102 Computer Programming University of Hail College of Computer Science & Engineering Computer Science and Software Engineering Department.
Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.219, Problem 08.
Slide Chapter 1 Test Mean: 84 Median: 89 Breakdown: 22 A’s 12 B’s 4 C’s 4 D’s 3 F’s Copyright © 2009 Pearson Education, Inc.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Functions. Warm Up Solve each equation. 1.2x – 6 = x = X + 29 = x – 5 – 4x = 17 x = 14 x = - 7 x = -15 x = 11.
More While Loop Examples CS303E: Elements of Computers and Programming.
Nested LOOPS.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
111/18/2015CS150 Introduction to Computer Science 1 Announcements  I have not graded your exam yet.
JAVA: An Introduction to Problem Solving & Programming, 7 th Ed. By Walter Savitch ISBN © 2015 Pearson Education, Inc., Upper Saddle River,
Math – What is a Function? 1. 2 input output function.
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
5.3 – Solving Multi-Step Inequalities. *Just like solving equations*
JAVA: An Introduction to Problem Solving & Programming, 7 th Ed. By Walter Savitch ISBN © 2015 Pearson Education, Inc., Upper Saddle River,
1 10/3/05CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
5.1 Introduction Problem Solving –Requires understanding of: Building blocks Program-construction principles BZUPAGES.COM.
JAVA: An Introduction to Problem Solving & Programming, 7 th Ed. By Walter Savitch ISBN © 2015 Pearson Education, Inc., Upper Saddle River,
Exam 1. Spring Comparison Spring 2007 A’s 12 8% B’s 25 17% C’s 46 32% Passing 83 57% D’s 34 23% Median 71% Spring 2008 A’s 25 14% B’s 45 27% C’s 38 22%
10.2 hmwk. out Multiply the following 1.(2x + 3 )(x – 4) = 2.(3x – 4) 2 = 3.(2x + 1)(2x – 1) = Answers 1.2x 2 – 5x x 2 – 24x x
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 3 - Structured Program Development Outline.
Team 6-B Science Unit - 1 Exam Analysis. How did I do compared to the other members of my team? The questions parents and students want to ask…….
Number Talks Second Grade.
For Monday Read WebCT quiz 18.
Arrays, Part 1 of 2 Topics Definition of a Data Structure
2008/11/24: Lecture 19 CMSC 104, Section 0101 John Y. Park
2008/11/24: Lecture 19 CMSC 104, Section 0101 John Y. Park
1-7 Perimeter, Circumference, Area
Unary Operators ++ and --
Intro to Nested Looping
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
For Wednesday No new reading No quiz.
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
Arrays, Part 1 of 2 Topics Definition of a Data Structure
CS 0007 Spring Lory Al Moakar.
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Intro to Nested Looping
CS150 Introduction to Computer Science 1
Let’s all Repeat Together
Arrays Topics Definition of a Data Structure Definition of an Array
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Let’s all Repeat Together
AP Java 9/21/2018.
Common Exams: Fall Data Update
CS150 Introduction to Computer Science 1
Comparing Python and Java
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
AP CS Be able to fix a program written in Java
- '1:- bs? a ' I.
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
Arrays Topics Definition of a Data Structure Definition of an Array
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
Arrays, Part 2 of 2 Topics Array Names Hold Address How Indexing Works
Presentation transcript:

Textbook Problem Java – An Introduction to Problem Solving & Programming, Walter Savitch, pp.217, Problem 04

The problem Write a program to read a list of exam scores (integer percentages in the range 0 to 100) and to output the total number of grades and the number of grades in each letter-grade category (90 to 100 = A, 80 to 89 = B, 70 to 79 = C, 60 to 69 = D, and 0 to 59 = F). The end of the input is indicated by a negative score as a sentinel value. (The negative value isused only to end the loop, so do not use it in the calculations). (Example on next slide)

Problem (continued) For example, if the input is the output would be: Total number of grades = 14 Number of A’s = 1 Number of B’s = 4 Number of C’s = 6 Number of D’s = 2 Number of F’s = 1