This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
public class RandomIntegerData { | |
public static void main(String [] args) throws IOException { | |
Scanner input = new Scanner(System.in); | |
Random randomnum = new Random(); | |
System.out.println("Enter highest value "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class mummy{ | |
double height, width; | |
int age; | |
String name; | |
public Mummy(){ | |
} | |
public double getHeight(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class myCircle{ | |
int rad = 1, x, y; | |
MyPoint center; | |
double area = null; | |
public MyCircle(int xVal, int yVal, int rad){ | |
rad = 1; | |
x = xVal; | |
y = yVal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.io.*; | |
public class majority { | |
public static void main(String [] args) { | |
Scanner input = new Scanner(System.in); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.io.*; | |
public class farthestPair { | |
public static void main(String [] args) { | |
Scanner input = new Scanner(System.in); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.io.*; | |
public class closestPair { | |
public static void main(String [] args) { | |
Scanner input = new Scanner(System.in); | |
int a = input.nextInt(); | |
int c = a-1; | |
Random num = new Random(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*3. Integer sort: Write a method integerSort that takes from standard input a | |
sequence of integers that are between 0 and 99 and prints the same | |
integers in sorted order on standard output. For example, presented with | |
the input sequence*/ | |
import java.io.*; | |
import java.util.Scanner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Modify the binarySearch method so that if the search key is not in the | |
array, it returns the largest index i for which a[i] is smaller than key (or -1 if | |
no such index exists).*/ | |
import java.io.*; | |
import java.util.Scanner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*1. Write a method dedup that reads strings from standard | |
input and prints them on standard output with all duplicates | |
removed (in sorted order).*/ | |
import java.io.*; | |
import java.util.Scanner; | |
public class dedup{ | |
public static void main(String[] args){ |