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
Write a method called floatEquals that accepts three floating-point values as parameters. The method should return true if the first two parameters are equal within the tolerance of the third
Write a method called isAlpha that accepts a character parameter and returns true if that character is either an uppercase or lowercase alphabetic letter.
Write a method called evenlyDivisible that accepts two integer parameters and returns true if the first parameter is evenly divisible by the second, or vice versa, and false otherwise. Return false
Write a method called maxOfTwo that accepts two integer parameters and returns the larger of the two.
Write a code fragment that reads and prints integer values entered by a user until a particular sentinel value (stored in SENTINEL) is entered. Do not print the sentinel value.
Write a while loop that verifies that the user enters a positive integer value.
What is wrong with the following code fragment? What are three distinct ways it could be changed to remove the flaw?
What output is produced by the following code fragment?int num = 1, max = 20;while (num < max){if (num%2 == 0)System.out.println(num);num++;}
What output is produced by the following code fragment?int num = 1, max = 20;while (num < max){System.out.println(num);num += 4;}
Put the following list of strings in lexicographic order as if determined by the compareTo method of the String class. Consult the Unicode chart in Appendix C.
What output is produced by the following code fragment?int limit = 100, num1 = 15, num2 = 40;if (limit <= limit){if (num1 ==
What output is produced by the following code fragment? int num 87, max 25; = if (num >= max*2) System.out.println ("apple"); system.out.println ("orange"); System.out.println ("pear");
What is wrong with the following code fragment? Will this code compile if it is part of an otherwise valid program? Explain.
What is wrong with the following code fragment? Rewrite it so that it produces correct output.
What happens in the MinOfThree program if two or more of the values are equal? If exactly two of the values are equal, does it matter whether the equal values are lower or higher than the third?
How can a method reference be used to define an event handler?
What is the purpose of a layout pane?
How do you restrict the pixels displayed of an image?
Write a declaration that creates an Arc object that is centered at point (50, 50) and sweeps across the top half of the underlying ellipse. Base it on an ellipse with a horizontal radius of 40 and a
Draw a UML class diagram that shows the relationships among the classes used in the Transactions program.
Suppose you have a class called Child with an instance data value called age. Write a getter method and a setter method for age.
Suppose you have a class called Movie. Write a constructor for the class that initializes the title and director instance variables based on parameters passed to the constructor.
Write a method called randomColor that creates and returns a Color object that represents a random color. Recall that a Color object can be defined by three integer values between 0 and 255
Write a method called randomInRange that accepts two integer parameters representing a range. The method should return a random integer in the specified range (inclusive). Assume that the first
Write a method called random100 that returns a random integer in the range of 1 to 100 (inclusive).
Write a method called cube that accepts one integer parameter and returns that value raised to the third power.
Write a method called lyrics that prints the lyrics of a song when invoked. The method should accept no parameters and return no value.
List some attributes and operations that might be defined for a class called Course that represents a college course (not a particular offering of a course, just the course in general).
List some attributes and operations that might be defined for a class called Meeting that represents a business meeting.
List some attributes and operations that might be defined for a class called PictureFrame that represents a picture frame.
For each of the following pairs, which represents a class and which represents an object of that class?a. Superhero, Supermanb. Justin, Personc. Rover, Petd. Magazine, Timee. Christmas, Holiday
Write a line of code that rotates an ellipse called myEllipse 45 degrees clockwise.
How do you make a shape that has no fill color, so tht you can see the elements behind it?
Is each of the following ellipses wider than it is tall or taller than it is wide?a. new Ellipse(300, 100, 50, 10)b. new Ellipse (100, 200, 20, 40)c. new Ellipse (150, 220, 60, 30)
Are the following lines hirizontal, vertical, or neither?a. new Line(30, 90, 30, 10)b. new Line(85, 70, 70, 85)c. new Line(20, 40, 150, 40)
Write a declaration for each of the following:a. A line that extends from point (60, 100) to point (30, 90)b. A rectangle that is 20 pixels wide, 100 pixels high, and has its upper-left corner at
Compare and contrast a traditional coordinate system and the coordinate system used by Java graphical components.
Write a declaration for an enumerated type that represents the days of the week.
Write code statements that prompt for and read a double value from the user, and then print the result of raising that value to the fourth power. Output the results to 3 decimal places.
Write code statements to create a DecimalFormat object that will round a formatted value to 4 decimal places. Then write a statement that uses that object to print the value of result, properly
Write a single statement that computes and prints the absolute value of total.
Write an assignment statement that computes the square root of the sum of num1 and num2 and assigns the result to num3.
Write code to declare and instantiate an object of the Random class (call the object reference variable rand). Then write a list of expressions using the nextInt method that generate random numbers
Assuming that a Random object has been created called generator, what is the range of the result of each of the following expressions?a. generator.nextInt(20)b. generator.nextInt(8) + 1c.
What is the effect of the following import statement?
What output is produced by the following code fragment?
Write a declaration for a String variable called change and initialize it to the characters stored in another String object called original with all 'e' characters changed to 'j'.
Write a statement that prints the 8th character of a String object called introduction.
Write a statement that prints the number of characters in a String object called overview.
For each of the following expressions, indicate the order in which the operators will be evaluated by writing a number beneath each operator.a. a – b – c – db. a – b + c – dc. a + b / c /
Given the following declarations, what result is stored in each of the listed assignment statements?a. iResult = num1 / num4;b. fResult = num1 / num4;c. iResult = num3 / num4;d. fResult = num3 /
Write four different program statements that increment the value of an integer variable total.
What value is contained in the integer variable length after the following statements are executed?
What value is contained in the floating point variable depth after the following statements are executed?
What value is contained in the integer variable size after the following statements are executed?
What is the output produced by the following statement? Explain.
What output is produced by the following statement? Explain.
What is wrong with the following program statement? How can it be fixed?
What output is produced by the following code fragment? Explain.
Explain the following programming statement in terms of objects and the services they provide.
What is the difference between the literals 4, 4.0, '4', and "4"?
Categorize each of the following situations as a compile-time error, run-time error, or logical error.a. Multiplying two numbers when you meant to add themb. Dividing by zeroc. Forgetting a semicolon
What do we mean when we say that the English language is ambiguous? Give two examples of English ambiguity (other than the example used in this chapter) and explain the ambiguity. Why is ambiguity a
What is a Java Virtual Machine? Explain its role.
Java is case sensitive. What does that mean?
Why are the following valid Java identifiers not considered good identifiers?a. qb. totValc. theNextValueInTheList
Which of the following are not valid Java identifiers? Why?a. Factorialb. anExtremelyLongIdentifierIfYouAskMec. 2ndLeveld. level2e. MAX_SIZEf. highest$g. hook&ladder
List and explain the parts of the URLs for:a. Your schoolb. The Computer Science department of your schoolc. Your instructor's Web page
What is the total number of communication lines needed for a fully connected point-to-point network of eight computers? Nine computers? Ten computers? What is a general formula for determining this
Determine how your computer, or a computer in a lab to which you have access, is connected to others across a network. Is it linked to the Internet?
Explain the differences between a local-area network (LAN) and a wide area network (WAN). What is the relationship between them?
A disk is a random-access device but it is not RAM (random-access memory). Explain.
Explain the difference between random-access memory (RAM) and read only memory (ROM).
How many bits are there in each of the following? How many bytes are there in each?a. 12 KBb. 5 MBc. 3 GBd. 2 TB
If a language uses 240 unique letters and symbols, how many bits would be needed to store each character of a document? Why?
If a picture is made up of 128 possible colors, how many bits would be needed to store each pixel of the picture? Why?
How many unique items can be represented with each of the following?a. 1 bitb. 3 bitsc. 6 bitsd. 8 bitse. 10 bitsf. 16 bits
Why do we use the binary number system to store information on a computer?
Showing 900 - 1000
of 978
1
2
3
4
5
6
7
8
9
10