OOP Assig-2.2
OOP Assig-2.2
ASSIGNMENT -2
Name:Shiffra RollNo:1602-23-737-146
>First taking the necessary details like rollnumber name and the marks
of atleast 10 students into a .csv file from the user
//this code creates a csv file by taking the input data from user
package MypackageCSV;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Scanner;
}
else{
int n=Integer.parseInt(args[0]);
if(n<10){
System.out.println("Atleast 10 students are requried");
}
else{
try(BufferedWriter bw = new BufferedWriter(new FileWriter(fl))){ ;
bw.write("Roll
No.,Name,Subject1,Subject2,Subject3,Subject4,Subject5,Subject6,Subject7\n");
System.out.print("Name: ");
String name=sc.nextLine();
}
}
}
}
}
class Student {
private int rn;
private String name;
private int[] marks;
br.close();
}
}
The reason why I chose List is because the insertion or finding
any detail , accessing the values of a list collection is earlier
and simple than linkedlist and maps is mostly used for random
access of details