6.17 LAB: Course Grade Write a program that reads the student information from a tab separated...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
6.17 LAB: Course Grade Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: • Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: • A: 90 =< x • B: 80 < x < 90 • C: 70 =< x < 80 . . • D: 60 =< x < 70 • F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt. Output one student per row and separate the values with a tab character. • Output the average of each exam, with two digits after the decimal point, at the end of report.txt. Hint: Use the precision sub-specifier to format the output. Ex: If the input of the program is: Student Info.tsv and the contents of StudentInfo.tsv are: Barrett 70 45 59 Bradshaw Reagan 96 97 88 Charlton Caius Mayo Stern Edan Barrett Bradshaw Charlton Mayo Stern the file report.txt should contain: am 73 94 80 Tyrese 88 61 36 Brenda 90 86 45 Edan 70 45 59 F Reagan 96 97 88 A Caius 73 94 80 B Tyrese 88 61 36 D Brenda 90 86 45 ( с Averages: Midterm1 83.40, Midterm2 76.60, Final 61.60 6.17 LAB: Course Grade Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: • Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: • A: 90 =< x • B: 80 < x < 90 • C: 70 =< x < 80 . . • D: 60 =< x < 70 • F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt. Output one student per row and separate the values with a tab character. • Output the average of each exam, with two digits after the decimal point, at the end of report.txt. Hint: Use the precision sub-specifier to format the output. Ex: If the input of the program is: Student Info.tsv and the contents of StudentInfo.tsv are: Barrett 70 45 59 Bradshaw Reagan 96 97 88 Charlton Caius Mayo Stern Edan Barrett Bradshaw Charlton Mayo Stern the file report.txt should contain: am 73 94 80 Tyrese 88 61 36 Brenda 90 86 45 Edan 70 45 59 F Reagan 96 97 88 A Caius 73 94 80 B Tyrese 88 61 36 D Brenda 90 86 45 ( с Averages: Midterm1 83.40, Midterm2 76.60, Final 61.60
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
The SMG Strategic Relationship Management (SRM) Framework provides a practical approach to creating and maintaining relationships with key stakeholders that optimizes the effects of service quality...
-
3. Let Mx (t) be the moment-generating function of a random variable X and be the mean of X. (a) Show that the moment-generating function of (X ) is Mx- (t) = et Mx (t). (b) Show that the rth...
-
The following are trial balance of Clarissa Amanda Sdn. Bhd. as at 31st December 2021. Debit RM Credit RM Opening stock, 1 Jan 2021 16,000 Purchases 75,000 Sales return 5,000 Carriage inwards 1,500...
-
10 J of heat are removed from a gas sample while it is being compressed by a piston that does 20 J of work. What is the change in the thermal energy of the gas? Does the temperature of the gas...
-
Let B = AT A. Show that bij = aiTaj.
-
A string of six letters is randomly generated using the letters A B C. Repetition is allowed. a. How many elements are in the sample space S? (Answer: 729) b. L is the event that the letters in the...
-
Consider a publicly held company whose products you are familiar with. Some examples might include: Access the companys public website and search for its most recent annual report. (Some companies...
-
Lingenfelter Corporation experienced a fire on December 31, 2017, in which its financial records were partially destroyed. It has been able to salvage some of the records and has ascertained the...
-
White Pear Inc., an organic soap manufacturer, showed the following equity information as at December 31, 2020: Contributed capital: White Pear Inc. Equity Section of the Balance Sheet December 31,...
-
The COVID-19 pandemic affected companies in the food industry in unique ways, particularly during 2020. Ruth's Hospitality Group (Ticker: RUTH) develops and operates fine dining restaurants under the...
-
For Questions 7-13, refer to the following information: Alexander (2014) studied the necessary critical thinking skills for public health practitioners compared to how critical thinking skills were...
-
what is fixed cost and can it be unfixed given a sufficient time?kindly explain both terms .
-
Brill Co. made the following expenditures relating to Product X: Labor and material costs incurred in producing a prototype $100,000 Cost of testing the prototype Legal costs to file a patent $...
-
For the RL circuit shown above, assume that the component values are R = 10002 and L= 10H. Part A) Find the differential equation that relates the source voltage, x(), to the inductor voltage, y()....
-
Conflict is a normal part of life. Managing conflict using effective communication is an important skill for solving problems, innovating, and maintaining productive relationshipsparticularly in a...
-
1 2 3 In the figure above, which item number shows style rule(s) applied to 1 2 A class 4 8695 SOH234 7 9 10 11 12 13 body ( } #contact { } background-color: ivory; 4 text-align: left; text-align:...
-
What is the income tax refundable or payable after considering the creditable withholding tax and the tax payment? THIS SUBJECT IS INCOME TAXATION 1. Waterfall Corp. made an estimated tax payment of...
-
A firm has the following balance sheet: Assets Cash Accounts receivable Inventory Plant and equipment $ 15,000 150,000 92,000 170,000 $427,000 Liabilities and Equity Accounts payable Long-term debt...
-
Write a Java enumeration LetterGrade that represents letter grades A through F, including plus and minus grades. Define a private instance variable to hold a boolean value that is true if the grade...
-
Write statements that can be used in a JavaFX application to draw the five interlocking rings that are the symbol of the Olympics. (Dont worry about the color.)
-
Repeat Exercise 18 in Chapter 1, but define and use named constants. Exercise 18 Write statements that can be used in a JavaFX application to draw the five interlocking rings that are the symbol of...
-
Gordon Company signed a note payable on November 20. Gordon has a December 31 year-end. It paid the note, including interest, on the maturity date, February 20. What accounts did Gordon debit and...
-
On whom is the FICA tax levied? What does the FICA tax finance?
-
What are two examples of voluntary deductions from an employee's gross pay?
Study smarter with the SolutionInn App