Explore BrainMass


Java Swing Applet

Create a Swing applet with a JButton labeled "Who's number one?." When the user clicks the button, display your favorite sport team in a large font (Use Houston Rockets for the sports team). Please save the file to

Java code errors

1. What are the errors in the following codes: What would correct the errors? A.) if ( age >= 65 ) ; System.out.println( "Age greater than or equal to 65" ); else System.out.println( "Age is less than 65 )"; B.) int x = 1, total; while ( x <= 10 ) { Tot

Java program to Calculate Employee Payroll

A payroll program that calculates the employees weekly pay after employee's name, hourly rate, and number of hours worked. This must include a class to store and retrieve the employees's name, the hourly rate, and the number of hours worked. Use a constructor to initialize the employee information and a method within that class

Java solution to convert decimal to a given base using recursion

Dear OTA - I need a Java solution that can read a decimal integer and convert it to binary or any other given base system using recursion. For example, the Java program will do as follows: read a decimal Integer, val, until "q" is read if "q" then stop else read another Integer, base, which will be a representatio

Java Program to check if Fractions are identical

Need some assistance modifying the attached code. In the attached METHOD "equals", that takes as input another Fraction and returns true if the two fractions are identical and false if they are not, this method reduces the fraction to its lowest terms; that is, if one fraction is 20/60 and the other is 1/3, then the method r

Question about Java - working with files

Write a Java application that reads from a text file a set of lines containing the persons data in the format last_name first_name age (one person per line, the fields are separated by one or more spaces or tabs). The program should create for each name a serialized object with 3 instance members: first and last names (as St

Construct a Java Money Class Program

Please help come up with a money class program. The "Money" Class program completed with examples of the following: Objects (instances) Instance Variables (attributes or properties) Methods Messages Interfaces Encapsulation Inheritance Polymorphism The program need not compile or run but must have appropria

Writing a Program Using the Paint Component Method

Write a program that uses the paint component method to draw the current value of a JSlider on a subclass of JPanel. In addition, provide a JTextField where a specific value can be entered. The JTextField should display the current value of the JSlider at all times. A JLabel should be used to identify the JTextField. The JSli

Java Clock: Writing a Digital Clock in a Window Using an Applet

Write a program that displays a digital clock in a window using an applet. The clock should show, day of week, date, time, time zone and year. The two following classes should help get some of the information needed. import java.util.Date; import javax.swing.Timer;

Java applet, converting character to integer(vice versa) - ASCII

I guess my biggest issue is actually to draw a functionable applet. Design an applet that converts a character to a corresponding integer, and vice versa. The integer corresponding to a character is its ASCII code. The design should look as the attached picture. The applet has to have the following functio

Define a class called fraction, embed class in a test program.

Define a class called Fraction, used to represent a ratio of two integers. 1. Include mutator functions that allow the user to set the numerator and the denominator. 2. Also include a METHOD that displays the fraction on the screen as a ratio (e.g., 5/9). This method does not need to reduce the fraction to lowest terms. 3.

Java Tree manipulation

Tree manipulation I need to write a program that allows the user to enter a line of text. I then need to use the stringTokenizer to break the input into words. I have to Put these words into a link list and then print them out in alphabetical order. Even though the words may appear multiple times in the entered text , it o

Java pair selection.

I need to write a generic class Pair which has two type parameters F and S (first and second) each representing the first and second elements of the pair. Add get and set elements so that the values of the pair can be changed. This is an example of the code of the test class that calls for the pair class. public class Pai

Create a class named MyRectangle to represent rectangles

Create a class named MyRectangle to represent rectangles. The required data fields are width, height, and color. Use double data type for width and height, and a String for color. Suppose that all rectangles are the same color. Use a static variable for color. You will need to provide the accessor methods for the properties and

Java solution to verify records are in alphabetical order

Dear OTA, I need a Java solution that can verify if records are in alphabetical order based on last name then first name. I need this solution in 2 classes: 1. One with the main method that prompts the user for the input filename (merchants.txt). If the input file cannot be opened, the method should continue to reprompt

Java Beginner - Fundamental Java

In plain fundamental Java how would I use an array to come up with the following. Please show how this is done in Java format. Not C++ or anything like that. ?Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a

Array class member methods

Visit the web documentation for J2SE 1.5.0 API Specification. Briefly explain one of the Array class member methods. Include a simple program example demonstrating its use. Write the program as if you were explaining it to someone new to arrays. Fully document your code in such a way n

Creating a Java application that uses an int array

Create a Java application that implements an int array. Use for loops to iterate through the array using the array's length variable to stay within the array bounds. Fill the array with random numbers and print the array. Continue to properly document your source code. Write this program as if you were explaining it to someo

Java Employee Payroll Problem

The file must be called <> (driver program) (which extends employee) (which extends employee) (which extends Salaried) Overall Requirements Write an employee payroll program that uses polymorphism to calculate and print the weekly payroll for y

Modifying Inventory Programs

Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each unit. An item added to the inventory should have an item number one more than the p

Overloaded Java Methods

Write overloaded Java methods that return the difference of two parameters. Your methods should contain the logic to return the difference of the larger parameter ?smaller parameter, regardless of parameter order. Provide enough test code to ensure your methods are logically correct. The following table displays the required met

Modification of an inventory program: Java example

Modify the Inventory Program by creating a subclass (12 oz bottle or 12 oz can) of the product class that uses one additional unique feature of the product you chose. In the subclass, create a method to calculate the value of the inventory of a product with the same name as the method previously created for the product class

Writing a Java Application

Write a JAVA application that finds the total and average of odd numbers from 1 to 15. Your JAVA program must use a counted loop to accomplish this task. Compile and run your program until it works and the output looks nice

JavaScripts, DHTML and HTML

1) Discuss the open source nature of JavaScript scripts. 2) Describe examples of JavaScript script usage in a commercial setting. 3) Explain the difference between DHTML and HTML.

Java Applications for Inventory

The product will be Gold soda, there are 50 units in stock, and they hold a price of $1.10 per unit. Create a product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit. Create a Java application that displays the product number, the name of the product, the

Payroll Program Modification.

Modify the Payroll Program so that it uses a class to store and retrieve the employee's name, the hourly rate, and the number of hours worked. Use a constructor to initialize the employee information, and a method within that class to calculate the weekly pay. Once stop is entered as the employee name, the application should ter

JAVA Computer Language

Write a program that reads three integer inputs into variables. Display the input values in both the ordered entered and in sorted order. This program should sort the numbers so that value1 <= value2 <= value3.


1. Why is top down design beneficial. Compare this type of design to another type of design you known. 2. This and that is a powerful keyword used in Java. How is it used and why is it so beneficial? Give an example in your explanation.

Java Recursion Problem

Design a Java application that accepts a positive integer n > 1 as a command line parameter and outputs all strictly increasing integer sequences starting with 1 and ending with n. For example, for n=5 the following sequences should be output (not necessarily in the shown order): 1 5 1 2 5 1 3 5 1 2 3 5 1 4 5 1 2 4 5