Skip to content

Commit 77151aa

Browse files
committed
Migrate development environment from Windows to macOS and continue project updates
- Shifted primary development environment from Windows to macOS to ensure better performance, stability, and streamlined workflow for Java development. - Removed OS-specific metadata and ensured platform-agnostic project compatibility. - Normalized line endings to LF for cross-platform consistency. - Verified and adjusted file paths, permissions, and encoding settings to suit macOS environment. - Cleaned up unnecessary Windows-generated files and updated Git configuration accordingly. - Future commits and development will now be managed entirely from macOS. This migration ensures a cleaner, more consistent setup moving forward and prepares the project for scalable development across Unix-based systems. Future development will continue on macOS for a smoother, Unix-based experience. Signed-off-by: Someshdiwan <[email protected]>
1 parent 5d2c3fa commit 77151aa

File tree

2 files changed

+49
-20
lines changed

2 files changed

+49
-20
lines changed
Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,37 @@
11
import java.util.Scanner;
22

3-
class LoopsPractice
4-
{
5-
public static void main(String[] args)
6-
{
3+
class LoopsPractice {
4+
public static void main(String[] args) {
75
Scanner sc = new Scanner(System.in);
8-
int n, s, x=0, pos=0;
6+
int n, s, x = 0, pos = 0;
97
System.out.println("Enter size of an array");
108
n = sc.nextInt();
11-
int [] A = new int[n];
9+
int[] A = new int[n];
1210
System.out.println("Enter Array elements:");
1311

14-
for(int i = 0; i<A.length; i++)
15-
{
12+
for (int i = 0; i < A.length; i++) {
1613
A[i] = sc.nextInt();
1714
}
1815
System.out.println("Array elements are: ");
1916

20-
for(int i = 0; i<A.length; i++)
21-
{
17+
for (int i = 0; i < A.length; i++) {
2218
System.out.println(A[i]);
2319
}
2420

2521
System.out.println("Enter element to search: ");
2622
s = sc.nextInt();
2723

28-
for(int i = 0; i<A.length; i++)
29-
{
30-
if(A[i] == s)
31-
{
24+
for (int i = 0; i < A.length; i++) {
25+
if (A[i] == s) {
3226
x = 1;
3327
pos = i;
3428
break;
3529
}
3630
}
37-
if(x == 0)
38-
{
31+
if (x == 0) {
3932
System.out.println("not found");
40-
}
41-
else
42-
{
43-
System.out.println("Found at "+pos);
33+
} else {
34+
System.out.println("Found at " + pos);
4435
}
4536
}
4637
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import java.util.Scanner;
2+
3+
class StudentInfo {
4+
public static void main(String[] args) {
5+
Student s1 = new Student();
6+
Student s2 = new Student();
7+
8+
s1.getData();
9+
s2.getData();
10+
11+
s1.showData();
12+
s2.showData();
13+
}
14+
}
15+
16+
class Student {
17+
int roll_no;
18+
String name;
19+
double per;
20+
21+
void getData() {
22+
Scanner sc = new Scanner(System.in);
23+
System.out.println("Enter details of student:");
24+
System.out.print("Roll No: ");
25+
roll_no = sc.nextInt();
26+
27+
System.out.print("Name: ");
28+
name = sc.next();
29+
30+
System.out.print("Percentage: ");
31+
per = sc.nextDouble();
32+
}
33+
34+
void showData() {
35+
System.out.println("Details are:");
36+
System.out.println("Roll No: " + roll_no + ", Name: " + name + ", Percentage: " + per);
37+
}
38+
}

0 commit comments

Comments
 (0)