Explore BrainMass

Explore BrainMass

    Java

    BrainMass Solutions Available for Instant Download

    Java Code for NumberFormat Class

    Need to add in: The number format in one decimal place to make this to round the average score to one decimal in this program. //////////////////////////////////////////////// import java.util.Scanner; public class TestScoreApp { public static void main(String[] args) { // display operational mess

    Programming Exercise

    Write a function that includes the following sequence of statements: x = 21; int x; x = 42; I need to run the program in C, C++, and JAVA. If I can get started in one of the languages I will be able to complete the rest. Thanks.

    Java Method - removeAll

    Write a method, removeAll, that takes three parameters: an array of integers, the length of the array, and an integer, say, removeItem. The method should find and delete all occurrences of removeItem in the array. If the value does not exist or the array is empty, output an appropriate message. (Note that after deleting the elem

    Java Class Fraction

    Rational fractions are of the form a / b, where a and b are integers and b != 0. In this exercise, by "fractions" we mean rational fractions. Suppose a / b and c / d are fractions. Arithmetic operations on fractions are defined by the following rules: a/b + c/d = (ad + bc) / bd a/b - c/d = (ad - bc) / bd a/b * c/d =

    integer value reverse

    There is an attachment with this problem. Please review the attachment and conjunction with the problem being posted. The problem is below and currently I am stuck. " Write a method that takes an integer value and returns the number with its digits reversed. For example, given the number 7631, the method should return 136

    Creating a Java Inventory Program

    I have been collecting golf balls from different courses over the years now. Of right now I have an inventory of over 200 golf balls from different courses. Each golf ball has its own logo (golf course name) My project is to create an inventory of my golf balls; can some one help me with this project? The product is golf ba

    GUI Components - Java - JPanel

    Declare a subclass of JPanel called MyColorChooser that provides three JSlider objects and three JTextField objects. Each JSlider represents the values from 0 to 255 for the red, green and blue parts of a color. Use these values as the arguments to the Color constructor to create a new Color object. Display the current value of

    Java Applets - Floating-Point Numbers

    Write an applet that asks the user to enter two floating-point numbers, obtains the numbers from the user and displays the two numbers first and then the larger number followed by the words "is larger" as a string on the applet. If the numbers are equal, the applet should print the message "These numbers are equal." Use the tech

    GUI Components - Java - Guess the Number

    Write an application that plays "guess the number" as follows: Your application chooses the number to be guessed by selecting an integer at random in the range 1-1000. The application then displays the following in a label: I have a number between 1 and 1000. Can you guess my number? Please enter your first guess. A JText

    Java Programming/Mortgage

    Please help me create a GUI with 3 JTextField (one for loan amount, one for term, and one for interest rate), one JTextArea (where the monthly payment schedule will be displayed; appended for each month, for all moths; attach a JScrollPane to the JTextArea), one JComboBox (with 3 selections: 7 year at 5.35%, 15 year at 5.5 %, 3

    Multi threading - Java

    State whether each of the following is true or false. If false, explain why. a) Method sleep does not consume processor time while a thread sleeps. b) Using a Lock guarantees that deadlock cannot occur. c) Once a Lock has been obtained by a thread, the Lock object will not allow another thread to obtain the lock until the f

    Java - ListMerge

    Write a program that merges two ordered-list objects of integers into a single ordered-list object of integers. Method merge of class ListMerge should receive references to each of the list objects to be merged and return a reference to the merged list object. Tips: http://www.engineering.uiowa.edu/~swd/LectureNotes/JavaHTP6e

    Java Programming

    ? Explain how methods with multiple parameters are declared. ? Describe two examples of Java-based applications that might use methods that have two or more parameters. ? Provide detail about where those applications would be used.

    Components of This Code

    Can you explain the components of this code for me? javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { new testEvents(); Basically, when I read this code, I just want to know how it works, what it does, when would I use this, would I use it every time, etc.

    Java Programming ActionEvents

    I have a question about something that has puzzled me. I did this on my program because it was how I saw it done. I was wondering if someone could explain why it is done this way and if I would do this for all ActionEvents. I used the following code. What does the ".getSource()" do? Is that what registers when someone

    JAVA Programming for a GUI

    Modify the Inventory Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next item, and the last item in the inventory. If the first item is displayed and the user clicks on the Previous button, the last item should display. If the last item is displayed and the user click

    Java - KeyboardWord

    Write a program that inputs a word from the keyboard and determines the length of the word. Print the word using twice the length as the field width.

    Printing Dates and Times - Java

    Write a program that prints dates and times in the following forms: GMT-05:00 04/30/04 09:55:09 AM GMT-05:00 April 30 2004 09:55:09 2004-04-30 day-of-the-month:30 2004-04-30 day-of-the-year:121 Fri Apr 30 09:55:09 GMT-05:00 2004

    Correcting Errors in the Java Output Statements

    Find the error(s) in each of the following program segments. Show the corrected statement. a) System.out.printf( "%sn", 'Happy Birthday' ); b) System.out.printf( "%cn", "Hello" ); c) System.out.printf( "%cn", "This is a string" ); d) The following statement should print "Bon Voyage" with the double quotes: System.out.

    Palindromes - Blanks Ignored - Java

    A palindrome is a string that will spell the same way forward and backward. Some examples of palindromes are "radar", "able was I ere I saw elba" and (if blanks are ignored) "a man a plan a canal panama". Write a recursive method testPalindrome that returns boolean value true if the string stored in the array is a palindrome and

    Java - What does the following program do? MysteryClass

    // Exercise 15.12 Solution: MysteryClass.java public class MysteryClass { public int mystery( int array2[], int size ) { if ( size == 1 ) return array2[ 0 ]; else return array2[ size - 1 ] + mystery( array2, size - 1 ); } // end method mystery } // end cl

    Design and writing an Applet

    I need assistance in the Design and write an Applet program in Java to simulate the operation of a car park pre-payment machine. The machine should allow the customer to select how many hours they require to park, accept payment in the following denominations: 10p, 20p, 50p, £1, and £2, and display the amount of any change d

    Visualizing Recursion - Java

    It is interesting to watch recursion "in action." Modify the factorial method in Fig. 15.3 to print its local variable and recursive-call parameter. For each recursive call, display the outputs on a separate line, and add a level of indentation. Do your utmost to make the outputs clear, interesting and meaningful. Your goal here

    Recursive power Method - Java

    Write a recursive method power( base, exponent ) that, when called, returns exponent base For example, power( 3,4 ) = 3*3*3*3. Assume that exponent is an integer greater than or equal to 1. [Hint: The recursion step should use the relationship exponent exponent-1 base = base*

    Java Programming

    1. Describe the relationship between a GUI component and events? What is the programmer's responsibility when developing a GUI, event-driven program? 2. List two advantages and two disadvantages of using UML as a modeling standard for Object-Oriented programs.

    Payroll program

    Create a non-GUI based Java application that calculates weekly pay for an employee. The application should display text that requests the user input the name of the employee, the hourly rate, and the number of hours worked for that week. The application should then print out the name of the employee and the weekly pay amount. In

    Inheritance Hierarchy

    Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Make the hierarchy as deep (i.e., as many levels) as possible. Specify the instance variables and methods for each class. The private instance variables of Quadrilateral

    Java Programing

    How does knowledge of programming concepts benefit individuals working in any IT position? Include at lest one specific examples of how java programing knowledge benefits nonprogrammers working in IT.

    Java Code High-Lighting

    I need assistance in remarking the enclosed Java Code high-lighting, things like code layout, use of variable names, general readability and understandability.