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
//Convertanupper-caselettertoalowercaseletterandreturnthelower | |
//case letter. (Hint: Check first to be sure that it is not lower case already.) | |
import java.util.Scanner; | |
public class dacase { | |
public static void main(String[]args){ | |
Scanner input = new Scanner(System.in); | |
char a = input.nextln(); | |
char b = a.charAt(0); |
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; | |
public class rowscols { | |
public static void main (String [] args) { | |
Scanner input = new Scanner(System.in); | |
int para1 = input.nextInt(); | |
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 searchAndDestroy { | |
public static void main(String[] args) throws IOException{ | |
Scanner input = new Scanner(System.in); | |
//Establish array length |
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){ |
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
/*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
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
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 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
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; |