Java How to Program, Early Objects (11th Global Edition)
11th Edition
ISBN: 9780134751856
Author: Harvey Deitel, Paul J. Deitel
Publisher: Pearson Global Edition
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 5, Problem 1.2SRE
Fill in the blanks in each of the following statements:
The do...while statement tests the loop-continuation condition executing the loop’s body; therefore, the body always executes at least once.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Indicate whether the statement is true or false.
(Python matplotlib or seaborn)
CPU Usage
We have the hourly average CPU usage for a worker's computer over the course of a week. Each row of data represents a day of the week starting with Monday. Each column of data is an hour in the day starting with 0 being midnight.
Create a chart that shows the CPU usage over the week. You should be able to answer the following questions using the chart:
When does the worker typically take lunch?
Did the worker do work on the weekend?
On which weekday did the worker start working on their computer at the latest hour?
cpu_usage = [
[2, 2, 4, 2, 4, 1, 1, 4, 4, 12, 22, 23,
45, 9, 33, 56, 23, 40, 21, 6, 6, 2, 2, 3], # Monday
[1, 2, 3, 2, 3, 2, 3, 2, 7, 22, 45, 44,
33, 9, 23, 19, 33, 56, 12, 2, 3, 1, 2, 2], # Tuesday
[2, 3, 1, 2, 4, 4, 2, 2, 1, 2, 5, 31,
54, 7, 6, 34, 68, 34, 49, 6, 6, 2, 2, 3], # Wednesday
[1, 2, 3, 2, 4, 1, 2, 4, 1, 17, 24, 18,
41, 3, 44, 42, 12, 36, 41, 2, 2, 4, 2, 4], # Thursday
[4, 1, 2, 2, 3, 2, 5, 1, 2, 12, 33, 27,
43, 8,…
For glass-box testing of a for loop, you should test cases where:
For glass box tesitng of a for loop, you should test cases where:
a) the for loop is not entered
b) the body of the for-loop is executed just once
c) the body of the for-loop is executed more than once
d) all of these
Chapter 5 Solutions
Java How to Program, Early Objects (11th Global Edition)
Ch. 5 - Fill in the blanks in each of the following...Ch. 5 - Fill in the blanks in each of the following...Ch. 5 - Fill in the blanks in each of the following...Ch. 5 - Fill in the blanks in each of the following...Ch. 5 - Fill in the blanks in each of the following...Ch. 5 - Prob. 1.6SRECh. 5 - Prob. 1.7SRECh. 5 - State whether each of the following is true or...Ch. 5 - State whether each of the following is true or...Ch. 5 - State whether each of the following is true or...
Ch. 5 - State whether each of the following is true or...Ch. 5 - Prob. 2.5SRECh. 5 - State whether each of the following is true or...Ch. 5 - Prob. 2.7SRECh. 5 - Prob. 3.1SRECh. 5 - Prob. 3.2SRECh. 5 - Write a Java statement or a set of Java statements...Ch. 5 - Prob. 3.4SRECh. 5 - Find the error in each of the following code...Ch. 5 - Find the error in each of the following code...Ch. 5 - Find the error in each of the following code...Ch. 5 - Find the error in each of the following code...Ch. 5 - Describe the four basic elements of...Ch. 5 - Compare and contrast the while and for iteration...Ch. 5 - Prob. 3.1ECh. 5 - Compare and contrast the break and continue...Ch. 5 - Find and correct the error(s) in each of the...Ch. 5 - The following code should print whether integer...Ch. 5 - Prob. 5.3ECh. 5 - Find and correct the error(s) in each of the...Ch. 5 - What does the following program do? 1 // Exercise...Ch. 5 - (Find the Smallest Value) Write an application...Ch. 5 - (Calculating the Product of Odd Integers) Write an...Ch. 5 - (Factorials) Factorials are used frequently in...Ch. 5 - (Modified Compound-Interest Program) Modify the...Ch. 5 - (Triangle Printing Program) Write an application...Ch. 5 - (Bar-Chart Printing Program) One interesting...Ch. 5 - (Calculating Sales) An online retailer sells five...Ch. 5 - (Modified Compound-Interest Program) Modify the...Ch. 5 - Assume that i = 1, j = 2, k = 3 and m = 2. What...Ch. 5 - (Calculating the Value of ) Calculate the value of...Ch. 5 - (Pythagorean Triples) A right triangle can have...Ch. 5 - (Modified Triangle-Printing Program) Modify...Ch. 5 - (De Morgans Laws) In this chapter, we discussed...Ch. 5 - (Diamond-Printing Program) Write an application...Ch. 5 - Prob. 21.1ECh. 5 - A criticism of the break statement and the...Ch. 5 - What does the following program segment do? 1 for...Ch. 5 - Describe in general how youd remove any continue...Ch. 5 - Prob. 25.1E
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Practice Problem 3.43 (solution page 344) Suppose you are given the job of checking that a C compiler generates...
Computer Systems: A Programmer's Perspective (3rd Edition)
Modify the Product_T table by adding an attribute QtyOnHand that can be used to track the finished goods invent...
Modern Database Management
Repair Bill Suppose automobile repair customers are billed at the rate of per hour for labor. Also, suppose co...
Introduction To Programming Using Visual Basic (11th Edition)
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
Consider the following skeletal C program: void fun1(void); / prototype / void fun2(void); / prototype / void f...
Concepts of Programming Languages (11th Edition)
What is the output produced by the following lines of program code? double result = (1 / 2) 2; System.out.prin...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- The term "Pre-test" means that The loop is tested after the body statements are run. OThe loop is tested after the loop is run through for the first time OThe loop will be tested before the statements to be repeated are executed, even once. OThe loop will be tested before the next iteration (after the first)arrow_forwardPlease answer item number 4. (pyhthon programming)arrow_forwardChallenge Problem (pyhton) T E S T S C O R E S Write a program that implements a test scores program. Valid test score entries are between 0 and 100 inclusive. The program should display a welcome message and run everything through the "main" function. have the ability to enter several test scores (try a loop) and print out the total score, as well as, the average score. continuously ask for test scores until the number 99.9 has been entered. test for valid entries and the value 99.9. If a test score is valid, the program should add the current score to the total score and update the number of test scores by one (+1), otherwise it displays an error message. Note : This assignment involves the use of a while loop and if-else decision making controls. You CANNOT use the reserved keywords break and continue for any portion of this program or any program for that matter throughout this course.arrow_forward
- Describe the difference between the while loop and the do-while loop.arrow_forwardProgramming Language: C++ Develop a Tic Tac Toe game that will match a player against the computer. Do’s: Use a typical 3 x 3 board. The horizontal axis should be labeled A, B, C. The vertical axis should be labeled 1, 2, 3. For Example: the attatched picture. Use User-Defined Functions. Use Branching. Use Loops. Use String functions. Randomly determine who will move first, the human or computer. Assign O to the computer and X to the Human player. Ask the user to select their move using the horizontal and vertical position. For example: A1 for the upper left square, or B2 for the center square. After each move, redraw the board with the X’s and O’s in the right positions. After each game, ask the user if they want to play again. If they do, start the game again. Do not’s: Don’t use User Classes or Objects Don’t use imagesarrow_forwardDirection: Read each sentence/ situation carefully and select the BEST answer among the choices. 1. It is a Boolean expression that tells when the loop will exit. 2. The sequence that makes up the loop body may either be a block of Turbo C statements or a single Turbo C statement. 3. In Turbo C it is a reserved word. 4. Its values determine the number of times the loop iterates. 5. It is the second type of open-ended loop. Condition For Loop Statement For Do while Looparrow_forward
- -Python- Learning Objective: Use loops to iterate through the container Practice the enumerate() function to have simultaneous access to index and object Work with If statements to perform action only by specific condition Instructions You are parking in Los Angeles Airport and you can only remember the floor of where you parked your car. A programmer can help you find your car in the parking by only giving him the brand of your car. The program will give you the number of the parking lots that have cars with the same brand as yours. The program works as follows: Input from the user car_brand Loop over the cars in parking_cars list (hint: use enumerate) Save the indices in a list parking_lots of the cars with the same brand as the user's (car_brand) If parking_lots has values, print "Your car might be in any of these parking lots <parking_lots>". Otherwise, print "Sorry, your car is not on this floor." ex. input :Toyota / output: Your car might be in any of these parking lots…arrow_forward7) You wish to place the following code inside of a loop:x++;Which of the following loops would guarantee that the code is always executed at least once?A) While B) Do while C) For D) Gotoarrow_forwardCODE USING C++ 3. Place Values by CodeChum Admin Manipulating values from a series of numbers is fun, but let's try exploring the use of loops a little more. How about printing out each digit of a number by place values, in ascending order? Instructions: Create a variable and input a random positive integer. Using while loop, print out each digit of the inputted integer in separate lines, starting from its rightmost digit until the leftmost digit of the number. Tip: Use % 10 to get the rightmost digit, and / 10 to remove it from the number. Another tip: don't forget to consider the case wherein the input is `0` Input A line containing an integer. 214 Output Multiple lines containing an integer. 4 1 2arrow_forward
- 1. Ifthe initial condition of any while loop is false it will still execute once. 2. In the case of an infinite while loop, the while expression (that is, the loop condition) is always true. 3. A counter-controlled loop is used when the exact number of data entries is known. 4. The control variable in a flag-controlled while loop is an int variable. 5. A break statement is legal in a while loop, but not in a for loop. 6. Void methods have no return data type. 7. Ifa formal parameter is a variable of a primitive data type, then after copying the value of the actual parameter, there is no connection between the formal and actual parameter. 8. All the methods defined in a class must háve different names. 9. The statement int () list = new int[15); creates list to be an array of 14 components because array index starts at 0. 10. When you pass an array as a parameter, the base address of the actual array is passed to the formal parameter. 11. Members of a class are usually classified into…arrow_forwardNo written by hand solution IN JAVA - NEEDS DRIVER AND CLASS PROGRAM Average Rainfall Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month.arrow_forwardWhat is the difference between For Loop, Do While Loop, Do Until Looparrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Control Structures - while loop - do-while loop - for loop - Goto - break - continue statements; Author: EzEd Channel;https://www.youtube.com/watch?v=21l11_9Osd0;License: Standard YouTube License, CC-BY