Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i want the code in c++ using visual stadio program plz Create a text file. Use j

ID: 3576529 • Letter: I

Question

i want the code in c++ using visual stadio program plz

Create a text file.

Use java.io File to input information on 10 students into a text file.

student ID, First Name, Last Name, DOB, and address.

Create a header row for your student information.

Attach Snipping photo source code and file containing student information. (See attached text file photo below.)

outputfile -Notepad File Edit Format View Help student ID# First Name 123 Tim 150 Diablo 999 Tom Buffy 100 25 LeRoy 849 Bruce 123 Tom 123 Dick 150 Harry 643 Jane Last Name Smith Ho Doe Slayer Jackson Lee Smith Smith HO Doe DOB 19960215 19900420 19860215 19960314 20001114 19560215 19890130 19880615 19870420 19860210 Address 777 Heavens Way 666 Hells Gate 999 Nevermind 456 Seven 123 Right Here Alley 333 Enter the Dragon Zero 836 Pick Up Sticks 577 Eleven 888 Haight

Explanation / Answer

Hi Friend, as you have mentioned to use java.io.File, so I have implemented in JAVA.

Please find my code.

Let me know in case of any issue.

import java.io.BufferedReader;

import java.io.BufferedWriter;

import java.io.File;

import java.io.FileWriter;

import java.io.IOException;

import java.io.InputStreamReader;

import java.util.Scanner;

public class StudentRead {

  

   private static String getString()throws IOException

   {

       InputStreamReader isr = new InputStreamReader(System.in);

       BufferedReader br = new BufferedReader(isr);

       String s = br.readLine();

       return s;

   }

  

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

      

       Scanner sc = new Scanner(System.in);

       System.out.print("Enter output file name: ");

       String fileName = sc.next();

      

       // opening file

       File file = new File(fileName);

       FileWriter fw = new FileWriter(file);

       BufferedWriter bw = new BufferedWriter(fw);

      

       // writing header

       bw.write("Student ID# First Name Last Name DOB Address");

       bw.newLine();

      

       // reading student information and writing into file

       int i= 0;

       while(i < 10){

           System.out.println(" Enter #"+(i+1)+" student information: ");

           System.out.print("ID#: ");

           String studentId = getString();

           System.out.print("First Name: ");

           String firstName = getString();

           System.out.print("Last Name: ");

           String lastName = getString();

           System.out.print("DOB: ");

           String dob = getString();

           System.out.print("Address: ");

           String address = getString();

          

           // writing all these information in file

           bw.write(studentId+" "+firstName+" "+lastName+" "+dob+" "+address);

           bw.newLine();

          

           i++;

       }

      

       bw.close();

       fw.close();

      

       System.out.println("File written successfully");

   }

}

/*

Sample run for 2 student:

Enter output file name: info.txt

Enter #1 student information:

ID#: 123

First Name: Pravesh

Last Name: Kumar

DOB: 19921211

Address: Bangalore 560037

Enter #2 student information:

ID#: 432

First Name: Alex

Last Name: Bob

DOB: 19940123

Address: San Fransico 234

File written successfully

*/