Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: New at Java Programming

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default New at Java Programming

    Hello everyone! So I'm pretty new at all this java programming and I'm having some difficulty in one of my college classes. I have an assignment that I need to program for. I kind of have a start but don't really know where to go from there. I'm going to attach the assignment directions and then maybe someone can help me. Ill also attach what I already have as well.

    Assignment Directions.....


    You will need to do the following:
    1) prompt for the student grade file (see Grades.txt for a clean sample)
    2) process the file to determine the following pieces of information to be
    provided as a summary after processing
    a) Number of student records processed
    b) Number of assignments graded (distinct assignments, 1 test for 18 students
    is 1 assignment)
    c) Total possible points
    d) Show each student number with total points for student, grade as percent
    of total possible (rounded to single decimal place) and an indicator (like
    *****) if the student record is incomplete (i.e. missing a grade, 0 is not
    missing, blank (i.e. empty string) is missing)
    e) Average grade per assignment and average total grade
    f) Highest grade per assignment and highest total grade (show student number
    for each highest grade)

    Your first stage is to create psuedo-code that details how you will go about solving this problem.

    It should contain sufficient detail, noting the following: prompting for the file, when to open the file, loop structures (don't worry about the expressions, etc. for loops, just indicate where, if nested, etc.) and start thinking about what variables will be needed to keep track of the different values necessary to complete the requirements.

    This is what I have...

    import java.util.Scanner;
    import java.io.*;
    import java.util.Random;
    import java.util.ArrayList;
     
    public class GradesAssignment {
     
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) throws I0Exception  {
     
    		Scanner keyboard = new Scanner(System.in);
    		System.out.println("Please enter the filename (full path)");
     
    		String path = keyboard.nextLine();
    		File gradeFile = new File(path);
     
    			while (! gradeFile.exists());
    			{
    				System.out.println("Sorry that file does not exist, please enter the filename (full path)");
    				path= keyboard.nextLine();
     
    				gradeFile = new File(path);
     
    			}	
    			Scanner fileReader = new Scanner(gradeFile);
     
    			ArrayList<String> rows = new ArrayList<String>();
    			while(fileReader.hasNextLine())
    			{	
    				rows.add(fileReader.nextLine());
    			}
    			fileReader.close();
     
    			System.out.println("Number of students: " + ( rows.size()-1));
     
    			String headerRow = rows.get(0);
     
    			String [] columns = headerRow.split("/t");


  2. #2
    Junior Member
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: New at Java Programming

    I have already done the psuedo code. I just need to do the actual programming now.

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: New at Java Programming

    Please see - http://www.javaprogrammingforums.com...e-posting.html

    I have moved your thread to the correct forum.

    What is the problem with your code? What works, what doesn't? What are you stuck on?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  4. #4
    Junior Member
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: New at Java Programming

    I'm having a problem setting it up. I just don't know how to go about it.

Similar Threads

  1. Is java a power full programming language? can java do this?
    By Jhovarie in forum Java Theory & Questions
    Replies: 5
    Last Post: March 2nd, 2011, 02:02 PM
  2. new to java programming GUI help
    By eg6_kaydoo in forum AWT / Java Swing
    Replies: 4
    Last Post: July 14th, 2010, 09:55 PM
  3. Is Java Programming Best?
    By messenger in forum Java IDEs
    Replies: 3
    Last Post: May 4th, 2010, 09:11 PM
  4. Please help me with this Java programming
    By simply_stunning79 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 12th, 2010, 08:04 AM
  5. Towards java programming...
    By emigrant in forum Member Introductions
    Replies: 1
    Last Post: February 15th, 2010, 03:17 AM