Java: An Introduction to Problem Solving and Programming (7th Edition)
7th Edition
ISBN: 9780133766264
Author: Walter Savitch
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 9.2, Problem 21STQ
Suppose that, in Self-Test Question 19, we change the value of number from 42 to –99. How would this change affect the output?
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Correct answer will be upvoted else downvoted. Computer science.
You are given a positive integer x. Check whether the number x is representable as the amount of the solid shapes of two positive integers.
Officially, you really want to check in case there are two integers an and b (1≤a,b) to such an extent that a3+b3=x.
For instance, in the event that x=35, the numbers a=2 and b=3 are reasonable (23+33=8+27=35). In the event that x=4, no pair of numbers an and b is reasonable.
Input
The primary line contains one integer t (1≤t≤100) — the number of experiments. Then, at that point, t experiments follow.
Each experiment contains one integer x (1≤x≤1012).
Kindly note, that the input for some experiments will not squeeze into 32-cycle integer type, so you should use something like 64-bit integer type in your programming language.
Output
For each experiment, output on a different line:
"Indeed" in case x is representable as the amount of the 3D shapes of two…
Question 4 Rewrite the following statement without using variables. Then, give an exam-
ple that shows the statement is true.
There exist two real numbers a and b such that ab > a + b.
Question 5 Rewrite the following statement without using variables. Then, give an exam-
ple that shows the statement is false.
For any positive integer n, n³ > n².
Get the no. Of people.
Chapter 9 Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
Ch. 9.1 - Prob. 1STQCh. 9.1 - What output would the code in the previous...Ch. 9.1 - Prob. 3STQCh. 9.1 - Prob. 4STQCh. 9.1 - Prob. 5STQCh. 9.1 - Prob. 6STQCh. 9.1 - Prob. 7STQCh. 9.1 - Prob. 8STQCh. 9.1 - In the code given in Self-Test Question 1,...Ch. 9.1 - In the code given in Self-Test Question 1,...
Ch. 9.1 - Prob. 11STQCh. 9.1 - Prob. 12STQCh. 9.1 - Prob. 13STQCh. 9.1 - Prob. 14STQCh. 9.2 - Prob. 15STQCh. 9.2 - Prob. 16STQCh. 9.2 - Prob. 17STQCh. 9.2 - Prob. 18STQCh. 9.2 - Prob. 19STQCh. 9.2 - Prob. 20STQCh. 9.2 - Suppose that, in Self-Test Question 19, we change...Ch. 9.2 - Prob. 22STQCh. 9.2 - Prob. 23STQCh. 9.3 - Prob. 24STQCh. 9.3 - Prob. 25STQCh. 9.3 - Prob. 26STQCh. 9.3 - Prob. 27STQCh. 9.3 - Prob. 28STQCh. 9.3 - Repeat Self-Test Question 27, but change the value...Ch. 9.3 - Prob. 30STQCh. 9.3 - Prob. 31STQCh. 9.3 - Prob. 32STQCh. 9.3 - Consider the following program: a. What output...Ch. 9.3 - Write an accessor method called getPrecision that...Ch. 9.3 - Prob. 35STQCh. 9.4 - Rewrite the class ColorDemo in Listing 9.13 so...Ch. 9.4 - Prob. 37STQCh. 9 - Write a program that allows students to schedule...Ch. 9 - Prob. 2ECh. 9 - Prob. 3ECh. 9 - Prob. 4ECh. 9 - Prob. 5ECh. 9 - Write code that reads a string from the keyboard...Ch. 9 - Create a class Rational that represents a rational...Ch. 9 - Prob. 9ECh. 9 - Suppose that you are going to create an object...Ch. 9 - Revise the class RoomCounter described in the...Ch. 9 - Prob. 12ECh. 9 - Write a class LapTimer that can be used to time...Ch. 9 - Prob. 1PCh. 9 - Prob. 2PCh. 9 - Prob. 3PCh. 9 - Write a program that uses the class calculator in...Ch. 9 - Prob. 3PPCh. 9 - Prob. 7PPCh. 9 - Prob. 9PPCh. 9 - Suppose that you are in change of customer service...Ch. 9 - Write an application that implements a trip-time...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Modify the temperature conversion program to print a heading above the table.
C Programming Language
The file produced by the Java compiler containsthat are executed by the Java Virtual Machine.
Java How To Program (Early Objects)
Give an example of a data constraint.
Database Concepts (7th Edition)
A member function of a class that is not implemented is called a(n) _____ function.
Starting Out with C++: Early Objects
What is pseudocode?
Starting Out With Visual Basic (7th Edition)
Complete the following main function so that it asks for the user's weight (in pounds) and displays the equival...
Starting Out with C++: Early Objects (9th 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
- Task 03: Read the concept of Binomial coefficient given in chapter-6. Write a method that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k). For example, your function should return 20 for n = 6 and k = 3, and it should return 35 for n= 7 and k = 4. ( confirm it through the Pascal's triangle as given below). 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 15 10 10 5 1 15 (20) 15 6 1 1 7 21 35 (35 21 7 1 1arrow_forwardQuestion 1: As you are a student of university now, you need to ensure your assignments are plagiarism-free. To do this, you decide to design a simple plagiarism checker. Your checker will take 2 strings as input. Then it will compare the 2 strings and check how many words they have in common. Then, print the percentage in common, by calculating: (No. of words in common / (No of words in string 1+ No of words in string 2)) * 100. If the calculated plagiarism is greater than or equal to 30%, print "Plagiarism detected." Otherwise, print "Good job!". Note: you need to compare "words" not individual characters. You can consider that all characters in both inputs will be in only lowercase or uppercase. ========= ======== Sample Input 1: my dog's name is bob bob is my dog's name Sample Output 1: Common percentage: 50% Plagiarism detected. Explanation 1: Length of string1= 5, Length of string2= 5, number of common words= 5. Hence, common percentage= (5/(5+5))*100 = 50 %3D Sample Input 2: my…arrow_forwardWrite a program to ask user to enter number of codes. Assign a letter for each code and probabilities. Please make sure the total probabilities should be equal to 100%. Create a Huffman code for each letter.arrow_forward
- While the answer works correctly, when it's checking for the "nested if" statements, it fails. Any other ways to do this? I've tried this way and the nested part passes but the returned answers are incorrectarrow_forwardCorrect answer will be upvoted else Multiple Downvoted. Computer science. You are given a positive number x. Observe the littlest positive integer number that has the amount of digits equivalent to x and all digits are unmistakable (extraordinary). Input The principal line contains a solitary positive integer t (1≤t≤50) — the number of experiments in the test. Then, at that point, t experiments follow. Each experiment comprises of a solitary integer number x (1≤x≤50). Output Output t replies to the experiments: on the off chance that a positive integer number with the amount of digits equivalent to x and all digits are diverse exists, print the littlest such number; in any case print - 1.arrow_forwardUse JAVA to create a card game with in which the dealer shuffles the deck and deals 13 cards out of the 52 to the player. If the player sorts her hand and it includes a king of heart, then in response, the dealer should write on the console, "You won!" if not then then "You loose again." Make sure the cards are randomized to get different outputs. Also, create a unit test for the win and loose cases.arrow_forward
- Q2: A mercury thermometer having a time constant of 0.1 min is placed temperature bath at 100°F and allowed to come to equilibrium with the bath. At time t= 0, the temperature of the bath begins to vary sinusoidally about its average temperature of 100°F with an amplitude of 2°F If the frequency of oscillation is 10/π cycles/min, What is the phase lag? In terms of the symbols used T = 0.1 <0 120 f = 10 元 s=100 x(t) = 100+ 2 sin(wt)) يسيفر نظارت دقت السائل SLOWarrow_forward3. When should you use a t-test vs a z-test?arrow_forwardCorrect answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science. How about we characterize a casualty substance: a casualty has a name (not really extraordinary) that comprises just of lowercase Latin letters and an integer doubt esteem. Toward the beginning of the program the client enters a rundown of n casualty names into an information base, every doubt esteem is set to 0. Then, at that point, the client makes questions of two sorts: 1 I x — set the doubt worth of the I-th casualty to x; 2 q — given a string q observe the most extreme doubt worth of a casualty whose name is a coterminous substring of q. Just to remind you, this program doesn't eliminate individuals, it just assists with looking for the names to record in a genuine scratch pad. Consequently, the rundown of the casualties in the data set doesn't change all through the questions. What are you sitting tight for? Compose that program now! Input The main line…arrow_forward
- Get the people's of code.arrow_forwardUse JAVA to create a card game in which the dealer shuffles the deck and deals 13 cards out of the 52 to the player. The player sorts her hand and says whether it includes the King of Hearts. Repeat this process 4 times so that all the 52 cards are dealt. The player should return true or false without writing to the console. In response, the dealer should write on the console, "You won!" or "You loose again." Also create a unit test for the win and loose cases. Create an orignal code with Java card graphics. Please do not reshare a similar answer!arrow_forwardWrite a program that will figure out the required change for a purchase. Start by asking the user for the price of the product and the amount paid. (We are expecting that the user will give a larger value for the amount paid.) Read in each of these values as a double. Report back to the user the number of each denomination of change due. You are not just telling the user the amount of money he gets back. Hint: Working with integers is much easier. The modulo operator is your friend for this assignment. Also, note that pennies can be tricky due to the poor real number to binary conversions. (Remember that 1.00 could actually be stored as 0.9999999999997.) Do not include five-dollar bills, ten-dollar bills, etc. Only show coins and one-dollar bill amounts. Be sure to test multiple values. There is a test case below. Your program should run the test case exactly as it appears below, and should work on any other case in general. Output Example (User input is marked with >>>.…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
C++ Programming Tutorial 36 - Intro to Loops; Author: Caleb Curry;https://www.youtube.com/watch?v=M3o7Y0juEP0;License: Standard YouTube License, CC-BY