Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//year1.txt Colin Creevey 1 Gryffindor Ginny Weasley 1 Gryffindor //year2.txt Hermione Granger 2 Gryffindor Ronald Weasley 2 Gryffindor //year3.txt Katie Bell 3 Gryffindor //year4.txt Lee

//year1.txt

Colin Creevey 1 Gryffindor

Ginny Weasley 1 Gryffindor

//year2.txt

Hermione Granger 2 Gryffindor

Ronald Weasley 2 Gryffindor

//year3.txt

Katie Bell 3 Gryffindor

//year4.txt

Lee jordan 4 Gryffindor

This is the objective i was given and this is the ocde i came up with and the txt files as well posted above (year1-4.txt). This is my output when running.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Objectives: ArrayList File /O UML diagrams Task: Hogwarts is going digital...and they need your help! The school for witchcraft and wizardry needs a program to keep track of their enrollment and houses. If you're unfamiliar with Harry Potter, Hogwarts is the name of a school instructing young wizards and witches. The school has four "houses", and each student enrolled in the school belongs to one. (There's also a bit about sorting, but we'll assume everyone has a house already). Students are additionally identified by what year they are presently in new students are in their first year, and so on. Getting Started Your application will read in data from four text files: yearl.txt, year2.txt, year3.txt, and year4.txt. These can be downloaded as a zip file here-unzip it and place the four files in the top of your project in Eclipse To get you started, we've provided a test class, Lab2.java. Your final submission must include this class exactly as it appears here. The only permitted modification to this code is to add Javadoc comments as needed. Once your application is completed, running Lab2.java with the given data files will result in the exact output shown below. In addition to this class, you will also create School.java and Student.java. All three of these classes must be in the default package in your project. public class Lab2 public static void main String args School hogwarts- new School("Hogwarts school of Witchcraft& wizardry") hogwarts.importstudents("yearl.txt"); hogwarts.importstudents ("year2.txt" hogwarts.importstudents("year3.txt) hogwarts.importStudents( year4.txt) System.out.println hogwarts

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions