- Engineering
- Computer Science
- exercise 3 implementing the student adt 15 pts in this...
Question: exercise 3 implementing the student adt 15 pts in this...
Question details
Exercise 3 Implementing the Student ADT (15 pts)
In this question, you will convert your student ADT into
Java.
To help you, we’ve provided a guide for the conversion from
pseudo-code to Java implementation. Use this as a
guide, and not a set of strict instructions. There are too many
variations that we cannot account for.
1. Copy your student design document into a java file called
StudentADT.java. Don’t change the original!
2. Convert everything in StudentADT.java to Java code. Keep your
“algorithm header” (i.e., pre-, post-conditions
and return criteria) in your file as comments.
Work one method at a time, and don’t rush. Spend time being sure
about syntax. This should take about
30-40 minutes, roughly.
Note: StudentADT.java does not have a main().
3. When you think you’re done, you can compile
StudentADT.java.
4. Correct all the errors! No matter how careful you are, you will
always have some. This might take about 20
minutes.
5. Make a copy of StudentADT.java called Student.java. Edit the
Student.java file:
(a) change the class header line from public class StudentADT into
public interface Student
(b) turn every method into a function prototype (a method header
line followed by a semi-colon without body
of the method).
2
(c) leave all algorithm documentation (as comments)!
6. Go back to StudentADT.java again to change the class header line
into
public class StudentADT implements Student
7. Put your name and student information in both files!
8. Check your files by compiling StudentADT.java again.
Solution by an expert tutor
