954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

arrays

I wanted to create a java program usig arrays.
The program uses the file to input student name, city, grades scores and gender information. From this information the percent and letter grade should be calculated. how do i start?

sedai77
Newbie Poster
1 post since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

I would start by creating a person object with those pieces as private variables. Have one of those private variables be the array of grades. Make appropriate getters, setters, and constructors. Make a method to get the grades and store them in the array. Make a method to retrieve the grades and print them. Make a method to calculate the percentage and letter based on the array of grades. I would recommend having that method return a percentage (type double) and then have another method that takes a percentage and converts it into a letter (type char). Create these methods and you should have a solid person object that uses arrays to hold grades. Then create a driver to test your new object.

kvass
Junior Poster
168 posts since Aug 2009
Reputation Points: 85
Solved Threads: 21
 

Start like this:

Student[] student = new Student[SIZE];


After you design a Student class similar to the Person class described above. Your teacher might want some sort of hierarchy, such as Student extending Person. Read about inheritance. Read about classes. And read about arrays. Feel free to ask about those concepts here at Daniweb, we will be glad to help you. But do not ask us to tell you how to do your assignment again. Specific and appropriate questions (i.e. you put in the effort) get specific answers.

BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: