Big Java Late Objects
2nd Edition
ISBN: 9781119330455
Author: Horstmann
Publisher: WILEY
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 3, Problem 22PP
Repeat Exercise P3.21, modifying the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Rewrite Programming Exercise 1.11 to prompt the userto enter the number of years and display the population after the number of years.Here is a sample run of the program:
Enter the number of years: 5The population in 5 years is 325932969
Write a program that asks users when their birthday is. Use information provided to give them their astrological sign. Each of the twelve signs should display a different horoscope. Use the following dates for each sign, keeping in mind that both month and day must be evaluated for an accurate result.
Aries: March 21–April 20
Taurus: April 21–May 21
Gemini: May 22–June 21
Cancer: June 22–July 22
Leo: July 23–August 22
Virgo: August 23–September 23
Libra: September 24–October 23
Scorpio: October 24–November 22
Sagittarius: November 23–December 21
Capricorn: December 22–January 20
Aquarius: January 21–February 19
Pisces: February 20–March 20
can you solve this please?
Adopt appropriate Java animation code to implement the video in the file “test4.wmv” and given that the parametric equation for a circle.
x=r*cos(t)
y=r*sin(t)
with t in range [0, 2p] and r is the radius of the circle.
(the circle goes in a loop like in the images, i did my best to try to explain it , please try to do it )
and here is a sample of what they want me to use :
package javaapplication1;import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.awt.geom.*;import java.util.Random;import javax.imageio.*;import java.io.File;import java.io.IOException;import java.awt.image.BufferedImage;import java.awt.event.*;import java.util.Calendar;
public class JavaApplication1 extends JApplet {
public static void main(String[] args) { JFrame frame=new JFrame(); frame.setTitle("hello"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JApplet applete =new JavaApplication1(); applete.init();…
Chapter 3 Solutions
Big Java Late Objects
Ch. 3.1 - In some Asian countries, the number 14 is...Ch. 3.1 - Consider the following if statement to compute a...Ch. 3.1 - Prob. 3SCCh. 3.1 - Prob. 4SCCh. 3.1 - The variables fuel Amount and fuel Capacity hold...Ch. 3.2 - Which of the following conditions are true,...Ch. 3.2 - Prob. 7SCCh. 3.2 - What is the error in this statement? if (scoreA =...Ch. 3.2 - Supply a condition in this if statement to test...Ch. 3.2 - Prob. 10SC
Ch. 3.3 - In a game program, the scores of players A and B...Ch. 3.3 - Prob. 12SCCh. 3.3 - Prob. 13SCCh. 3.3 - Beginners sometimes write statements such as the...Ch. 3.3 - Prob. 15SCCh. 3.3 - Suppose we want to have the earthquake program...Ch. 3.4 - Prob. 17SCCh. 3.4 - Would that amount change if the first nested if...Ch. 3.4 - Prob. 19SCCh. 3.4 - Prob. 20SCCh. 3.4 - Prob. 21SCCh. 3.5 - Draw a flowchart for a program that reads a value...Ch. 3.5 - Prob. 23SCCh. 3.5 - Prob. 24SCCh. 3.5 - Draw a flowchart for a program that reads a value...Ch. 3.5 - Draw a flowchart for a program that reads a value...Ch. 3.6 - Prob. 27SCCh. 3.6 - Prob. 28SCCh. 3.6 - Prob. 29SCCh. 3.6 - Suppose you are designing a part of a program for...Ch. 3.7 - Suppose x and y are two integers. How do you test...Ch. 3.7 - How do you test whether at least one of them is...Ch. 3.7 - How do you test whether exactly one of them is...Ch. 3.7 - Prob. 34SCCh. 3.7 - What is the advantage of using the type boolean...Ch. 3.8 - In the ElevatorSimulation2 program, what is the...Ch. 3.8 - Your task is to rewrite lines 1926 of the...Ch. 3.8 - In the Sherlock Holmes story The Adventure of the...Ch. 3.8 - Prob. 39SCCh. 3 - What is the value of each variable after the if...Ch. 3 - Prob. 2RECh. 3 - Find the errors in the following if statements. a....Ch. 3 - What do these code fragments print? a. int n = 1;...Ch. 3 - Suppose x and y are variables of type double....Ch. 3 - Suppose x and y are variables of type double....Ch. 3 - Explain why it is more difficult to compare...Ch. 3 - Given two pixels on a computer screen with integer...Ch. 3 - It is easy to confuse the - and operators. Write...Ch. 3 - Each square on a chess board can be described by a...Ch. 3 - Prob. 11RECh. 3 - In a scheduling program, we want to check whether...Ch. 3 - Draw a flowchart for the algorithm in Exercise...Ch. 3 - Draw a flowchart for the algorithm in Exercise...Ch. 3 - Draw a flowchart for the algorithm in Exercise...Ch. 3 - Prob. 16RECh. 3 - Prob. 17RECh. 3 - Write pseudocode for a program that prompts the...Ch. 3 - Write pseudocode for a program that assigns letter...Ch. 3 - Explain how the lexicographic ordering of strings...Ch. 3 - Of the following pairs of strings, which comes...Ch. 3 - Explain the difference between an if/else if/else...Ch. 3 - Give an example of an if/else if/else sequence...Ch. 3 - Rewrite the condition in Section 3.3 to use ...Ch. 3 - Prob. 25RECh. 3 - Make up a Java code example that shows the...Ch. 3 - Complete the following truth table by finding the...Ch. 3 - True or false? A B is the same as B A for any...Ch. 3 - The advanced search feature of many search engines...Ch. 3 - Suppose the value of b is false and the value of x...Ch. 3 - Simplify the following expressions. Here, b is a...Ch. 3 - Simplify the following statements. Here, b is a...Ch. 3 - What is wrong with the following program?...Ch. 3 - Write a program that reads an integer and prints...Ch. 3 - Write a program that reads a floating-point number...Ch. 3 - Write a program that reads an integer and prints...Ch. 3 - Write a program that reads three numbers and...Ch. 3 - Write a program that reads three numbers and...Ch. 3 - Repeat Exercise E3.5, but before reading the...Ch. 3 - Write a program that reads in three integers and...Ch. 3 - Write a program that reads four integers and...Ch. 3 - A compass needle points a given number of degrees...Ch. 3 - Write a program that reads a temperature value and...Ch. 3 - The boiling point of water drops by about one...Ch. 3 - Add error handling to Exercise E3.11. If the user...Ch. 3 - When two points in time are compared, each given...Ch. 3 - The following algorithm yields the season (Spring,...Ch. 3 - Write a program that reads in two floating-point...Ch. 3 - Unit conversion. Write a unit conversion program...Ch. 3 - Write a program that prompts the user to provide a...Ch. 3 - Write a program that asks the user to enter a...Ch. 3 - Write a program that translates a letter grade...Ch. 3 - Write a program that translates a number between 0...Ch. 3 - Write a program that takes user input describing a...Ch. 3 - Write a program that reads in three floating-point...Ch. 3 - Write a program that reads in three strings and...Ch. 3 - Write a program that prompts for the day and month...Ch. 3 - The original U.S. income tax of 1913 was quite...Ch. 3 - Write a program that computes taxes for the...Ch. 3 - The TaxReturn.java program uses a simplified...Ch. 3 - Write a program that reads in the x- and...Ch. 3 - Write a program that reads in the x- and...Ch. 3 - Write a program that reads in the x- and...Ch. 3 - Roman numbers. Write a program that converts a...Ch. 3 - A year with 366 days is called a leap year. Leap...Ch. 3 - French country names are feminine when they end...Ch. 3 - Write a program to simulate a bank transaction....Ch. 3 - Write a program that reads in the name and salary...Ch. 3 - When you use an automated teller machine (ATM)...Ch. 3 - Calculating the tip when you go to a restaurant is...Ch. 3 - A supermarket awards coupons depending on how much...Ch. 3 - Write a program that prompts the user for a...Ch. 3 - Repeat Exercise P3.21, modifying the program so...Ch. 3 - Repeat Exercise P3.21, modifying the program so...Ch. 3 - A minivan has two sliding doors. Each door can be...Ch. 3 - Sound level L in units of decibel (dB) is...Ch. 3 - The electric circuit shown below is designed to...Ch. 3 - Crop damage due to frost is one of the many risks...Ch. 3 - A mass m = 2 kilograms is attached to the end of a...Ch. 3 - The average person can jump off the ground with a...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Implement the findProduct method. This should look through the collection for a product whose id field matches ...
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
What is the disadvantage of having too many features in a language?
Concepts Of Programming Languages
Write a complete Java program that reads in a line of keyboard input containing two values of type int (separat...
Absolute Java (6th Edition)
Write a complete Java program that behaves as follows. The program displays an input dialog window asking the u...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Can you reference a static variable by name within the definition of a static method without using a class name...
Java: An Introduction to Problem Solving and Programming (8th Edition)
What is an algorithm?
Starting Out With Visual Basic (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
- kindly change the program following the procedure on the problem. please list the changes you have made on the program t..thank youarrow_forwardmodify Exercise 6.57 in a way that every time the user give the right answer , the response varies within the following : Possible responses to a correct answer: Very good!Excellent!Nice work!Keep up the good work! while if the user give the incorrect answer the response varies within the following : Possible responses to an incorrect answer: No. Please try again.Wrong. Try once more.Don't give up!No. Keep trying. Use random-number generation to choose a number from 1 to 4 that will be used to select one of the four appropriate responses to each correct or incorrect answer. Use a switch statement to issue the responses. here is the code that need to be modified : and make sure you add line comments for each new line of code EXERCISE 6.57 CODE: ----------------------------- //Name: IhabAtouf//Date:02/23/2023// exercise 6.57 on page 281//program description: create computer-assisted instruction (CAI) program that help students master thier math skills in multiplications,//…arrow_forwardWrite a program that reads a number and finds it is a prime or not. 0. A prime number is a number such that 1 and itself are the only numbers that evenly divide it. For example: 3, 5,7, 11, 13, 17. 2.arrow_forward
- Write a program that prompts the user to enter adecimal number and displays the number in a fraction. (Hint: read the decimalnumber as a string, extract the integer part and fractional part from the string,and use the BigInteger implementation of the Rational class in Programming to obtain a rational number for the decimal number.) Here are somesample runs: Enter a decimal number: 3.25 ↵EnterThe fraction number is 13/4 Enter a decimal number: –0.45452 ↵EnterThe fraction number is –11363/25000arrow_forwardUsing Eclipse: Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received from the customer. Display the dollars, quarters, dimes, nickels, and pennies that the customer should receive in return. In order to avoid roundoff errors, the program user should supply both amounts in pennies, for example 274 instead of 2.74. Use labels for each currency when you display.arrow_forwardWrite a program to build a calculator. Instead of a typical calculator which reads in-order expressions and evaluates them, build a calculator that takes in numbers and assigns the operations to yield the highest value expression. The current operations on the calculator only handle pairs of parentheses, and the operators for addition, subtraction, multiplication, and division. The calculator can rearrange the numbers if it helps find the optimal value. For example, the list:4.0 5.0 3.0 2.0 1.0using the calculator should find the optimal expression yielding the maximum value to be:4.0 * 5.0 * 3.0 * (2.0 + 1.0) = 180Input from the keyboard a list of up to 10 floating-point values from-100000.0to100000.0. Output to the screen a single floating-point value rounded to two decimal places representing the highest value expression that the calculator could create by inserting the symbols( ) + - * /into the given expression. Assume at least one number in the list and only the operators listed…arrow_forward
- Write a Java program that asks the user to enter a string and counts how many times the letter "s" or "S" appears in the string. Display that number and then display the string that many times. Requirements: Call a method that gets the string from the user. Use recursion to ensure the string has at least 5 characters. Call a method that returns the number of times the letter "s" or "S" appears in the string. This method should use recursion. Call a method that takes the number of times the letter"s" or "S" appeared in the string and display the original string that was obtained from the user that many times using recursion. Call a method that sorts the letters in the string and searches for the letter "m". Display Found or Not Found.arrow_forwardMake Camel Case. Create a program that reads a multi-word phrase, and prints the Camel Case equivalent. For example, for input “total account balance” the program shall output “totalAccountBalance”.Notice that the first word is in lowercase (even if it contains uppercase letters). The rest of the words, only their initials are capitalized.arrow_forwardRewrite Exercise 3.4 using the following func tion to return the area of a pentagon: def area(s):arrow_forward
- Word Statistics: The second requirement change is to allow replacement of all occurrences of a given word to a given replacemWrite the code only in python language with the opeartion exactly and necessary comments to be added.arrow_forwardUOWD Library is asking you to write a Java program that manages all the items in the Library. The library has books, journals, and media (DVD for example). All items have a name, author(s), and year of publication. A journal also has a volume number, while a media has a type (audio/video/interactive). The user of your program should be able to add an item, delete an item, change information of an item, list all items in a specific category (book, journal, or media), and print all items (from all categories). A menu asks the user which operation s/he wants to perform. Important: make use of collections, inheritance, interfaces, and exception handling wherever appropriate.arrow_forwardWrite a code in Java Programming Your task is to simulate a coffee shop using the observer pattern (do not use the deprecate one). The coffee shop serves two types of coffee: espresso and cappuccino. The shop has two baristas, EspressoBarista and CappuccinoBarista. EspressoBarista generates random espresso orders between 1 and 3 every 2 seconds, while CappuccinoBarista generates random cappuccino orders between 1 and 3 every 3 seconds. The UML design diagram is shown below. Property ChangeListenerfac Observablenerfacto Coffeeshop HashMap Sting, integer> ingredients ExpresssCartate The CoffeeShop class holds the current stock of ingredients and the CoffeeShop constructor initializes the count for each ingredient. The required ingredients for each type of coffee are as follows: • Espresso: 1 shot of espresso, 1 ounce of milk Cappuccino: 1 shot of espresso, 2 ounces of milk, 1 ounce of foam If an order cannot be fulfilled because there are not enough ingredients, a warning message…arrow_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
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY