Skip to content

Commit

Permalink
Refactor the project CodeNerve#71
Browse files Browse the repository at this point in the history
Created maven modules for code that didnt have them.
  • Loading branch information
Chris authored and Chris committed Oct 22, 2020
1 parent 24feaa1 commit 056d1fb
Show file tree
Hide file tree
Showing 78 changed files with 441 additions and 205 deletions.
15 changes: 15 additions & 0 deletions BinaryTrees/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>LetUsJava</artifactId>
<groupId>com.let.us.java</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>BinaryTree</artifactId>


</project>
File renamed without changes.
15 changes: 15 additions & 0 deletions BubbleSort/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>LetUsJava</artifactId>
<groupId>com.let.us.java</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>BubbleSort</artifactId>


</project>
File renamed without changes.
15 changes: 15 additions & 0 deletions CodeQuotient2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>LetUsJava</artifactId>
<groupId>com.let.us.java</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>CodeQuotient2</artifactId>


</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

import java.util.Scanner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

class TimeSpan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;
import java.lang.Math;
class add1toeachDigit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class aggMarks {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.ArrayList;

class classRectangle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class cmpareReverse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class evenodd {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class factorial {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class hra {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
package codeQuotient;


import java.util.Scanner;
//Other imports go here// Do NOT change the class name
class kaperker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class leapYear {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class matrixMultiplication {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class max{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
package codeQuotient;


import java.util.Scanner;

public class maxElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class multiplication {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class primenum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class sumArray
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Scanner;

public class sumofn {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package codeQuotient;

import java.util.Arrays;
import java.util.Scanner;

Expand Down
15 changes: 15 additions & 0 deletions EuclieanDistance/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>LetUsJava</artifactId>
<groupId>com.let.us.java</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>EuclieanDistance</artifactId>


</project>
File renamed without changes.
15 changes: 15 additions & 0 deletions GuessTheMovieGame/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>LetUsJava</artifactId>
<groupId>com.let.us.java</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>GuessTheMovieGame</artifactId>


</project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class Movie {
public int length;

public Movie(){
File movieList = new File("movies.txt");
File movieList = new File("src/main/movies.txt");
try {
Scanner s = new Scanner(movieList);
int totalMovies = 0;
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions GuessingNumberGame/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>LetUsJava</artifactId>
<groupId>com.let.us.java</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>GuessingNumberGame</artifactId>


</project>
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
import java.util.*;
import java.util.*;
public class Guessing_Game_Human_vs_CPU
{
public static int computerGuess(int lower,int upper,int randnum,int count)
{
int guess=(lower+upper)/2;
if(guess==randnum)
return count;

if(guess<randnum){
count++;
return computerGuess(guess,upper,randnum,count);
}

if(guess>randnum){
count++;
return computerGuess(lower,guess,randnum,count);
}
return -1;
}

public static void main(String[] args)
{
final Scanner sc=new Scanner(System.in);
char ch='Y';
//the game resets if select Y else exits
while(ch=='Y')
{
//Generating a random integer number Between 1 to 100
int randnum=(int)(Math.random()*100+1);
//Math.random gives adouble between 0 and 1 so multiply by 100 so gives between 0 to 99 and 1 for 0 to 100

int chances=10;
while(chances>0) //while attempts are less than 10
{
System.out.print("Guesss A Number between 1 to 100:");
int guess=sc.nextInt();
//input the guessed Number

if(guess==randnum){
System.out.println("Congrats you guessed the number !!\n");
break;
}
else if(guess>randnum){
System.out.println("Your guess is higher than the number.\n");
}
else{
System.out.println("Your guess is lower than the number.\n");
}

chances--;
}

if(chances!=0){
System.out.println("\nYou guessed the Number in "+(10-chances)+" attempts.");
System.out.println("You scored "+(chances*10)+" points.");
}
else{
System.out.println("\nYou were not able to guess the number in 10 attempts.\n Better Luck next Time");
System.out.println("You scored 0 points.");
}
int steps=computerGuess(0,100,randnum,0);
System.out.println("\nComputer solved it in "+steps+" attempts.");

if((10-chances)<steps)
System.out.println("\nYou Beat the Computer");
else
System.out.println("\nYou Lost to the Computer");

//check if want to continue the game or exit
System.out.println("\nDo You want to TRY AGAIN:(Y-YES/N-NO)");
ch=sc.next().charAt(0);
}
System.out.println("\nThank you Playing!!");
}
}
import java.util.*;
import java.util.*;
public class Guessing_Game_Human_vs_CPU
{
public static int computerGuess(int lower,int upper,int randnum,int count)
{
int guess=(lower+upper)/2;
if(guess==randnum)
return count;

if(guess<randnum){
count++;
return computerGuess(guess,upper,randnum,count);
}

if(guess>randnum){
count++;
return computerGuess(lower,guess,randnum,count);
}
return -1;
}

public static void main(String[] args)
{
final Scanner sc=new Scanner(System.in);
char ch='Y';
//the game resets if select Y else exits
while(ch=='Y')
{
//Generating a random integer number Between 1 to 100
int randnum=(int)(Math.random()*100+1);
//Math.random gives adouble between 0 and 1 so multiply by 100 so gives between 0 to 99 and 1 for 0 to 100

int chances=10;
while(chances>0) //while attempts are less than 10
{
System.out.print("Guesss A Number between 1 to 100:");
int guess=sc.nextInt();
//input the guessed Number

if(guess==randnum){
System.out.println("Congrats you guessed the number !!\n");
break;
}
else if(guess>randnum){
System.out.println("Your guess is higher than the number.\n");
}
else{
System.out.println("Your guess is lower than the number.\n");
}

chances--;
}

if(chances!=0){
System.out.println("\nYou guessed the Number in "+(10-chances)+" attempts.");
System.out.println("You scored "+(chances*10)+" points.");
}
else{
System.out.println("\nYou were not able to guess the number in 10 attempts.\n Better Luck next Time");
System.out.println("You scored 0 points.");
}
int steps=computerGuess(0,100,randnum,0);
System.out.println("\nComputer solved it in "+steps+" attempts.");

if((10-chances)<steps)
System.out.println("\nYou Beat the Computer");
else
System.out.println("\nYou Lost to the Computer");

//check if want to continue the game or exit
System.out.println("\nDo You want to TRY AGAIN:(Y-YES/N-NO)");
ch=sc.next().charAt(0);
}
System.out.println("\nThank you Playing!!");
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#BlueJ class context
comment0.params=lower\ upper\ randnum\ count
comment0.target=int\ computerGuess(int,\ int,\ int,\ int)
comment1.params=args
comment1.target=void\ main(java.lang.String[])
numComments=2
#BlueJ class context
comment0.params=lower\ upper\ randnum\ count
comment0.target=int\ computerGuess(int,\ int,\ int,\ int)
comment1.params=args
comment1.target=void\ main(java.lang.String[])
numComments=2
Loading

0 comments on commit 056d1fb

Please sign in to comment.