Share
Explore BrainMass

Java

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 code loop

Please use a simple integer loop and branching statements to play a fictitious game of foo bar baz. Create a program that loops from 1-50 and prints each value on a separate line. Also print foo for every multple of three, bar for every multiple of five, and baz for every multiple of seven Partial Output From the FooBarBaz pr

public class

public class CustomerM { public static void main(String[] Jim) { Customer cust1 = new Customer("Joe", 19); System.out.println(cust1.name); System.out.println(cust1.age); cust1.name = "Jim"; cust1.age = 20; System.out.println(cust1.name); System.out.println(cust1.age);

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

Auto Java Class

public class Auto{ public int miles; public int gas; } 1. Encapsulate this class ( set vars to private.) Provide getmethods and setmethods for each variable 2. Add a default constructor which initializes miles and gas to zero 3. Overload this constructor which takes 2 parameters: inputmiles and inputgas. This constructo

Java Programming

Create a Building class and two subclasses, House, and School. The Building class contains fields for square footage and stories. The House class contains additional fields for number of bedrooms and baths. The School class contains additional fields for number of classrooms and grade level (for example elementary or junior high

Non-GUI Java program for course

I am looking for a program using the following classes : Course, Section, Instructor, Students, and optional CourseRoster, and GradeBook. It has to print out the course name, instructor name, 5 students with 3 grades for each student. I am attaching what I have made in eclipse so far. I don't think the CourseRoster, and GradeBo

Writing 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 Homework.java, then the program might print: report.txt: has broken up an international ring of DVD bootleggers that address.txt: Kris

Java - Reverse String

Write a program that replaces each line of a file with its reverse. For example, if you run java Reverse HelloPrinter.java then the contents of HelloPrinter.java are changed to retnirPolleH ssalc cilbup { )sgra ][gnirtS(niam diov citats cilbup { wodniw elosnoc eht ni gniteerg a yalpsiD // ;)"!dlroW ,olleH"(nltnir

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

Java Class for services offered by a hair-styling salon.

The Curl Up and Dye Salon offers a variety of salon services for its customers. Jane Fields, the owner, has contracted to have you write a program that allows reports to be output, sorted by each type of service offered. Table below shows the various services, service prices, and service times. Service

Java Nearest Neighbor Algorithm

Please assist with a java class named "Topology" that includes methods "NearestNeighbor" and "RandomNeighbor". Given an Array object of type String that may list a variable amount of network client node IDs (2100, 2101 ... 2109, 2110) and their own corresponding Cartesian coordinates (i.e., xPos, yPos), the "NearestNeighbor" me

Java Program: Convert Numerical Grade To Closest Letter Grade

Write a Java program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade; for example, 2.85 should be a B. Any value >= 4.15 should be an A+. Write a class Grade with a method

Java program that translates a letter grade into a number grade.

Write a Java program that translates a letter grade into a number grade. Letter grades are A B C D F, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F-. A + increases the numeric value by 0.3, a - decreases it by 0.3. However, an A+ has the value 4.0. All other inputs have value -1.

Graphical application in Java that displays a checkerboard

Write a graphical application in Java that displays a checkerboard with 64 squares, alternating white and black. Please refer to the attachment for sample program output. Your main class should be called CheckerBoardViewer. You need to supply the following classes in your solution: CheckerBoard CheckerBoardComponent

Graphical Application that Draws a Spiral

Write a graphical application that draws a spiral, such as the following: Your main class should be called SpiralViewer. Complete the following class in your solution: public class SpiralGenerator { // private implementation . . . /** Creates a spiral generator. @param initialSize the size

Implementing Line Equations In Java

A line in the plane can be specified in various ways: by giving a point (x, y) and a slope m by giving two points (x1, y1), (x2, y2) as an equation in slope-intercept form y = mx + b as an equation x = a if the line is vertical Implement a class Line with four constructors, corresponding to the fou

Java Program average numbers

The number closest from the average is the number From the list closest to the average. Also, your test plan would be very incomplete as I was asking for 6 test: taking the average of 1 number does not seem to be a very extensive test either. you don not need screen dump for the test. just a table with list of inputs and expec

Java Program for a Mortgage Calculator

Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage and the user's selection from a menu of available mortgage loans: - 7 years at 5.35% - 15 years at 5.5% - 30 years at 5.75% Use an array for the mortgage

Writing Programs in Java and C#

1. Write a Java program that reads in 10 integers and displays the biggest and second biggest number from them. For instance, if the input is 2 4 1 2 5 8 9 1 3 2, the output would show 9 and 8. You can choose to use the console for input and output, or to use dialog boxes. Test data in this case is simply a list of inputs

Design and Analysis of Algorithms

Consider a table B that consists of m integers B [1], B [2] ... B [m]. Design an algorithm to produce a two-dimensional m x m table C such that each element C[i,j] for i <j contains the sum of the B [i] up to the B [j], that is, (B [i] + B [i +1] + ... + B [j]). The values C[i,j] for i >= j are left unspecified, that is, these c

Java Mortgage Calculator: Debugging A Conversion Exception

I tried your code and this is what I got. I am using Net Beans 7.0.1 Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '1' at java.util.Formatter.checkText(Formatter.java:2547) at java.util.Formatter.parse(Formatter.java:2533) at java.util.Formatter.format(Formatter.java:2469) at java