Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 2.17, Problem 2.17.1CP
Show the output of Listing 2.10 with the input value 1.99.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
the output for all of them are in correct
it should be
printSub1 will print "a", "ab", "abc", "abcd", "b", "bc", "bcd", "c", "cd", "d"
printSub2 will print "d", "cd", "bcd", "abcd", "c", "bc", "abc", "b", "ab", "a"
printSub3 will print "a", "b", "c", "d", "ab", "bc", "cd", "abc", "bcd", "abcd"
printSub4 will print "abcd", "bcd", "abc", "cd", "bc", "ab", "d", "c", "b", "a"
Note that the actual output will not have quotation marks around the substrings. The substrings must print in the order shown for each method. You may only use these String methods in your work: length(), substring()
AND ALSO THE OUTPUT SHOULD BE IN ORDER
Use scnr.nextInt() to read integers from input as volume readings until three readings are read that are in the range -5 to 30, both exclusive. Output the three readings in the given range. End each output with a newline.
Ex: If the input is -5 1 -1 -3 0, then the output is:
1
-1
-3
use kotlin to write a code that displays measurements of watts in a bar chart.
Chapter 2 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Ch. 2.2 - Identify and fix the errors in the following code:...Ch. 2.3 - How do you write a statement to let the user enter...Ch. 2.3 - Prob. 2.3.2CPCh. 2.4 - Prob. 2.4.1CPCh. 2.5 - Identify and fix the errors in the following code:...Ch. 2.6 - Identify and fix the errors in the following code:...Ch. 2.7 - Prob. 2.7.1CPCh. 2.8 - Prob. 2.8.1CPCh. 2.8 - Translate the following algorithm into Java code:...Ch. 2.9 - Prob. 2.9.1CP
Ch. 2.9 - Prob. 2.9.2CPCh. 2.9 - Prob. 2.9.3CPCh. 2.9 - Prob. 2.9.4CPCh. 2.9 - Prob. 2.9.5CPCh. 2.9 - Prob. 2.9.6CPCh. 2.9 - Write a statement to display the result of 23.5.Ch. 2.9 - Suppose m and r are integers. Write a Java...Ch. 2.10 - How many accurate digits are stored in a f1oat or...Ch. 2.10 - Prob. 2.10.2CPCh. 2.10 - Prob. 2.10.3CPCh. 2.10 - Which of the following are correct literals?...Ch. 2.11 - How would you write the following arithmetic...Ch. 2.12 - Prob. 2.12.1CPCh. 2.13 - Prob. 2.13.1CPCh. 2.14 - Which of these statements are true? a. Any...Ch. 2.14 - Show the output of the following code: int a = 6;...Ch. 2.15 - Prob. 2.15.1CPCh. 2.15 - Prob. 2.15.2CPCh. 2.15 - Show the following output: float f =12.5F; int i =...Ch. 2.15 - If you change (int) (tax 100) / 100.0 to (int)...Ch. 2.15 - Prob. 2.15.5CPCh. 2.15 - Write an expression that rounds up a double value...Ch. 2.16 - How would you write the following arithmetic...Ch. 2.17 - Show the output of Listing 2.10 with the input...Ch. 2.18 - Can you declare a variable as int and later...Ch. 2.18 - Prob. 2.18.2CPCh. 2.18 - Will overflow cause a runtime error?Ch. 2.18 - Prob. 2.18.4CPCh. 2 - (Convert Celsius to Fahrenheit) Write a program...Ch. 2 - (Compute the volume of a cylinder) Write a program...Ch. 2 - (Convert feet into meters) Write a program that...Ch. 2 - (Convert pounds into kilograms) Write a program...Ch. 2 - (Financial application: calculate tips) Write a...Ch. 2 - (Sum the digits in an integer) Write a program...Ch. 2 - (Find the number of years) Write a program that...Ch. 2 - (Current time) Listing 2.7. ShowCurrentTime.java,...Ch. 2 - (Physics: acceleration) Average acceleration is...Ch. 2 - (Science: calculating energy) Write a program that...Ch. 2 - (Population projection) Rewrite Programming...Ch. 2 - (Physics: finding runway length) Given an...Ch. 2 - (Financial application: compound value) Suppose...Ch. 2 - (Health application: computing BMI) Body Mass...Ch. 2 - (Geometry: distance of two points) Write a program...Ch. 2 - (Geometry: area of a hexagon) Write a program that...Ch. 2 - (Science: wind-chill temperature) How cold is it...Ch. 2 - (Print a table) Write a program that displays the...Ch. 2 - (Geometry: area of a triangle) Write a program...Ch. 2 - (Financial application: calculate interest) If you...Ch. 2 - (Financial application: calculate future...Ch. 2 - (Financial application: monetary units) Rewrite...Ch. 2 - (Cost of driving) Write a program that prompts the...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
How is the hydrodynamic entry length defined for flow in a pipe? Is the entry length longer in laminar or turbu...
Fluid Mechanics: Fundamentals and Applications
Lottery Winners Modification Modify the program you wrote for Programming Challenge 2 (Lottery Winners) so it p...
Starting Out with C++ from Control Structures to Objects (9th Edition)
What output is produced by the following statements? System.out.println(true false); System.out.println(true | ...
Java: An Introduction to Problem Solving and Programming (8th Edition)
In Exercises 33 through 40, determine the output displayed in the list box by the lines of code.
Introduction To Programming Using Visual Basic (11th Edition)
What is the general problem with static scoping?
Concepts Of Programming Languages
Software Sales Software companies often offer their customers the option to lease the software yearly or purcha...
Starting Out With Visual Basic (8th 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
- Fix the codearrow_forwardAssignment Read a 3 digit number from one row, then a 1 digit number from the second row. Divide the 3 digit number over the 1 digit number. Show the process of division showing Quotient and Remainder throughout the process. Sample Input 123 3 Output Loay Alnaji 120/3 40 R 0 Sample Input 099 2 Output Loay Alnaji 099/2 44 R 11 11/25 R 1 (Stop when you have remainder less than the second input. So 1 is less than 2, so stop).arrow_forwardWhat is the output of the following Pep/9 code, if the input is 5, 9, 6, -12, 7, 14. Properly comment the progtram and explain the purpose. BR main number: .EQUATE 6 j: .EQUATE 4 amount: .EQUATE 2 result: .EQUATE O main: SUBSP 8, i DECI number, s LDWA 0, i STWA result, s LDWA 1, i STWA j, s for: CPWA number, s BRGT endFor DECI amount, s LDWA amount, s ADDA result, s STWA result, s LDWA j, s ADDA 1, i STWA j, s BR for endFor: STRO msg, d DECO result, s LDBA In', i STBA charout, d ADDSP 8, i STOP msg: .ASCII "Result = \x00" .ENDarrow_forward
- Take two time inputs from a user. And tell the differences between the time. Sample output Enter hours minutes and seconds: 11 33 34 Enter hours minutes and seconds : 8 12 15 Time difference: 3 : 21 : 19arrow_forwardUse cin to read floating-point numbers from input as area readings until four readings are read that are greater than 35.0. Output the four readings in the given range. End each output with a newline. Ex: If the input is 35.0 35.6 35.9 36.0 35.2, then the output is: 35.6 35.9 36.0 35.2 Note: Use fixed and setprecision (1) to set one digit after the decimal point. 1 #include 2 #include 3 using namespace std; 4 5 int main() { 6 7 8 9 10 11 12} double currentArea; int numSuccesses; * Your code goes here */ return 0; 2 3arrow_forwardI get a LNK2019 error when I try to run the codearrow_forward
- The output on this is as follows: 55.90169943749474 579.3240222126375 5.0 6.647869871181236 The output should be: 55.90170 579.32402 5.00000 6.64787 I am not sure how to suppress the decimals to five positions.arrow_forwardFor any wrong input display INVALID INPUT Sam it would be:---.arrow_forwardWhen I ran the test it says that a 1 needed to be inluded for the output so it shoudl be 1 2 4 8 16 32 64. Can you help me with that? Input 100 Your output n: 2 4 8 16 32 64 Expected output n: 1 2 4 8 16 32 64arrow_forward
- Implement the following function using a decoder and OR gate. F (A, B, C, D) = A'B + C'D + AD 1. What is the type of the decoder? (Example. 3-8 active high decoder). 2. What are the lines should be connected to the OR gate? (Assume output line are D0, D1... Dx) Use the editor to format your answerarrow_forwardc. What is the maximum possible value of Y? d. What is the number of required bits to represent the maximum value of Y? e. Write a truth table for the multiplier described above. You will have a four-input truth table with the inputs being A[1], A[0], B[1], and B[0]. f. Implement the third bit of output, Y[2] from the truth table using only AND, OR, and NOT gates.arrow_forwardTranslate the following for loop to the equivalent while loop. for num in range (25, 0, -5): print(num)Make sure to precisely match the output below. 252015105 need help wit python codearrow_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
Boolean Algebra - Digital Logic and Logic Families - Industrial Electronics; Author: Ekeeda;https://www.youtube.com/watch?v=u7XnJos-_Hs;License: Standard YouTube License, CC-BY
Boolean Algebra 1 – The Laws of Boolean Algebra; Author: Computer Science;https://www.youtube.com/watch?v=EPJf4owqwdA;License: Standard Youtube License