Web development and programming
191828 questions • Page 3745 / 3837
public class Rational { private int num; private int den; public Rational ( ) {
public class Rational { private int num; private int den; public Rational ( ) { num = 0; den = 1; } public Rational (int a, int b) { num = a; den = b; simplify ( ); } private void…
public class Rectangle extends GraphObj{ float height; float width; public Recta
public class Rectangle extends GraphObj{ float height; float width; public Rectangle(float w, float h){ System.out.println("Rectangle::Rectangle()"); height = h; width = w; } …
public class Rectangle extends Shape { private Point lowerLeft, upperRight; Rect
public class Rectangle extends Shape { private Point lowerLeft, upperRight; Rectangle(Point lowerLeft, Point upperRight) { this.lowerLeft = lowerLeft; this.upper…
public class Rectangle { private double len; private double wid; private double
public class Rectangle { private double len; private double wid; private double x; private double y; public Rectangle() { len = 1; wid = 1; x = 0; y = 0; } public Rectangle(dou…
public class Recurrences { //Implements the basic laws of positive exponents ove
public class Recurrences { //Implements the basic laws of positive exponents over the integers. Note: for this implementation, anything to the 0- power is 1. For example: 0^0 = 1.…
public class Recursion { public static void print(int[] array) { for(int i = 0;
public class Recursion { public static void print(int[] array) { for(int i = 0; i < array.length-1; i++) { System.out.print(array[i]+ "," ); } System.out.print(array[array.leng…
public class ReduceTheCode { //Each method must perform the same action as it cu
public class ReduceTheCode { //Each method must perform the same action as it currently does //You are free to change the way in which it does it //You can delete these comments a…
public class Reptile extends Animal { private String type; private String gender
public class Reptile extends Animal { private String type; private String gender; public String Reptile(String name, int age, String description, String gender, String ty…
public class Reverser { // Demonstrate a method that returns an array public sta
public class Reverser { // Demonstrate a method that returns an array public static int[] reverse(int[] a) { int[] newArray = new int[a.length]; for (int i = 0; i < a.length; i…
public class Robot { public Robot() { System.out.println(\"Tom Servo\"); } publi
public class Robot { public Robot() { System.out.println("Tom Servo"); } public Robot(String name) { System.out.println(name); } } public class Cyborg extends Robot { public Cybo…
public class Runner extends Athlete{ public Runner (String firstName, String las
public class Runner extends Athlete{ public Runner (String firstName, String lastName)( Super (firstName, lastNAme, "Running"); my Number ofRaces myMilesRaced 0; public void race …
public class SLList { private static class Node { private E data; private
public class SLList<E> { private static class Node<E> { private E data; private Node<E> next; public Node(E data, Node<E> next) { this.data = data; this.ne…
public class SavingAccount { private double annualInterestRate, balance, accumul
public class SavingAccount { private double annualInterestRate, balance, accumulativeInterest, accumulativeDeposits = 0, accumulativeWithdrawals = 0; public SavingAc…
public class SecondsCalcextends JFrame { private JPanel panel; // To reference a
public class SecondsCalcextends JFrame { private JPanel panel; // To reference apanel private JLabel messageLabel1; // To reference a labelfor days private JLabel messageLabel2;…
public class Secret { private int x; private static int y; public static int cou
public class Secret { private int x; private static int y; public static int count; public int z; public Secret() { x = 0; z = 1; …
public class Secret { private int x; private static int y; public static int cou
public class Secret { private int x; private static int y; public static int count; public int z; public Secret() { x = 0; z = 1; …
public class SelectionSorter { //Returns the index of the largest element in the
public class SelectionSorter { //Returns the index of the largest element in the arrayOfIntegers, beginning from the fromIndex. public static Integer[] selectSort(Integer[] incomi…
public class Shed{ private String owner; private int size; public Shed(String wh
public class Shed{ private String owner; private int size; public Shed(String who, int area){ owner = who; size = area; } public String getOwner(){return owner;} public int getSiz…
public class Sierpinski { // Height of an equilateral triangle whose sides are o
public class Sierpinski { // Height of an equilateral triangle whose sides are of the specified length. public static double height(double length) { double height = length * Math.…
public class SimpleClass { private int id; private String name; public SimpleCla
public class SimpleClass { private int id; private String name; public SimpleClass() { name = “”; id = 0; } public void setName(String name) { this.name = name; } } THE FOLLOWING …
public class SimpleStats { public static void main(String[] args) { StatCalc cal
public class SimpleStats { public static void main(String[] args) { StatCalc calc; calc = new StatCalc(); double item; System.out.println("Enter your numbers:"); System.out.…
public class SortArray { //Declaring instance variables private String s; //Decl
public class SortArray { //Declaring instance variables private String s; //Declaring static variable public static int[] sA; //Zero argumented constructor public SortArray() { } …
public class Sorting2 { public static void main(String[] args) { final int array
public class Sorting2 { public static void main(String[] args) { final int arrayAmount = 10; final int randomMax = 100; // create array int[] array = new int[10]; Random generator…
public class SortingProgram { public static void main(String[] args) { //Array U
public class SortingProgram { public static void main(String[] args) { //Array Used in Bubble sort: eArray //Array Used in Selection sort: sArray //Array Used in Insertion sort: i…
public class Square { public Point( float x, float y ); public float getX(); pub
public class Square { public Point( float x, float y ); public float getX(); public float getY(); public float distanceTo( Point p ); // returns the distance …
public class Stack { public int size; public int top; public int[] array; public
public class Stack { public int size; public int top; public int[] array; public Stack () { size = 0; top = -1; array = null; } public Stack (int _size) { size = _size; top = -1; …
public class StackProgram { public static void main(String[]args) { StackClass i
public class StackProgram { public static void main(String[]args) { StackClass inStack = new StackClass(50); StackClass tempStack = new StackClass(); try { intStack.push(new IntEl…
public class StackProgram { public static void main(String[]args) { StackClass i
public class StackProgram { public static void main(String[]args) { StackClass inStack = new StackClass(50); StackClass tempStack = new StackClass(); try { intStack.push(new IntEl…
public class Starfield extends JFrame implements KeyListener, Runnable { private
public class Starfield extends JFrame implements KeyListener, Runnable { private static String applicationPath; private BufferStrategy strategy; private int windowWidth, windowHei…
public class StateData implements Comparable { private String postalCode; privat
public class StateData implements Comparable { private String postalCode; private int population; private int electoralVotes; /** * Creates a new instance of StateData with the sp…
public class StringBag { // the array to hold the data private String [] bag; //
public class StringBag { // the array to hold the data private String [] bag; // the number of elements being held (also the next index where a new // String can be…
public class StringBag { // the array to hold the data private String [] bag; //
public class StringBag { // the array to hold the data private String [] bag; // the number of elements being held (also the next index where a new // String can be…
public class StringList {//an array that maintains a list of String objects//the
public class StringList {//an array that maintains a list of String objects//the default initial size of the array is 10 private String[] strings;//the number of valid String obje…
public class StringMethodsPracSol f /* returns the index of the first Roman Nume
public class StringMethodsPracSol f /* returns the index of the first Roman Numeral in c or -1 *if c contains no Roman Numerals public static int indexOfFirstRomanNumeral(String s…
public class StringNode { private char ch; private StringNode next; /** * Constr
public class StringNode { private char ch; private StringNode next; /** * Constructor */ public StringNode(char c, StringNode n) { ch = c; next = n; } /** * convert - converts a s…
public class StringNode { private char ch; private StringNode next; /** * Constr
public class StringNode { private char ch; private StringNode next; /** * Constructor */ public StringNode(char c, StringNode n) { ch = c; next = n; } public static int lastIndexO…
public class StringNode { private char ch; private StringNode next; /** * Constr
public class StringNode { private char ch; private StringNode next; /** * Constructor */ public StringNode(char c, StringNode n) { ch = c; next = n; } /** * convert - converts a s…
public class StringNode { private char ch; private StringNode next; /** * Constr
public class StringNode { private char ch; private StringNode next; /** * Constructor */ public StringNode(char c, StringNode n) { ch = c; next = n; } /** public static char large…
public class StringNode { private char ch; private StringNode next; /** * Constr
public class StringNode { private char ch; private StringNode next; /** * Constructor */ public StringNode(char c, StringNode n) { ch = c; …
public class StringNode { private char ch; private StringNode next; /** * Constr
public class StringNode { private char ch; private StringNode next; /** * Constructor */ public StringNode(char c, StringNode n) { ch = c; next = n; } /** * concat recursive metho…
public class StringNode { private char ch; private StringNode next; public Strin
public class StringNode { private char ch; private StringNode next; public StringNode ( char c, StringNode n) { ch = c; next = n; } Write int indexof( StringNode str, char ch) met…
public class Student implements comparable private String name private double gp
public class Student implements comparable private String name private double gpa-0 private int units- 0 publie Student (String name) tis. nane name ; public Student (String name,…
public class Student private Student next; private String name, id; public Stude
public class Student private Student next; private String name, id; public Student (String n, String i) name n: next-null: public void setNext (Student s) next = 3 ; | public Stud…
public class Student { String name; Student(String n) { name=n; } @Override publ
public class Student { String name; Student(String n) { name=n; } @Override public String toString() { return String.format("Name is "+name); } …
public class Student { private String lastName; private double gpa; public Stude
public class Student { private String lastName; private double gpa; public Student(String lName, double gpa) { this.gpa = gpa; lastName = lName; } public Student(Student other) { …
public class Student { private String name; private String year; private double
public class Student { private String name; private String year; private double gpa; // 1) Make a HashMap called history that maps String (course name) to Character (grade attaine…
public class Student { private int cin; private double gpa; public Student(int c
public class Student { private int cin; private double gpa; public Student(int cin, double gpa) { super(); this.cin = cin; this.gpa = gpa; } public String toString(){ return "Stud…
public class Student{ //constant public static int SLOW = 1; public static int M
public class Student{ //constant public static int SLOW = 1; public static int MEDIOCRE = 2; public static int BRIGHT = 3; public static int studentCount = 0; private String name;…
public class Student{ //constant public static int SLOW = 1; public static int M
public class Student{ //constant public static int SLOW = 1; public static int MEDIOCRE = 2; public static int BRIGHT = 3; public static int studentCount = 0; private String name;…
public class SubsetCopyArray { // TODO - write your code below this comment. //
public class SubsetCopyArray { // TODO - write your code below this comment. // You will need to write a method that copies only // a portion of the source array, given starting /…
Subject
Web development and programming
Use Browse or pick another subject.