How does a computer’s main memory differ from its auxiliary memory?
After you use a text editor to write a program, will it be in main memory or auxiliary memory?
When a computer executes a program, will it be in main memory or auxiliary memory?
How does machine language differ from Java?
How does bytecode differ from machine language?
What would the following statements, when used in a Java program, display on the screen?
age = 20;
System.out.println ("My age is");
Write a statement or statements that can be used in a Java program to display the following on the screen:
Write statements that can be used in a Java program to read your age, as entered at the keyboard, and display it on the screen.
Given a person's year of birth, the Birthday Wizard can compute the year in which the person's nth birthday will occur or has occurred. Write statements that can be used in a Java program to perform this computation for the Birthday Wizard.
java.util.Scanner keyboard = new java.util.Scanner(System.in);
System.out.println("Enter the year you were born");
int yearBorn = keyboard.nextInt();
System.out.println("Enter birthday to check year for");
int birthday = keyboard.nextInt();
System.out.println("You will turn " + birthday + " in " + (yearBorn + birthday));
Write statements that can be used in a Java program to read two integers and display the number of integers that lie between them, including the integers themselves. For example, four integers are between 3 and 6: 3, 4, 5, and 6.
A single bit can represent two values: 0 and 1. Two bits can represent four values: 00, 01, 10, and 11. Three bits can represent eight values: 000, 001, 010, 011, 100, 101, 110, and 111. How many values can be represented by
Find the documentation for the Java Class Library on the Oracle Web site. (At this writing, the link to this documentation is / Then find the description for the class Scanner. How many methods are described in the section entitled "Method Summary"?
Self-Test Question 27 asked you to think of some attributes for a song object. What attributes would you want for an object that represents a play list containing many songs?
What behaviors might a song have? What behaviors might a play list have? Contrast the difference in behavior between the two kinds of objects.
What attributes and behaviors would an object representing a credit card account have?
Suppose that you have a number x that is greater than 1. Write an algorithm that computes the largest integer k such that 2^k is less than or equal to x.
Write an algorithm that finds the maximum value in a list of values.
Find the documentation for the class Graphics in the Java Class Library. (See Exercise 12.) Learn how to use the method drawRect. Then write statements that can be used in a Java applet to draw a square containing a circle. The circle's diameter and the square's side should be equal in size.