can someone help me or teach whats wrong with my code please badly needed this night

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

can someone help me or teach whats wrong with my code please badly needed this night

JC Console - JCreator
: File
Edit
View
Project
Build
Run
Tools
Configure
Window
Help
File View
무 x
Console.java
F Workspace Console': 1 Project
É-E Console
public String strToFile ()
+-O src
{
return (name + "," + phone);
public String toString ()
{
return ("Name: "+ getName () + ", Phone:" + getPhone () ) ;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class PhoneBook{
private ArrayList<Person> people;
public PhoneBook ()
{
this.person = new ArrayList<> ();
}
public void readFile (String filename)
Package View
B-E Console
-O Package Default
{
Scanner fileReader;
try
{
fileReader = new Scanner (new File (filename)):
while (fileReader.hasNextLine ())
{
String [] data = fileReader.nextLine ().trim (). split (",");
String name - data[01;
Build Output
Task View
import java.io. PrintWriter;
Build Report
C:\Users\User\Documents\JCreator LE\MyProjects\Console\src\Console.java:39: error: class, interface, enum
Message
Folder
Location
import java.util.ArrayList;
O Resource: Console.java
error: class, interface, enum, or record expected
C:\Users\User\Documents\JCreator LE\MyPro.. line 34
C:\Users\User\Documents\JCreator LE\MyProjects\Console\src\Console.java:40: error: class, interface, enum
import java.util.Scanner;
error: class, interface, enum, or record expected
C:\Users\User\Documents\JCreator LE\MyPro. line 35
error: class, interface, enum, or record expected
C:\Users\User\Documents\JCreator LE\MyPro.. line 36
C:\Users\User\Documents\JCreator LE\MyProjects\Console\src\Console.java:204: error: class, interface, enu
error: class, interface, enum, or record expected
C:\Users\User\Documents\JCreator LE\MyPro.. line 37
import java.util.Scanner;
error: class, interface, enum, or record expected
C:\Users\User\Documents\JCreator LE\MyPro. line 38
8 errorS
error: class, interface, enum, or record expected
C:\Users\User\Documents\JCreator LEVMyPro. line 39
error: class, interface, enum, or record expected
C:\Users\User\Documents\JCreator LEVMyPro. line 40
C:\Users\User\Documents\JCreator LE\MyPro. line 204
Process completed.
error: class, interface, enum, or record expected
Transcribed Image Text:JC Console - JCreator : File Edit View Project Build Run Tools Configure Window Help File View 무 x Console.java F Workspace Console': 1 Project É-E Console public String strToFile () +-O src { return (name + "," + phone); public String toString () { return ("Name: "+ getName () + ", Phone:" + getPhone () ) ; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Scanner; public class PhoneBook{ private ArrayList<Person> people; public PhoneBook () { this.person = new ArrayList<> (); } public void readFile (String filename) Package View B-E Console -O Package Default { Scanner fileReader; try { fileReader = new Scanner (new File (filename)): while (fileReader.hasNextLine ()) { String [] data = fileReader.nextLine ().trim (). split (","); String name - data[01; Build Output Task View import java.io. PrintWriter; Build Report C:\Users\User\Documents\JCreator LE\MyProjects\Console\src\Console.java:39: error: class, interface, enum Message Folder Location import java.util.ArrayList; O Resource: Console.java error: class, interface, enum, or record expected C:\Users\User\Documents\JCreator LE\MyPro.. line 34 C:\Users\User\Documents\JCreator LE\MyProjects\Console\src\Console.java:40: error: class, interface, enum import java.util.Scanner; error: class, interface, enum, or record expected C:\Users\User\Documents\JCreator LE\MyPro. line 35 error: class, interface, enum, or record expected C:\Users\User\Documents\JCreator LE\MyPro.. line 36 C:\Users\User\Documents\JCreator LE\MyProjects\Console\src\Console.java:204: error: class, interface, enu error: class, interface, enum, or record expected C:\Users\User\Documents\JCreator LE\MyPro.. line 37 import java.util.Scanner; error: class, interface, enum, or record expected C:\Users\User\Documents\JCreator LE\MyPro. line 38 8 errorS error: class, interface, enum, or record expected C:\Users\User\Documents\JCreator LEVMyPro. line 39 error: class, interface, enum, or record expected C:\Users\User\Documents\JCreator LEVMyPro. line 40 C:\Users\User\Documents\JCreator LE\MyPro. line 204 Process completed. error: class, interface, enum, or record expected
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Software products
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education