Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

I have a program that I need help with. Java. I have finish…

Customer Question
I have a program...

I have a program that I need help with.

Tutor's Assistant: Is there a specific language you're coding in?

Java. I have finish the assignment but there are errors that I need help debugging

Submitted: 4 months ago.Category: Homework
Show More
Show Less
Ask Your Own Homework Question
Customer reply replied 4 months ago
Write a program to perform statistical analysis of scores for a class of students.The class may have up to 40 students.There are five quizzes during the term. Each student is identified by a four-digit student ID number.The program is to print the student scores and calculate and print the statistics for each quiz. The output is in the same order as the input; no sorting is needed. The input is to be read from a text file. The output from the program should be similar to the following:Here is some sample data (not to be used) for calculations:Stud Q1 Q2 Q3 Q4 Q51234 78 83 87 91 862134 67 77 84 82 791852 77 89 93 87 71High Score 78 89 93 91 86Low Score 67 77 84 82 71Average 73.4 83.0 88.2 86.6 78.6The program should print the lowest and highest scores for each quiz.Plan of AttackLearning ObjectivesYou will apply the following topics in this assignment:File Input operations.Working and populating an array of objects.Wrapper Classes.Object Oriented Design and Programming.Understanding RequirementsHere is a copy of actual data to be used for input.Stud Qu1 Qu2 Qu3 Qu4 Qu51234 052 007 100 078 0342134 090 036 090 077 0303124 100 045 020 090 0704532 011 017 081 032 0775678 020 012 045 078 0346134 034 080 055 078 0457874 060 100 056 078 0788026 070 010 066 078 0569893 034 009 077 078 0201947 045 040 088 078 0552877 055 050 099 078 0803189 022 070 100 078 0774602 089 050 091 078 0605405 011 011 000 078 0106999 000 098 089 078 020Essentially, you have to do the following:Read Student data from a text file.Compute High, Low and Average for each quiz.Print the Student data and display statistical information like High/Low/Average..DesignThis program can be written in one class. But dividing the code into simple and modular classes based on functionality, is at the heart of Object Oriented Design.You must learn the concepts covered in the class and find a way to apply.Please make sure that you put each class in its own .java file.package lab2;class Student {private int SID;private int scores[] = new int[5];//write public get and set methods for//SID and scores//add methods to print values of instance variables.}/************************************************************************************/package lab2;class Statistics{int [] lowscores = new int [5];int [] highscores = new int [5];float [] avgscores = new float [5];void findlow(Student [] a) {/* This method will find the lowest score and store it in an array names lowscores. */}void findhigh(Student [] a) {/* This method will find the highest score and store it in an array names highscores. */}void findavg(Student [] a) {/* This method will find avg score for each quiz and store it in an array names avgscores. */}//add methods to print values of instance variables.}************************************************************************************/package lab2;class Util {Student [] readFile(String filename, Student [] stu) {//Reads the file and builds student array.//Open the file using FileReader Object.//In a loop read a line using readLine method.//Tokenize each line using StringTokenizer Object//Each token is converted from String to Integer using parseInt method//Value is then saved in the right property of Student Object.}}************************************************************************************///Putting it together in driver class:public static void main(String [] args) {Student lab2 [] = new Student[40];//Populate the student arraylab2 = Util.readFile("filename.txt", lab2);Statistics statlab2 = new Statistics();statlab2.findlow(lab2);//add calls to findhigh and find average//Print the data and statistics}Topics to LearnWorking with Text Files//ReadSource.java -- shows how to work with readLine and FileReaderpublic class ReadSource {public static void main(String[] arguments) {try {FileReader file = new FileReader("ReadSource.java");BufferedReader buff = new BufferedReader(file);boolean eof = false;while (!eof) {String line = buff.readLine();if (line == null)eof = true;elseSystem.out.println(line);}buff.close();} catch (IOException e) {System.out.println("Error -- " + e.toString());}}}//How do you tokenize a String? You can use other ways of doing this, if you like.StringTokenizer st = new StringTokenizer("this is a test");while (st.hasMoreTokens()) {System.out.println(st.nextToken());}//How to convert a String to an Integerint x = Integer.parseInt(String) ;
Customer reply replied 4 months ago
Write a program to perform statistical analysis of scores for a class of students.The class may have up to 40 students.There are five quizzes during the term. Each student is identified by a four-digit student ID number.The program is to print the student scores and calculate and print the statistics for each quiz. The output is in the same order as the input; no sorting is needed. The input is to be read from a text file. The output from the program should be similar to the following:Here is some sample data (not to be used) for calculations:Stud Q1 Q2 Q3 Q4 Q51234 78 83 87 91 862134 67 77 84 82 791852 77 89 93 87 71High Score 78 89 93 91 86Low Score 67 77 84 82 71Average 73.4 83.0 88.2 86.6 78.6The program should print the lowest and highest scores for each quiz.Plan of AttackLearning ObjectivesYou will apply the following topics in this assignment:File Input operations.Working and populating an array of objects.Wrapper Classes.Object Oriented Design and Programming.Understanding RequirementsHere is a copy of actual data to be used for input.Stud Qu1 Qu2 Qu3 Qu4 Qu51234 052 007 100 078 0342134 090 036 090 077 0303124 100 045 020 090 0704532 011 017 081 032 0775678 020 012 045 078 0346134 034 080 055 078 0457874 060 100 056 078 0788026 070 010 066 078 0569893 034 009 077 078 0201947 045 040 088 078 0552877 055 050 099 078 0803189 022 070 100 078 0774602 089 050 091 078 0605405 011 011 000 078 0106999 000 098 089 078 020Essentially, you have to do the following:Read Student data from a text file.Compute High, Low and Average for each quiz.Print the Student data and display statistical information like High/Low/Average..DesignThis program can be written in one class. But dividing the code into simple and modular classes based on functionality, is at the heart of Object Oriented Design.You must learn the concepts covered in the class and find a way to apply.Please make sure that you put each class in its own .java file.package lab2;class Student {private int SID;private int scores[] = new int[5];//write public get and set methods for//SID and scores//add methods to print values of instance variables.}/************************************************************************************/package lab2;class Statistics{int [] lowscores = new int [5];int [] highscores = new int [5];float [] avgscores = new float [5];void findlow(Student [] a) {/* This method will find the lowest score and store it in an array names lowscores. */}void findhigh(Student [] a) {/* This method will find the highest score and store it in an array names highscores. */}void findavg(Student [] a) {/* This method will find avg score for each quiz and store it in an array names avgscores. */}//add methods to print values of instance variables.}************************************************************************************/package lab2;class Util {Student [] readFile(String filename, Student [] stu) {//Reads the file and builds student array.//Open the file using FileReader Object.//In a loop read a line using readLine method.//Tokenize each line using StringTokenizer Object//Each token is converted from String to Integer using parseInt method//Value is then saved in the right property of Student Object.}}************************************************************************************///Putting it together in driver class:public static void main(String [] args) {Student lab2 [] = new Student[40];//Populate the student arraylab2 = Util.readFile("filename.txt", lab2);Statistics statlab2 = new Statistics();statlab2.findlow(lab2);//add calls to findhigh and find average//Print the data and statistics}Topics to LearnWorking with Text Files//ReadSource.java -- shows how to work with readLine and FileReaderpublic class ReadSource {public static void main(String[] arguments) {try {FileReader file = new FileReader("ReadSource.java");BufferedReader buff = new BufferedReader(file);boolean eof = false;while (!eof) {String line = buff.readLine();if (line == null)eof = true;elseSystem.out.println(line);}buff.close();} catch (IOException e) {System.out.println("Error -- " + e.toString());}}}//How do you tokenize a String? You can use other ways of doing this, if you like.StringTokenizer st = new StringTokenizer("this is a test");while (st.hasMoreTokens()) {System.out.println(st.nextToken());}//How to convert a String to an Integerint x = Integer.parseInt(String) ;
Customer reply replied 4 months ago
can you help me debug the program I wrote? I need the different cases:test cases
1. working with empty file using just header.
2. working with 1 record in file.
3. working with 15 records
4. 40 records
5. 45 records.
Customer reply replied 4 months ago
Posted by JustAnswer at customer's request) Hello. I would like to request the following Expert Service(s) from you: Live Phone Call.
Answered in 2 hours by:
3/11/2018
Tutor: LogicPro, Engineer replied 4 months ago
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,499
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified
Hi
Ask Your Own Homework Question
Was this answer helpful?

How JustAnswer works

step-image
Describe your issueThe assistant will guide you
step-image
Chat 1:1 with a tutorLicensed Experts are available 24/7
step-image
100% satisfaction guaranteeGet all the answers you need
Ask Scott Your Own Question
Scott
Scott
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3,040
3,040 Satisfied Customers
Experience: MIT Graduate (Math, Programming, Science, and Music)

Scott is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

13,499 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,556 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,698 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,190 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
I have no clue on where to start this. C++ Write a program
Write a program that defines a two-dimension integer array, which stores the test scores for 10 students and 4 scores each student. The program should have the following functions. getData: this function is to get input of all test scores for each student. getAverage: This function is to calculate the average score(double type) for each student. No input and output in the function. getLetterScore: This function is to get the letter score based on their average score. No input and output in the function. findMaxScore: this function is to find the max average score. No input and output in the function. Define the necessary variables and arrays in the main function and display the results of each function in the main function. And also make sure which arrays should be passed as const. The function prototypes are shown below (not include const yet): void getData(int[][cols],int); void getAverage(int[][cols], int, double[]); void getLetterScore(double[], int,char[]); double findMaxScore(double[],int); … read more
Chris Baxter
Chris Baxter
28 satisfied customers
This assignment is built on top of Assignment 6. Add
This assignment is built on top of Assignment 6. Add capability to handle Grade Book for different subjects (Chemistry and Computer Science). We will assume a maximum of five assignments and up to 40 … read more
LogicPro
LogicPro
Engineer
13,499 satisfied customers
Java. I need to build this object on a project I worked on
i need to build this object on a project I worked on … read more
LogicPro
LogicPro
Engineer
13,499 satisfied customers
Initial file comment should describe any input expected from
Initial file comment should describe any input expected from the user and any output produced in detail. Functions must have comments above each of them describing what the function does. This comment… read more
LogicPro
LogicPro
Engineer
13,499 satisfied customers
I need help with compiling the following java program, every
I need help with compiling the following java program, every time I try to compile it using CodeRunner, I receive errors. class Untitled { public static void main(String[] args) { import java.util.Sca… read more
LogicPro
LogicPro
Engineer
13,499 satisfied customers
1. Assignment5_1.java - Write a console program that does
1. Assignment5_1.java - Write a console program that does the following:In main() method, create an array of 1000 int. This means an array of type int that could store 1000 elements.Create a static me… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
1. Write a class that maintains the top ten scores for a
1. Write a class that maintains the top ten scores for a game application, implementing the add and remove methods using a singly linked list instead of an array . 2. Perform the previous project, but… read more
LogicPro
LogicPro
Engineer
13,499 satisfied customers
for my first program, i just need help getting the program
NEED help with a class (spinnerGame) which runs a simulation of two people playing a game with a spinner. The game is easy- Spin a wheel which contains the following eight values: +5 +3 +2 +1 -‐‐1 -‐‐… read more
Mr. Wilson
Mr. Wilson
Teacher
Master\u0027s Degree
200 satisfied customers
Sort Flexibility (Student class) In week 8, we saw an example
Sort Flexibility (Student class) In week 8, we saw an example of a Student class that provided a compareTwoStudents() method. We needed to define such a method because our sort algorithm (which was in… read more
Raj
Raj
SAP ABAP Consultant
Master\u0027s Degree
27 satisfied customers
Write a program that reads the name of a data file which contains
Write a program that reads the name of a data file which contains student ids (such as c1004400) and their scores. The program will find and print the average score, the number of students processed, … read more
LogicPro
LogicPro
Engineer
13,499 satisfied customers
Flight Reservation System A small airline has needs to
Flight Reservation System A small airline has needs to set up a reservation system. You've been asked to program the new system. You are to write a program that assigns seats for their flight of the a… read more
Raj
Raj
SAP ABAP Consultant
Master\u0027s Degree
27 satisfied customers
Need help with Task Modify the program Ch7ExCr.java Use the
Need help with Task Modify the program Ch7ExCr.java Use the data file Ch7ExCrData.txt Your program should use the following methods: (HINT: all methods WILL BE VOID METHODS… all processing will be don… read more
Steve The IT Guy
Steve The IT Guy
Master\u0027s Degree
54 satisfied customers
For LogicPro Generate a text based histogram for a quiz
For LogicPro Generate a text based histogram for a quiz given to a class of student. Write a program that takes inputs from a file. Ask the user to input the name of the file from the keyboard. In the… read more
LogicPro
LogicPro
Engineer
13,499 satisfied customers
For this assignment we will rewrite the High Scores program
For this assignment we will rewrite the High Scores program using a class to store the data for each player. The class is diagrammed below: class highscore Instance Variables string name int score Con… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
This is an Introduction to Java homework. On this particular
This is an Introduction to Java homework. On this particular assignment, we need to use Array of Objects, no Inheritance or polymorphism; just a simple array using methods. This homework needs: 1.) to… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
Write a static method named "hasNoDuplicates" that takes an
Write a static method named "hasNoDuplicates" that takes an array of Strings as a parameter and that returns a boolean value indicating whether or not any of the Strings in the array are duplicated (t… read more
R.R. Jha
R.R. Jha
Bachelor\u0027s Degree
150 satisfied customers
Hi Cherryl, This question asks to create a superclass called
Hi Cherryl, This question asks to create a superclass called Movie, 3 derived classes called Action, Comedy and Drama. Finally create a Rental class which is an array, and requires an iteration throug… read more
Cherryl Lewis
Cherryl Lewis
Bachelor's Degree
180 satisfied customers
Inventory Program Part 2 Modify the Inventory Program so ...
Inventory Program Part 2 Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, in… read more
Scott
Scott
MIT Graduate
3,040 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x