1

I am in a programming class that has provided me with a project but I have no idea where to start and was hoping someone could push me in the right direction. I am only posting part of the project so that someone can show me a bit of the code to get an idea of how its done as I have taken a programming class before but I am out of practice.

Create an application called Registrar that has the following classes:

A Student class that minimally stores the following data fields for a student:

  • Name
  • Student id number
  • Number of credits

The following methods should also be provided:

  • A constructor that initializes the name and id fields
  • A method that returns the student name field
  • Methods to set and retrieve the total number of credits

I have removed most of the question as I am not trying to get the full answer but to just get this little sample to try to get going on the rest of the project. I am also having trouble with the 2nd part as to how I can create names and ID's on a second program and retrieve them into the first program with the classes.

5
  • 5
    You can start by reading a introductory programming book. Nobody is going to do your homework for you. Commented Sep 19, 2014 at 0:53
  • 1
    Classes and Objects might help Commented Sep 19, 2014 at 0:53
  • These are very basic things in programming and it seems like you don't understand them at all, we aren't here to do your homework but at what level do you understand programming? I may be able to tailor an answer if I can understand what level you are at. Commented Sep 19, 2014 at 0:54
  • That is why I am not putting the whole project up there I am trying to find out where to start as I am reading the book but am really lost in where to start. Commented Sep 19, 2014 at 0:54
  • I was just hoping someone would be able to provide a helpful solution or perhaps send me to a site that could help me learn about what the project is asking me to do which is why I stated clearly I dont want my project done for me but rather I want to learn how its done and not just scolded that Im having my homework done for me Commented Sep 19, 2014 at 0:57

2 Answers 2

3

Here is a bit of an translation for what you need to do, the words in bold are keywords that, when googled, will most likely return information relevant to what you are doing.

A Student class that minimally stores the following data fields for a student:

This basically means to create a class which has the following properties:

• Name • Student id number • Number of credits

Think hard about what types of data those would be? What type do you need to create to store somebody's name? Or their Id? Remember, these are all properties

A constructor that initializes the name and id fields

Google constructor and learn all about how they work, pay special attention when a learning source discusses how to initialize properties inside of the constructor.

A method that returns the student name field

Research about methods and how you can create one to return your property Student Name. Learn how you will actually use this method.

Methods to set and retrieve the total number of credits

Research Getters and Setters and understand how they interact with a classes properties

Best of luck buddy, google is your best friend/lover in programming..

Sign up to request clarification or add additional context in comments.

2 Comments

Is there a way I can email your or PM you to be able to ask you if I am doing this correctly? My classes are running and I was able to have it print all but not sure if its to the specifications that my project requires.
Thanks Emailed you, hopefully it was not flagged and sent to spam
-1
public class Student {

private String name;
private String id;
private int numOfCredits;

public Student(String name, String id) {
    this.name = name;
    this.id = id;
}

public String getName() {
    return name;
}

public int getNumOfCredits() {
    return numOfCredits;
}

public void setNumOfCredits(int numOfCredits) {
    this.numOfCredits = numOfCredits;
}
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.