Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Main class for the following program:- import java.io.*; import java.util.Scanner; class studentDetails { public String name[][] = new String[10][10]; void getDetails(int n) { Scanner get

Main class for the following program:-

import java.io.*;

import java.util.Scanner;

class studentDetails {

public String name[][] = new String[10][10];

void getDetails(int n)

{

Scanner get = new Scanner(System.in);

int limit=n;

System.out.println("Enter "+limit+" Student Details ");

for(int i=0;i

{

System.out.println("Enter Student #"+(i+1)+" Login_ID, Password & 2 subjects name:");

for(int j=0;j<4;j++)

{

name[i][j] = get.nextLine();

}

}

display(limit);

}

void display(int limit)

{

System.out.println("Student Lgin Id"+"\t"+"Password"+"\t\t"+"Subject1"+"\t\t"+"Subject2");

for(int i=0;i

{

for(int j=0;j<4;j++)

{

System.out.print(name[i][j]+"\t\t");

}

System.out.println();

}

}

}

class collegeOffice {

public static void main(String args[]) throws IOException

{

Scanner in = new Scanner(System.in);

System.out.print("Enter Number of Students:");

int n = in.nextInt();

studentDetails std = new studentDetails();

std.getDetails(n);

PrintStream output = new PrintStream(new File("StudentDetails.txt"));

output.println("Student Lgin Id"+"\t"+"Password"+"\t\t"+"Subject1"+"\t\t"+"Subject2");

output.println("======================================");

for(int i=0;i

{

for(int j=0;j<4;j++)

{

output.print(std.name[i][j]+"\t\t");

}

output.println();

output.println("======================================");

}

output.close();

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions