r/javahelp • u/[deleted] • Aug 30 '18
Homework Creating class files
Hey, I'm a first year at uni doing a programming class and I'm having some trouble with some work. I have no idea what to do to be honest, I haven't learnt anything about coding and am just stuck. I understand how class's work as well as attributes and methods, I just don't know how to write the code itself. The work also comes with a prewritten class file and class marks, I don't know what to do with them either. Any help would be appreciated, I have linked below the link to pics of the work.
0
Upvotes
1
u/androgynyjoe Aug 30 '18
I guess I find it hard to believe that you haven't learned anything about coding. This seems like an assignment for Intro to Computer Science or something like that. I'm a bit curious how many days/weeks into the class you are and what you've done so far.
Nevertheless, it seems like you're being asked to create a class and some static methods. These are meant to be like functions; they input something and output something else. I would start by making a file called Marks.java which looks like this:
For example, the method that I called
maxshould input an array of integers (int[]) which I've calledsomeMarksand return anotherintwhich is the maximum value found insomeMarks.Of course, you say you were given a pre-written class "Marks" so maybe this much has already been done for you.