Skip to content

Master #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/Java Programs.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assignment_Day_3/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions Assignment_Day_3/Assignment_Day_3.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Employeewage" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/LineComparison" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file modified Assignment_Day_3/Employeewage/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Assignment_Day_3/Employeewage/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Assignment_Day_3/Employeewage/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion Assignment_Day_3/Employeewage/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Assignment_Day_4/Assignment_Day_4.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Employeewage" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Snakeladder" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file modified Assignment_Day_5/.DS_Store
Binary file not shown.
Binary file modified Assignment_Day_5/out/.DS_Store
Binary file not shown.
Binary file modified Assignment_Day_5/out/production/.DS_Store
Binary file not shown.
Binary file added Assignment_Day_5/out/production/Array.class
Binary file not shown.
Binary file added Assignment_Day_5/out/production/Distance.class
Binary file not shown.
152 changes: 152 additions & 0 deletions Assignment_Day_5/src/Array.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import java.util.Scanner;





public class Array{



public static void main(String[] args) {



Scanner sc = new Scanner(System.in);



System.out.println("Enter the rows");

int n = sc.nextInt();

System.out.println("Enter the columns");

int m = sc.nextInt();

System.out.println("You are creating array of size: " + m +"x"+ n);

System.out.println("Cases for 2D Array ....");

System.out.println("1 ==>> Integer");

System.out.println("2 ==>> Double");

System.out.println("3 ==>> Boolean");

int Case = sc.nextInt();







switch(Case){

case 1:

System.out.println("For interger type array, please enter numbers for rows and columns");

int arr[][] = new int[n][m];

for(int i=0;i<n;i++){

for(int j=0;j<m;j++){

arr[i][j] = sc.nextInt();

}

}

for(int i=0;i<n;i++){

for(int j=0;j<m;j++){

System.out.print(" "+arr[i][j]);

}

System.out.println(" ");

}

case 2:

System.out.println("For double type array, please enter numbers for rows and columns");



double arrD[][] = new double[n][m];

for(int i=0;i<n;i++){

for(int j=0;j<m;j++){

arrD[i][j] = sc.nextInt();

}

}

for(int i=0;i<n;i++){

for(int j=0;j<m;j++){

System.out.print(" "+arrD[i][j]);

}

System.out.println(" ");

}



case 3:

System.out.println("For boolean type array, please enter values for rows and columns");



boolean arrB[][] = new boolean[n][m];

for(int i=0;i<n;i++){

for(int j=0;j<m;j++){

arrB[i][j] = sc.nextBoolean();

}

}

for(int i=0;i<n;i++){

for(int j=0;j<m;j++){

System.out.print(" "+arrB[i][j]);

}

System.out.println(" ");

}

default :

System.out.println("INVALID INPUT ");

}





}



}

36 changes: 36 additions & 0 deletions Assignment_Day_5/src/Distance.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import java.util.Scanner;
public class Distance {
public static void main(String[] args) {

int x1;
int x2;
int y1;
int y2;
double Dist;

Scanner sc=new Scanner(System.in);

System.out.println("enter x1 point");

x1=sc.nextInt();

System.out.println("enter y1 point");

y1=sc.nextInt();

System.out.println("enter x2 point");

x2=sc.nextInt();

System.out.println("enter y2 point");

y2=sc.nextInt();

Dist=Math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));

System.out.println("The distance between"+"("+x1+","+y1+"),"+"("+x2+","+y2+") is:"+Dist);


}

}
Binary file added Assignment_Day_5/src/Quadratic_Equation.class
Binary file not shown.
38 changes: 38 additions & 0 deletions Assignment_Day_5/src/Quadratic_Equation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import java.util.Scanner;

public class Quadratic_Equation {


// Function to find the roots of equation and print it

static void roots(int a, int b, int c) {
// calculating delta value
int delta = Math.abs(b * b - 4 * a * c);
double x1 = (-b + Math.pow(delta, 1 / 2)) / (2 * a);
double x2 = (-b - Math.pow(delta, 1 / 2)) / (2 * a);

System.out.println("Roots of the given equations are :");
System.out.println(x1);
System.out.println(x2);

}


//Main method to test the class

public static void main(String[] args) {
Scanner s = new Scanner(System.in);
try {
System.out.println("enter value for a ");
int a = s.nextInt();
System.out.println("enter value for b");
int b = s.nextInt();
System.out.println("enter value for c");
int c = s.nextInt();
roots(a, b, c);
} catch (Exception e) {
System.out.println("enter correct input");
}
s.close();
}
}
Binary file added Assignment_Day_5/src/Sum_Of_Three_Num.class
Binary file not shown.
Loading