Big Java Late Objects
2nd Edition
ISBN: 9781119330455
Author: Horstmann
Publisher: WILEY
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 1.5, Problem 12SC
How would you modify the HelloPrinter
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
What will be the c++ code.
The program will ask the user to input any number and the outcome should be like in the image attached.
Example is in the photo, the user enter a number 5.
If you have 128 oranges all the same size, color, and weight except one orange is heavier than the rest. Write down a C++ Code/Algorithm to search the heavy orange, in how many steps would you be able to find it out?
Can you please answer the following question! The program is JavaScript. Thank you!
If I gave you three sticks, you might be unable to make a triangle from them. For example, if one of the sticks is 12 inches long and the other two are one inch long, you will not be able to get the short sticks to meet in the middle. For any three lengths, you can check if it's possible to make a triangle:
If any of the three lengths exceeds the sum of the other two, you cannot form a triangle.
Write a program named triangle.js that asks the user for three numbers. if you can form a triangle with them, display "Yes, you can make a triangle." If not, display "No, you can not make a triangle."
The point of this problem is to use conditional statements.
Chapter 1 Solutions
Big Java Late Objects
Ch. 1.1 - What is required to play music on a computer?Ch. 1.1 - Why is a CD player less flexible than a computer?Ch. 1.1 - What does a computer user need to know about...Ch. 1.2 - Prob. 4SCCh. 1.2 - Which part of the computer carries out arithmetic...Ch. 1.2 - A modern smartphone is a computer, comparable to a...Ch. 1.3 - What are the two most important benefits of the...Ch. 1.3 - Prob. 8SCCh. 1.4 - Prob. 9SCCh. 1.4 - Prob. 10SC
Ch. 1.5 - How do you modify the HelloPrinter program to...Ch. 1.5 - How would you modify the HelloPrinter program to...Ch. 1.5 - Would the program continue to work if you replaced...Ch. 1.5 - What does the following set of statements print?...Ch. 1.5 - What do the following statements print?...Ch. 1.6 - Suppose you omit the "" characters around Hello,...Ch. 1.6 - Suppose you change println to Printline in the...Ch. 1.6 - Suppose you change main to hello in the...Ch. 1.6 - Prob. 19SCCh. 1.6 - Prob. 20SCCh. 1.7 - Prob. 21SCCh. 1.7 - Suppose your cell phone carrier charges you 29.95...Ch. 1.7 - Consider the following pseudocode for finding the...Ch. 1.7 - Suppose each photo in Self Check 23 had a price...Ch. 1.7 - Prob. 25SCCh. 1.7 - Prob. 26SCCh. 1 - Explain the difference between using a computer...Ch. 1 - Prob. 2RECh. 1 - Prob. 3RECh. 1 - Prob. 4RECh. 1 - Prob. 5RECh. 1 - Prob. 6RECh. 1 - What does this program print? public class Test {...Ch. 1 - What does this program print? Pay close attention...Ch. 1 - Prob. 9RECh. 1 - Write three versions of the HelloPrinter.java...Ch. 1 - How do you discover syntax errors? How do you...Ch. 1 - The cafeteria offers a discount card for sale that...Ch. 1 - Write an algorithm to settle the following...Ch. 1 - Consider the question in Exercise R1.13. Suppose...Ch. 1 - In order to estimate the cost of painting a house,...Ch. 1 - In How To 1.1, you made assumptions about the...Ch. 1 - Suppose you put your younger brother in charge of...Ch. 1 - Write pseudocode for an algorithm that describes...Ch. 1 - The ancient Babylonians had an algorithm for...Ch. 1 - Write a program that prints a greeting of your...Ch. 1 - Write a program that prints the sum of the first...Ch. 1 - Write a program that prints the product of the...Ch. 1 - Write a program that prints the balance of an...Ch. 1 - Write a program that displays your name inside a...Ch. 1 - Write a program that prints your name in large...Ch. 1 - Write a program that prints your name in Morse...Ch. 1 - Write a program that prints a face similar to (but...Ch. 1 - Write a program that prints an imitation of a Piet...Ch. 1 - Write a program that prints a house that looks...Ch. 1 - Write a program that prints an animal speaking a...Ch. 1 - Write a program that prints three items, such as...Ch. 1 - Write a program that prints a poem of your choice....Ch. 1 - Write a program that prints the United States...Ch. 1 - Type in and run the following program. Then modify...Ch. 1 - Type in and run the following program. Then modify...Ch. 1 - Modify the program from Exercise E1.16 so that the...Ch. 1 - Prob. 18PECh. 1 - Write a program that prints a two-column list of...Ch. 1 - In the United States there is no federal sales...Ch. 1 - To speak more than one language is a valuable...Ch. 1 - You want to decide whether you should drive your...Ch. 1 - You want to find out which fraction of your cars...Ch. 1 - The value of can be computed according to the...Ch. 1 - Imagine that you and a number of friends go to a...Ch. 1 - Write an algorithm to create a tile pattern...Ch. 1 - Write an algorithm that allows a robot to mow a...Ch. 1 - Consider a robot that is placed in a room. The...Ch. 1 - Consider a robot that has been placed in a maze....Ch. 1 - Suppose you received a loyalty promotion that lets...Ch. 1 - A television manufacturer advertises that a...Ch. 1 - Cameras today can correct red eye problems caused...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
This widget is a container that can hold other widgets. a. Grouper b. Composer c. Fence d. Frame
Starting Out with Python (4th Edition)
You developed Program 4.9 to reverse the digits of an integer typed in from the terminal However, this program ...
Programming in C
How is a problem usually reduced with a recursive method?
Starting Out with Java: From Control Structures through Objects (6th Edition)
Describe and implement state descriptions, move generators, terminal tests, utility functions, and evaluation f...
Artificial Intelligence: A Modern Approach
Software Sales A software company sells a package that retails for 99. Quantity discounts are given according t...
Starting out with Visual C# (4th Edition)
How does a value-returning function differ from the void functions?
Starting Out with Python (3rd 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
- Can you help me with this program?In C++ The room contains n*n cubes (in rows and columns). Each cube is white or black. You can get out of a white cube by going in one of the four directions horizontally or vertically (but you can't go beyond the scope of the room). You can get out in a black cube, but you can't get out of it. There is a mouse and a piece of cheese in the room. The mouse is in a cube (0,0) - white, and the cheese in a cube (n-1, n-1) - black. The mouse can move from cube to cube according to the rules described above. Write a program that finds all the paths that can be moved to the cheese with the mouse and if it appears, display it with ‘*’. An example diagram of the task is shown in the figure: Operating instructions: Compose a recursive function path (int i, int j), receiving as parameters the coordinates of the current position of the mouse (initially 0.0, and then run with parameters (i-1, j), (i + 1, j), ( i, j-1) or (i, j + 1)).arrow_forwardUsing c++ Let's play a game of FizzBuzz! It works just like the popular childhood game "PopCorn", but with rules of math applied since math is fun, right? Just print out "Fizz" when the given number is divisible by 3, "Buzz" when it's divisible by 5, and "FizzBuzz" when it's divisible by both 3 and 5!arrow_forwardIs there a way to initilize the names for students and their respective addresses? I am trying to get the Java program below to display the rollcall number with an actual name and correlating address. It would also be helpful if the names were in ascending order like the roll call numbers are. For example the programs output would look like: [rollno=1, name=Allan, address=620 pioneer st] [rollno=2, name=Chris, address=801 cheney dr] [rollno=3, name=Fedrick, address=504 plymouth ave] etc... What would that look like? Please and thank you! Source Code: import java.util.ArrayList;import java.util.Comparator;import java.util.Random;import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.JTextArea; class Student { int rollno; String name; String address; public Student(int roll, String name, String add) { super(); this.rollno = roll; this.name = name; this.address = add; } @Override public String toString() {…arrow_forward
- practice JAVA program that inputs a string from the user and prints a copy of the string with the first character of each sentence capitalized. (No need to consider strings with punctuation marks other than a period.) NOTE: For string and character manipulation, you should use only the String and Character methods (and not methods of other API classes) HINT: To split a string with “. “ delimiter, pass the following expression to the split method: “\\. “ String methods split, charAt, and substring, and Character method toUpperCase can be helpful.arrow_forwardThis is the problem I was given. "Write a program named StopSign that displays a pattern similar to the image shown below." I need the program written in C#, please.arrow_forwardWhat does your program do if you type “back” twice? Is this behavior sensible?arrow_forward
- Hello, I am stuck in my code I don't know what I am doing wrong. It's written in Coral Coding language. Here's the question: * Remember it has to be written in Coral coding language. Write a program for a simple text-based Rock-Paper-Scissors game. The game should allow the user to play against the computer.The game consists of three options: Rock, Paper, and Scissors, represented by the numbers 1, 2, and 3, respectively.The computer's choice is generated randomly.The user will provide three choices to be entered into the input box within Coral.A for loop might be very handy, see section 4.9 in zyBooks for a refresher.The program should determine the winner of each game based on the following rules:Rock (1) beats Scissors (3)Paper (2) beats Rock (1)Scissors (3) beats Paper (2)A tie occurs when both the user and the computer choose the same option.The program should display the user's choice, the computer's choice, and the result (win, lose, or tie).After each game, ask the user if they…arrow_forwardModify songVerse to play "The Name Game" (see OxfordDictionaries.com), by replacing "(Name)" with userName but without the first letter.Ex: If userName = "Katie" and songVerse = "Banana-fana fo-f(Name)!", the program prints:Banana-fana fo-fatie! Ex: If userName = "Katie" and songVerse = "Fee fi mo-m(Name)", the program prints:Fee fi mo-matie Note: You may assume songVerse will always contain the substring "(Name)" #include <iostream>#include <string>using namespace std; int main() {string userName;string songVerse; getline(cin, userName);userName = userName.substr(1, userName.size() - 1); // Remove first character getline(cin, songVerse); // Modify songVerse to replace (Name) with userName without first character /* Your solution goes here */ cout << songVerse << endl; return 0;} Please help me with this string operations problem using C++.arrow_forwardin c++ program kindly do the instructions on the photo.arrow_forward
- PLEASE HELP ME FIND THE JAVA CODE FOR THIS PROBLEM 4. Is It You, Cody? by CodeChum Admin Can you identify if Cody's name is spelled right? If so, then make a program that accepts four one-letter strings separated by space and print "Correct" if the inputted strings, combined in order, spell the name Cody correctly. If not, print "Wrong". It doesn't matter if it's in uppercase or lowercase, as long as it's spelled correctly, it's considered correct. Now, will you take on this task? Input A line containing four one-letter strings separated by a space. c·O·D·y Output A line containing a string. Correctarrow_forwardHello there: I have written a code. It seems very simple. When the user enter 1, the code should display "Programming is fun!". When the user enter 2, the code should display "You're getting the hang of this. Any other input should display "Sorry, that isn't 1 or 2". I tested the input with 1, 2, other numbers, words, -1, 0, and it works. However, when I don't type anything for input and just press enter, a "value error" message appears instead of "Sorry, that its'n 1 or 2". I feel stack. Please, can you help me to fix this? This is the message from Python: Traceback (most recent call last):File "C:\Users\Gsuar\Downloads\code_03\main.py", line 7, in <module>number = int(input("Enter 1 or 2: "))ValueError: invalid literal for int() with base 10: '' This is my code number = int(input("Enter 1 or 2: ")) if number == 1:print("Programming is fun!")elif number == 2:print("You're getting the hang of this.")else:print("Sorry, that isn't a 1 or 2.")arrow_forwardQuestion hello! can you help me debug my program? it's in Java. At line 108, I get the error “The field Person.age is not visible”. It won’t launch. This is what the output should look like:created Person [name: Fred Flintstone, age: 50] Duplicate entry: Person [name: Fred Flintsone, age: 50] created Student [major: Math, GPA: 3.1, name: Fred Flintstone, age: 50] created Student [major: politics, GPA: 3.1, name: George, age: 21] Family array full. Skipping: Student [major: Physics, GPA: 2.5, name: Jim, age: 21] Family array full. Skipping: person [name: Robert, age: 10] Family array full. Skipping: Person [name: Clement, age: 32] *****family listing: Person [name: Fred Flintstone, age: 50] Student [major: Math, GPA: 3.1, name: Fred Flintsone, age: 50] Person [name: Wilma Flintstone, age: 48] Student [major: Math, GPA: 3.1, name: Fred Flintstone, age: 50] Person [name: Wilma Flintstone, age: 48] Student [major: politics, GPA: 3.1, name: Georgie, age: 21] Student [major: Politics, GPA:…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY