All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
java software solutions
Questions and Answers of
Java Software Solutions
SR 2.17 What type does Java automatically assign to an integer literal? How can you indicate that an integer literal should be considered a different type?
SR 2.18 What type does Java automatically assign to a floating point literal? How can you indicate that a floating point literal should be considered a different type?
SR 2.19 What is a character set?
SR 2.20 How many characters are supported by the ASCII character set, the extended ASCII character set, and the
Write a method called average that accepts two integer parameters and returns their average as a floating point value.
Overload the makeCircle method of Exercise 7.6 such that if both the color and the radius of the circle are not provided, the color will default to green and the radius will default to 40.Data From
Draw a UML class diagram that shows the relationships among the elements of the Exercise 7.16.Data From Exercise 7.16Create an interface called VCR that has methods that represent the standard
Compare and contrast a mouse clicked event and a key typed event.
What is rubberbanding? How can it be accomplished?
Draw a UML class diagram showing an inheritance hierarchy containing classes that represent different types of cars, organized first by manufacturer. Show some appropriate variables and method names
Show an alternative diagram for the hierarchy in Exercise 9.3 in which the cars are organized first by type (sports car, sedan, SUV, etc.). Show some appropriate variables and method names for at
Given the way the Boxes program is written, what color will a rectangle be if it is both narrow and short? Explain.
What data structure would be a good choice to represent the links between various web sites of the World Wide Web? Give an example.
Would a tree data structure be a good choice to represent a family tree that shows lineage? Why or why not? Would a binary tree be a better choice? Why or why not?
In terms of the final state of a stack, does it matter how the pop operations are intermixed with the push operations? Does it matter how the push operations are intermixed among themselves? Explain
Show the contents of a stack after the following operations are performed. Assume the stack is initially
In terms of the final state of a queue, does it matter how dequeue operations are intermixed with enqueue operations? Does it matter how the enqueue operations are intermixed among themselves?
Show the contents of a queue after the following operations are performed. Assume the queue is initially
Modify your answer to Exercise 13.3 assuming that the list was set up as a doubly linked list, with both next and prev references.Data From Exercise 13.3:Suppose current and newNode are references to
Would the front and rear references in the header node of a linked list ever refer to the same node? Would they ever both be null? Would one ever be null if the other was not? Explain your answers
Suppose current and newNode are references to Node objects. Assume current currently refers to a specific node in a linked list and newNode refers to an unattached Node object. Show, in pseudocode,
Modify your answer to Exercise 13.1 assuming that the list was set up as a doubly linked list, with both next and prev references.Data From Exercise 13.1:Suppose current is a reference to a Node
Suppose current is a reference to a Node object and that it currently refers to a specific node in a linked list. Show, in pseudocode, the steps that would delete the node following current from the
How many line segments are used to construct a Koch snowflake of order N? Produce a chart showing the number of line segments that make up a Koch snowflake for orders 1 through 9.
Write a recursive method to reverse a string. Explain why you would not normally use recursion to solve this problem.
Explain how the functionality of the FoodImages program would change if the property binding was removed.
Other than the examples discussed in this chapter, describe a situation in which you might disable control(s) to help guide user actions.
Look up the following exception classes in the online Java API documentation and describe their purpose:a. ArithmeticExceptionb. NullPointerExceptionc. NumberFormatExceptiond. PatterSyntaxException
What would happen if the try statement described in the previous exercise were moved to the level2 method?
What would happen if the try statement were removed from the level1 method of the ExceptionScope class in the Propagation program?
Create a UML class diagram for the ProductCodes program.
Write a statement that would bind the property representing the radius of a Circle object to the property representing the value in a slider.
Describe a property binding that you could set up other than the examples used in this chapter.
What would happen if the pay method were not defined as an abstract method in the StaffMember class of the Firm program?
Draw and annotate a class hierarchy that represents various types of sales transactions in a store (cash, credit, etc.). Show what characteristics would be represented in the various classes of the
Draw and annotate a class hierarchy that represents various types of animals in a zoo. Show what characteristics would be represented in the various classes of the hierarchy. Explain how polymorphism
Draw and annotate a class hierarchy that represents various types of faculty at a university. Show what characteristics would be represented in the various classes of the hierarchy. Explain how
Give examples of the two types of Java comments and explain the differences between them.
In the Bullseye program, what is the fill color of the innermost circle before it is changed to red? Explain.
Rewrite the if statement used in the Boxes program so that if a box is both narrow and short, its fill color will be orange. Otherwise, keep narrow boxes yellow and short boxes green.
Write code that will shift a Rectangle named rec 50 pixels right and 10 pixels down, rotate it 45 degrees clockwise, and display it at half its original size.
Write code that will invert (turn upside down) an ImageView named pic and display it at twice its original size.
What happens when you apply a transformation to a group?
Overload the average method of Exercise 7.1 such that if three integers are provided as parameters, the method returns the average of all three.Data From Exercise 7.1:Write a method called average
Overload the average method of Exercise 7.1 to accept four integer parameters and return their average.Data From Exercise 7.1:Write a method called average that accepts two integer parameters and
Write a method called multiConcat that takes a String and an integer as parameters. Return a String that consists of the string parameter concatenated with itself count times, where count is the
Overload the multiConcat method from Exercise 7.4 such that if the integer parameter is not provided, the method returns the string concatenated with itself. For example, if the parameter is "test",
Write a method called makeCircle that returns a new Circle object based on the method's parameters: two integer values representing the (x, y) coordinates of the center of the circle, an integer that
Overload the makeCircle method of Exercise 7.6 such that if the Color parameter is not provided, the circle's color will default to red.Data From Exercise 7.6:Write a method called makeCircle that
Overload the makeCircle method of Exercise 7.6 such that if the radius is not provided, a random radius in the range 10 to 20 will be used.Data From Exercise 7.6:Write a method called makeCircle that
Discuss the manner in which Java passes parameters to a method. Is this technique consistent between primitive types and objects? Explain.
Explain why a static method cannot refer to an instance variable.
Can a class implement two interfaces that each contains the same method signature? Explain.
Create an interface called Visible that includes two methods: makeVisible and makeInvisible. Both methods should take no parameters and should return a boolean result. Describe how a class might
Draw a UML class diagram that shows the relationships among the elements of the previous exercise.
Imagine a game in which some game elements can be broken by the player and others can't. Create an interface called Breakable that has a method called break that takes no parameters and another
Create an interface called VCR that has methods that represent the standard operations on a video cassette recorder (play, stop, etc.). Define the method signatures any way you desire. Describe how a
Which of the following are valid declarations? Which instantiate an array object? Explain your answers.int primes = {2, 3, 4, 5, 7, 11};float elapsedTimes[] = {11.47, 12.04, 11.72, 13.88};int[]
Describe five programs that would be difficult to implement without using arrays.
Describe how an element in an array is accessed in memory. For example, where is myArray[25] stored in memory?
Describe what problem occurs in the following code. What modifications should be made to it to eliminate the problem?Int[] numbers = {3, 2, 3, 6, 9, 10, 12, 32, 3, 12 6};For (int count = 1; count
Write an array declaration and any necessary supporting classes to represent the following statements:a. Students’ names for a class of 25 studentsb. Students’ test grades for a class of 40
Write code that sets each element of an array called nums to the value of the contstant INITIAL.
Write code that prints the values stored in an array called names backwards.
Write code that sets each element of a boolean array called flags to alternating values (true at index 0, false at index 1, etc.).
Write a method called sumArray that accepts an array of floating point values and returns the sum of the values stored in the array.
Write a method called switchThem that accepts two integer arrays as parameters and switches the contents of the arrays. Take into account that the arrays may be of different sizes.
Describe a program for which you would use the ArrayList class instead of arrays to implement choices. Describe a program for which you would use arrays instead of the ArrayList class. Explain your
The Dots program listens for a mouse pressed event to draw a dot. How would the program behave differently if it listened for a mouse released event instead? A mouse clicked event?
How would you modify the JukeBox program so that it will play the new song as soon as a combo box item is selected (without having to press the Play button)?
What program modifications would be necessary to add three more songs to the juke box?
Draw a UML class diagram showing an inheritance hierarchy containing classes that represent different types of clocks. Show the variables and method names for two of these classes.
Show an alternative diagrm for the hierarchy in Exercise 9.1. Explain why it may be a better or worse approach than the original.Data From Exercise 9.1:Draw a UML class diagram showing an inheritance
Draw a UML class diagram showing an inheritance hierarchy containing classes that represent different types of airplanes. Show some appropriate variables and method names for at least two of these
Draw a UML class diagram showing an inheritance hierarchy containing classes that represent different types of trees (oak, elm, etc.). Show some appropriate variables and method names for at least
Which of the following classes can be used as the root node of a scene in a JavaFX application? What is the determining factor?a.GridPane b.Rectangle c.Group d.Buttone. ImageView
Draw a UML class diagram showing an inheritance hierarchy containing classes that represent different types of transactions at a store (cash, credit card, etc.). Show some appropriate variables and
Experiment with a simple derivation relationship between two classes. Put println statements in constructors of both the parent and child classes. Do not explicitly call the constructor of the parent
Describe the role of the Alert class.
Describe the hardware components of your personal computer or of a computer in a lab to which you have access. Include the processor type and speed, storage capacities of main and secondary memory,
Write a method called reverse that accepts a String parameter and returns a string that contains the characters of the parameter in reverse order. Note that there is a method in the String class that
Write a method called countA that accepts a String parameter and returns the number of times the character 'A' is found in the string.
Write a method called sumRange that accepts two integer parameters that represent a range. Issue an error message and return zero if the second parameter is less than the first. Otherwise, the method
Write a method called sum100 that returns the sum of the integers from 1 to 100, inclusive.
Write a method called alarm that prints the string "Alarm!" multiple times on separate lines. The method should accept an integer parameter that specifies how many times the string is printed. Print
Write a method called powersOfTwo that prints the first 10 powers of 2 (starting with 2). The method takes no parameters and doesn't return anything.
Write a code fragment that prints every other character in a String object called word starting with the first character.
Write a code fragment that prints the characters stored in a String object called str backwards.
Write a code fragment that determines and prints the number of times the character 'a' appears in a String object called name.
Write a code fragment that reads 10 integer values from the user and prints the highest value entered.
Write a for loop to print the multiples of 3 from 300 down to 3.
Write a for loop to print the odd numbers from 1 to 99 (inclusive).
Write a do loop that verifies that the user enters an even integer value.
Transform the while loop from the previous exercise into an equivalent for loop (make sure it produces the same output).
Transform the following while loop into an equivalent do loop (make sure it produces the same output).int num = 1;while (num < 20){num++;System.out.println(num);}
What output is produced by the following code fragment?for (int val = 200; val >= 0; val -= 1)if (val % 4 != 0)System.out.println(val);
What output is produced by the following code fragment?for (int num = 0; num <= 200; num += 2)System.out.println(num);
How many iterations will the following for loops execute?a. for (int i = 0; i < 20; i++) { }b. for (int i = 1; i <= 20; i++) { }c. for (int i = 5; i < 20; i++) { }d. for (int i = 20; i >
Would it be better to use check boxes or radio buttons to determine the following? Explain.a. Your favorite book genre.b. Whether to make your profile visible or not.c. Which image format to use
Write a method called isIsoceles that accepts three integer parameters that represent the lengths of the sides of a triangle. The method returns true if the triangle is isosceles but not equilateral
Showing 800 - 900
of 978
1
2
3
4
5
6
7
8
9
10