Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a File that reads student information( one student per line) name the file Roster.txt , has to count the number of students with a

Create a File that reads student information( one student per line) name the file Roster.txt , has to count the number of students with a specific last name. image text in transcribed
image text in transcribed
Fle Edit Fermat View Help " This progr am reads student inf orsation from a file Cone student per, line) e named as roster.txt, counts the number of students with a specific last and writes the student's infornat fon into another file naned as roster-new. Ext :Date: 4/3/2018 package chapters import java. io. sport java.uti. ," publicssainistudert singstring txt2rgs) { public class inputFleroster.txt string string out putrilesane -roster-new, txt "; tryt findstudent (Cinputrile, outputr ilesane catch(FilenotFoundExcept ion ex System, out.print Incex.getmessageO): public static void findstudent (string 1 // create a scanner for the f scanner input - new scanner (new FileCinpute stenane)) // create a printwriter for the out put file intwriter out put new Pr intriter (outputsflesame) create a Scanner for user input scanner scanner- new Scanner (System. in): // Receive user Input en out.print Inc Enter the student's Tast nane: tu aStNane int r-0 runst duents string stuinfo /Lcepeatedly find and save students Into the new file if (stuinfo. contains(stuastsane))

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

Step: 3

blur-text-image

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

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

What are special assessments? How do governments account for them?

Answered: 1 week ago

Question

4. Support and enliven your speech with effective research

Answered: 1 week ago

Question

3. Choose an appropriate topic and develop it

Answered: 1 week ago