Programming intern at the alumni relations office

Assignment Help JAVA Programming
Reference no: EM131589043

Project

You are a programming intern at the alumni relations office. Having heard you are taking data structures, your boss has come to ask for your help with a task.

Quite often she needs to process files containing records for students attending UC schools and find those who are SMC alumni. She needs you to write a program that takes in a file containing UC student records and another file containing SMC alumni records and writes out to a file all the SMC alumni who are attending UC schools, ordered by ID.
This sounds like a very simple task and you agree to work on it. She warns you that the files are pretty large - a few hundred thousand student records. You inform her that with today's computers having processors of a few GHz this task is a piece of cake and can be computed in an instant.

Part 1:
You think about the problem for a minute and you come up with a plan.
- You will create a Student class representing student records. It will have three data members corresponding to the data contained in the student records file
int id; String name; String school;
- You will have no setters or getters in your Student class and the data members will be private.
- You will override the equals method to consider two student objects as equal if they have the same ID. - You will implement the comparable interface to allow sorting of student objects by ID.
- You will override the toString method to print the fields as they appear in the student records file.
The idea is that for every record you read from the file, you will create a Student object. You will store the UC students into a student array and the SMC alumni into another student array. Parts 2 and 3 operate on these arrays.

Part 2:
Now that you have two arrays with one containing UC students and the other containing SMC
alumni, you plan to process the arrays and find the students who belong to both arrays. Your data structures are these two arrays. Your algorithm will be: for each student in the UC students array you try to find it in the SMC students array by doing a linear search on the SMC students array (comparing for equality). If you do find it, that UC student is then stored in an array containing students who are SMC alumni attending UC schools. Once you have the array of the common students, it is sorted by ID and printed to a file. We will use the Java library sort for this (already done for you in main()).

Part 3:
After running your program from Part 2 and discovering that it takes ~ 5 - 10 minutes to
complete for the given input (much longer for larger files), you decide to really think about the problem in order to find a solution that does not force your boss to go get a cup of coffee every time she needs to run your program. It seems even those powerful processors in today's computers can't really save a bad algorithm.
You remember from class that binary search is much more efficient than linear search for finding an element in an array and decide to try it out. We will use the Java library binary search for this. Your algorithm will be: for each student in the UC array you will binary search the sorted SMC array. If the binary search finds the student, that UC student is stored in an array containing students who are SMC alumni attending UC schools. Once you have the array of the common students, it is sorted by ID and printed to a file. We will use the Java library sort for this (already done for you in main()).

Hints:
- It is always a good idea to test each little piece after you complete it. Trying to debug a whole
program is hard and very time consuming.
- First implement the Student class. Do not do anything else until you are sure your Student
class is 100% functional. Create student objects in a toy main() and call toString on them, exercise the equals and compareTo methods and verify that your class is implemented correctly.
- Whenever you work with a large data set it is much easier to first work on a small data set to ensure your program functions correctly. Once you are confident that it produces the correct result you can move to the larger data sets. To help get you started, two small sample input files and the expected output have been provided. Do not move on to the large files until you are very sure your program is correct.
Deliverables:
Since this is our first real project, the design and most of the work has been done for you. You
should implement the Student class and FILL OUT THE MISSING CODE in the provided program. DO NOT CHANGE THE REST OF THE GIVEN CODE.
You should submit a zip file named project2_first_last.zip (where first and last are your first and last name) containing ONLY the files below.
Student.java Project2.java report.txt
: a text (not Word, Power Point, ...) file containing ONLY:
a) A 1 to 5 lines paragraph from you saying "I have tested this program and there are no known issues." if you believe that to be the case, or a brief description of known issues in case your program has known problems or you could not fully implement it. b) The timing printouts and the first and last 3 students in the file that the program generated (6 students in total, copied and pasted here).

Reference no: EM131589043

Questions Cloud

Preliminary theory-interorganizational network effectiveness : Write 150 word about the attachment. What is the Chapter-A Preliminary Theory of Interorganizational Network Effectiveness? What did you think was interesting?
Develop an argument about what makes that character : Write an essay of 1000-1500 words in which you make and develop an argument about what makes that character either an epic hero, tragic hero, or trickster.
Discuss cholesterol diet play in the development of cancer : Cancer is considered by many a primarily genetic disease. However,what role does a lifestyle choice, such as smoking or a high cholesterol diet
Prepare a statement of cash flows for the year ended : A comparative balance sheet for Joseph Corporation is presented below: Prepare a statement of cash flows for the year ended 2005, using the indirect method
Programming intern at the alumni relations office : Create a Student class representing student records. It will have three data members corresponding to the data contained in the student records file
Transaction costs in economy : Explain how the use of money as a unit of account can help reduce transaction costs in this economy.
Explain the importance of situating a societys cultural : Evaluate how successful the author was in convincing you to accept the validity of the "surprise ending" that was different from what you expected.
Explain two major political risks of operating a business : From the e-Activity, analyze two major political risks of operating a business within the selected emerging country.
Economies from population growth : What are the important factors distinguishing these two economies from population growth, human capital, political systems etc. What the future holds?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a class named date that stores date values

Create a class named Date that stores date values

  The new class has the attributes of: name - type string age

Here is my current assignment I got the cat file to work I'm just having trouble with the driver file. You must create two Java files called LastNameFirstNameUnit6Prog.java, and Cat.java. Ensure you include ALL files required to make your program com..

  Complex canvas drawing and animation techniques

Create a webpage using HTML5 and one of the complex canvas drawing and animation techniques listed in the video: patterns, gradients, clipping paths, or images

  Program that prompts the user to enter the year and display

Write a program that prompts the user to enter the the year and first day of the year and displays the calendar table for the year on the console. For example , if the user entered the year 2013, and 2 for tuesday, January 1, 2013, your program shoul..

  Describe addition continuation toward the android app

Have been working on it, just need some addition continuation toward the app, you will continue the app from the main file attached.

  Write a java program to practice the use of java file i/o.

Write a Java program to practice the use of Java file I/O. Class methods are needed to break up solution in smaller parts.Program will read several series of heart rates from a file, compute min, max, & fitness quotient for each series, and output ..

  Write an applet that includes a pie chart

Write an applet that includes a pie chart. Use a news article with statistics that are good candidates for a pie chart: for example, political candidate preferences; percentages of those for, against, or undecided about a ballot measure; and so for..

  Document the current application describing major classes

Add to the Project Management tool the different planned activities needed to implement the changes to the solution and document the current application describing the major classes used by the application.

  Write a program to manage a book catalog

CSC 143 PROGRAMMING - Write a program to manage a Book Catalog. The catalog would contain a collection of books, with following fields of informatio

  Develop a menu driven console java program

Develop a Menu Driven Console Java Program to demonstrate you can use Java constructs including input/output via GUI dialogs, Java primitive and built-in types, Java defined objects, arrays, selection and looping statements and various other Java ..

  Creating a banking program

creating a banking program. You will again be working on a team with me to build this program.

  Method definition to count and then return the number

Write a nested loop structure that prints out the following number series: 111 112 121 122 211 212 221 222. The innermost loop may have only one print statement and no literal string output except a space (" ").

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd