473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

JAVA grading program

hey everyone, i'm new to JAVA, and i'm trying to make a program that takes a .txt file with the format

10 4 2 2 3 1 5 4 2 4 4
Joe, 4 4 1 3 2 5 4 2 4 3
Mary, 4 2 2 3 2 5 3 2 4 4
Fred, 3 2 2 3 1 5 4 2 4 4

***(the first line is the 'answer key'; the first number indicates the total number of answers, and the numbers that follow are the 'correct' answers.
the lines following the 'answer key' are the students answers.)***

the program that i am trying to make involves using arrays to compare the 'answer key' to the students answers, and then return a statement along the lines of

Joe, 60%
Mary, 80%
Fred, 90%

i need to use an array for the answer key and the comparisons, because the number of questions change frequently

any help with this project would be GREATLY appreciated
Apr 17 '08 #1
3 2355
BigDaddyLH
1,216 Expert 1GB
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.

MODERATOR
Apr 17 '08 #2
i understand-
the main problem that i am having with the program is the java.io.* functions?

i cant figure out how to compose the code to make the program read the file and create the array

im sorry, i should have specified this in the first post

if anyone can help me figure out just simply how to create the arrays from the .txt file, i should be fine from there!

THANKS A TON!
Apr 17 '08 #3
sukatoa
539 512MB
i understand-
the main problem that i am having with the program is the java.io.* functions?

i cant figure out how to compose the code to make the program read the file and create the array

im sorry, i should have specified this in the first post

if anyone can help me figure out just simply how to create the arrays from the .txt file, i should be fine from there!

THANKS A TON!
Well, you could start to Read Scanner class....

if test.txt has a content "1 2 3 4 5"..

Here is the example,

Expand|Select|Wrap|Line Numbers
  1. int x = 0;
  2.         String array[] = new String[6];
  3.         Scanner scan = new Scanner(new File("test.txt"));
  4.         while(scan.hasNext()){
  5.             array[x] = scan.next();
  6.             x++;
  7.         }scan.close();
After some experiments on it, Have a look at FileReader.....

regards,
sukatoa
Apr 18 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: C.E.O. Gargantua | last post by:
http://blog.seattlepi.nwsource.com/microsoft/ Featured in the blog: Grading Bill Gates Charles Cooper, CNet News.com executive editor, assesses the performance of Bill Gates as the company's...
3
by: Akinyemi | last post by:
I am writing a Visual Basic program for calculating students scores, and also grading the highest 3 scores as "First" , "Second" and "Third" respectively. I have been able to get the program to...
4
by: hjc | last post by:
i am trying to created a program that will write a grading program for a class with the following policies there are 2 quizzes each graded on the basis of 10 points there is 1 midterm and 1...
3
by: angelcd | last post by:
i have a problem on my program, actually it runs and compile but it is lacking of the informaton needed, can you please help me with this, im really appreciate in any comments, Here it is The...
17
by: Brian Blais | last post by:
Hello, I have a couple of classes where I teach introductory programming using Python. What I would love to have is for the students to go through a lot of very small programs, to learn the...
5
by: arishma | last post by:
a program that expects a numeric grade as input and outputs the corresponding letter grade. the program uses the following grading scale: numeric range letter grade 0 39 ...
9
by: Grimmjow04 | last post by:
first of all, im a beginner with this thing.. turbo C,, my prof gave us a homework: we must do a grading system consist of: format>>> Grading System Enter your name:
7
by: rohitsripathi | last post by:
i need help writing this program... i am in college and i do not have time do this right now as i need to study for another test....but this is due tonight...i will pay $5 if you accept to do it and...
1
7 of 9
by: 7 of 9 | last post by:
Hello all, Here is my question. I have a query that calculates the average weight of an item. I would like to assign that weight to a predefined grade. Let’s say I have the following grading...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.