Explore BrainMass


Java Compilers and Interpreters

1. Discuss the advantages and disadvantages of compilers and interpreters. 2. When would you use each? 3. Pick a problematic situation that you think a Java program can solve or make easier. 4. Explain the problem and then write the pseudo code for it.

Write a Console Program with Java

Programming exercises are a key component of learning any programming language. For this course, there are four programming assignments that are arranged from the simplest case to more complex tasks as you progress through the course. The textbook comes with a CD-ROM that includes Java. Students may install and use this versi

Creating a sorting array

This is what I want to achieve. I have an array of positive integers which I wish to sort according to the sequence represented by the integer number line. The bubble sort operates as follows: 1. Find the two adjacent elements, X and Y, in the array such that X > Y and swap X and Y, then sort the resulting array.

Enhancing the Future Value

Using Netbean 7.2 create a program satisfying the following: - Constructor for the Invoice class requires subtotal and customer type only - Methods make discount percent, discount amount and invoice total available - Methods include accessors and mutators for both instance variables - Includes methods which format invoic

Modifying Java Code

Criterion compiles Type "R" with subtotal >= $250 and < %500 get 25% discount Type "R" with subtotal > $500 get 30% discount Type "C" always get 20% discount Added new Type "T" with subtotal < $500 get 40% discount Added new Type "T" with subtotal >= $500 get 50% discount Types other than "C

Application that stores at least four different course names

The application as written does not display certain class names included in the instructions as written. Write an application that stores at least four different course names and meeting days and times in a two-dimensional string array. Allow the user to enter a course name (such as CIS 110) and display the day of the week

Java Assistance and Writing Methods

I need assistance in processing this java assignment so that I can do the problem for my group assignment. I am having issues trying to understand the java statements. This is not the actual assignment that I will be handing in. The assignment I have to hand in as a group is Multiple Parameters but it is working with a fil

Java Writing Methods with No Parameters

The program asks the user if they have pre-registered for a conference. If the user has pre-registered, the program should call a method named discount () that displays the message "You are pre-registered and qualify for a 10% discount." If the user has not pre-registered, the program should call a method named noDiscount () t

Basic Arrays: Computer Science - Java Assistance

Exercise 1 Array Basics 1.) Write array declarations for each of the following: a. Eight grade point averages a. Int gradePointAverage [] = new int [8]; b. Five first names a. String firstName [] = new String [5]; c. 21 ages a. Int ages [] = new int[21]; 2.) Declare and initialize arrays that store the foll

Java GUI and Code Help

Develop an application that counts the number of words, number of characters with spaces and without spaced. The program should display the text file statistics as follows: File Name: sample.txt Number of Words: 124 Number of characters without spaces: 1045 Number of ch

jGrasp assistance/Java Using Loops

Problem 5.2 Using a Sentinel Value to control a while Loop On this exercise I need to write a while loop that uses a sentinel value to control a loop in a Java program. I also need to write the statements that make up the body of the loop. I have already entered the necessary variable declarations and output statements.

Display sum (i+j) at the center of the table cell when mouse is clicked anywhere on a table cell that is at the intersection of column number i and row number j, using only plain HTML instructions.

I have a problem where I am supposed to make a 3x3 table with columns and rows numbered 1,2,3. Each table cell has to have identical width and height of 50 pixels and initially all cells are empty. That part I have done. However, clicking on table cell that is at the intersection of column number i and row number j should dis

Assistance with Java

First Problem I need help answering the following questions. I tried to do this in Java but I couldn't get it to execute. int numValue = 10; int answer = 0; switch(numValue) { case 5: answer += 5; case 10: answer += 10; case 15: answer += 15; break; case 20: answer += 20; case 25:

Java Program: Interactive Grading System Using Swing

Need assistance trying to figure out the Java Program that is attached. Need assistance with the java program below. 1. Declare two String variables named testScoreString and classRankString. 2. Declare two integer variables named testScore and classRank. 3. Write the interactive input statements to retrieve a student's te

Java Sequential Statements

Write Java Code needed to perform the following: - Calculate state withholding tax at 6.0% and calculate federal withholding tax at 25.0%. - Calculate dependent deductions at 2.0% of the employee's salary for each dependent. - Calculate total withholding. - Calculate take-home pay as salary minus total withholding plus deduc

Java: Profits and sales prices calculated

This program calculates profits and sales prices for a furniture company. -First calculate the profit, then calculate the sales price, then calculate the profit when the sale price used. -Profit is defined as the retail price minus the wholesale price. -The sales price 20% deducted from the retail price. -The sal

Declaring and initializing Java variables

Need help with declaring and initializing java variables. I am trying to compile and execute a program. I have downloaded the file and attached it. Sample: Calculate your age in the year 2060. 1. Declare an integer variable name newAge. 2. Declare and initialize an integer variable named currentAge. Initialize this vari

Rectangle class using Java

Create a Rectangle class with - Private attributes for width and height - A default constructor that sets the height to 10 and width to 25. - An overloaded constructor that takes integer width and height arguments, uses a separate method to check whether the width and height fall within the range between 0 and 30, and throws

Java Creating a Class Called Date

Create a class called SimpleDate that includes three instance variables - a month, a day and a year (all type int). Provide a constructor that initializes the three instance variables and validates that those values are correct (follow calendar rules) and throws an exception for incorrect values. Provide a set and get method for

Abstract Classes of Fish

Create an abstract class called Aqualife. Aqualife has the following attributes: name age lakeFish oceanFish Aqualife defines 2 abstract methods called eats() and procreates(). A third concrete method called breathes() displays that 'These creatures breathe from gills.' Create subclasses of Aqualife: Fish Whale

Java Program Class Members

Create a Java program that manipulates at least two objects instantiated from the Dog class. Your class must include at least five private attributes, three setter and three getter methods which are the public interface and two constructors. All the class members must be used during your program run. Your program must include th

Java GUI program- Java Retail Markdown Calculator

A retailer would like a calculator to indicate sale prices when he marks items down at various percentages. Using Java Language Design, implement, test, and debug a GUI application that allows the retailer to enter the item's name, the item's original price, and the percentage discounted. The application should include a

Definitions for Informatics

Instructions: Write a definition in your own words for each of the terms below. 1. Hardware 2. Software: 3. Network: 4. Data: 5. Information: 6. Database:

Java - Fill in Question

Add a class FillInQuestion to the question hierarchy of How To 10.1. An object of this class is constructed with a string that contains the answer, surrounded by _ _, for example, "The inventor of Java was _James Gosling_". The question should be displayed as The inventor of Java was _____ Here is a sample program run:

Provide a Java class named Input containing the method readInt that displays the prompt string, reads an integer, and tests whether it is between the supplied minimum and maximum.

Provide a Java class named "Input" containing the method "readInt" (prototype given below) that displays the prompt string, reads an integer, and tests whether it is between the supplied minimum and maximum. If not, it prints an error message and repeats the entire process. public static int readInt(Scanner in, String prompt,

Java - Find Reserved Word

Write a program Find that searches all files specified on the command line and prints out all lines containing a reserved word. For example, if you call java Find ring report.txt address.txt, then the program might print: report.txt: has broken up an international ring of DVD bootleggers that address.txt: Kris

Java - Purse Methods

Write a method for the Purse class public boolean sameCoins(Purse other) that checks whether the other purse has the same coins, perhaps in a different order. For example, the purses Purse[Quarter,Dime,Nickel,Dime] and Purse[Nickel,Dime,Dime,Quarter] should be considered equal. You will probably need one or more help

Java - Purse

Write a method for the Purse class public boolean sameContents(Purse other) that checks whether the other purse has the same coins in the same order. Complete the following class in your solution: import java.util.ArrayList; /** A purse holds a collection of coins. */ public class Purse { private ArrayList<St

Writing Programs in Java

The programming assignment for this module is programming exercise #7 on pages 861 and 862, with the following modifications. - For part 'a' the source code for class Roman is attached to this assignment. You do not have to include the method decimalToRoman as you modify this class. Also, class Roman is not used in your test