Skip to content

Commit 3532342

Browse files
committed
first push and modified readme.md
1 parent 6650335 commit 3532342

File tree

251 files changed

+4076
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+4076
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
11
# NPTEL-Programming-in-Java
2-
I am sharing my journey of studying a course named Programming in Java taught by Debasis Samantha IIT Kanpur
2+
### This Repository has the ultimate guide to crack the exam of Programming in Java Course taught by Debasis Samantha Sir from I.I.T(Indian Institute of Technology) Kanpur
3+
### This will help you practice Java from basics to advanced.
4+
### I am working on this since a week and I am sharing all my codes I did during preparation of Exam and my learning process.
5+
6+
# You need to understand these concepts first before solving assignments weekwise:
7+
## Week 1 => Basic Concepts.
8+
## Week 2 => Methods, Functions and Encapsulation.
9+
## Week 3 => Access Specifiers, Static scope, Info Hiding.
10+
## Week 4 => Packages and Interfaces(Basics).
11+
## Week 5 => Interfaces Advanced and Basics of Exception Handling.
12+
## Week 6 => Multithreading and IOStream.
13+
## Week 7 => IOStream advanced usage and Applet Programming(basics).
14+
## Week 8 => Applet Programming advance concepts and Abstract Window Toolkit(AWT).
15+
## Week 9 => Swing Programming and Abstract Window Toolkit(AWT).
16+
## Week 10 => Networking with Java and Java DataBase Connectivity(JDBC).
17+
## Week 11 => Java DataBase Connectivity(JDBC) in detail.
18+
## Week 12 => Case Studies.
19+
20+
# How to use this Repository?
21+
### This Repository is for Reference.
22+
### This Repository has all the solutions of NPTEL Weekly Assignments in "Week(Number)Assignment(Number)".JAVA File in Week(Number) folders respectively.
23+
### The top most comment is the problem statement to understand the problem and code together.
24+
### Explanation of code has been done through comments wherever neccessary.
25+
26+
# Tips for Assignment and Exam :-
27+
### - Every assignment has testcase so your code must need to pass all the testcases to get marks in assignment.
28+
### - Dont Write customized print statements because showing your creativity will simply mark zero. I got Zero not because output was wrong but wrote long print statements before outputs
29+
### - Prepare basics well before going into Exam.
30+
31+
### Thanks and All the Best working with Java.
32+
### Om Patel

SET 1 Unproctored Exam/A.class

368 Bytes
Binary file not shown.
1.02 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#BlueJ class context
2+
comment0.target=Set1_Q1
3+
comment1.params=args
4+
comment1.target=void\ main(java.lang.String[])
5+
numComments=2
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*Complete the following program that is intended to find and print the minimum value stored in an array 'arr[]'.
2+
3+
Note: Integer array 'arr[]' is already defined and initialized*/
4+
5+
import java.util.Scanner;
6+
public class Set1_Q1{
7+
public static void main(String args[]){
8+
int arr[] = new int[20];
9+
10+
// Array initialization is hidden
11+
12+
13+
int x[]= {8,5,9,45,3,7,10,65,4,9,33,12,6,76};
14+
int y[]= {324,545,56,78,98,34,22,13};
15+
Scanner sc = new Scanner(System.in);
16+
if(sc.nextInt()==1){
17+
arr = x;
18+
}else{
19+
arr = y;
20+
}
21+
int min = arr[0]; //declaring minimum value as first element of array
22+
for(int i=0;i<arr.length;i++){
23+
24+
if(arr[i]<min) //condition to find and update the minimum value
25+
min=arr[i];
26+
}
27+
System.out.print(min); //printing the final minimum value
28+
29+
}
30+
31+
}
1.07 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#BlueJ class context
2+
comment0.target=Set1_Q2
3+
comment1.params=args
4+
comment1.target=void\ main(java.lang.String[])
5+
numComments=2
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*In the following program, an array of type integer (arr[]) is declared. The array can store any integer value. Complete the program to print the average value of all the odd numbers stored in the array (arr[] ).
2+
Note: Integer type array 'arr[]' is already defined and initialized. Use double type variables wherever applicable.*/
3+
4+
import java.util.Scanner;
5+
public class Set1_Q2{
6+
public static void main(String args[]){
7+
8+
int arr[] = new int[6];
9+
10+
// Array initialization is hidden
11+
12+
int x[] = {4,9,33,18,0,76};
13+
int y[] = {45,0,7,324,545,57};
14+
Scanner sc = new Scanner(System.in);
15+
if(sc.nextInt()==1){
16+
arr = x;
17+
}else{
18+
arr = y;
19+
}
20+
21+
//Use for or while loop do the operation.
22+
Scanner in =new Scanner(System.in);
23+
double sum=0,oddcount=0; //declaring counter and sum variables
24+
for(int i=0; i<arr.length;i++){ //to check odd number and calculating sum
25+
if(arr[i] % 2 !=0){
26+
sum = sum + arr[i];
27+
oddcount++; //counting no. of odd numbers
28+
}
29+
else
30+
continue;
31+
}
32+
double result = sum/oddcount; //calculating average value
33+
System.out.print(result); //printing average value
34+
35+
}
36+
}
769 Bytes
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#BlueJ class context
2+
comment0.target=Set1_Q3
3+
comment1.params=i
4+
comment1.target=int\ findSquare(int)
5+
comment2.params=args
6+
comment2.target=void\ main(java.lang.String[])
7+
numComments=3

0 commit comments

Comments
 (0)