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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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