Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Deadline: before the end of the tatorial time-9:40 AM, 13 Dee 1. (5 marks) Create a file named scores.txt, within which there are five lines

image text in transcribed
image text in transcribed
Deadline: before the end of the tatorial time-9:40 AM, 13 Dee 1. (5 marks) Create a file named "scores.txt", within which there are five lines of texts as following, NAMEs CPP JAVA OS DB CAD Zhangsan 85 89.5 78 90.5 85 Lisi 67 89 78.5 85 77 Wangwu 78.5 81 67 88 67 Zhaoliu 90 95 87 78 89.5 Write a program to read the data from the file, and then change (mainly transposition) the format and output to another file named "courses.txt". The content should be as following, COURSEs Zhangsan Lisi Wangwu Zhaoliu CPP 85 67 78.5 90 JAVA 89.5 89 81 95 OS 78 78.5 67 87 DB 90.5 85 88 78 CAD 85 77 67 89.5 The program should also be able to output (to console) the average scores for each course and for each person. Tips: a. The input and output streams should be closed after reading/writing finished. b. The separators used in the two files are both blank spaces, you can change it into tabs (lt) if you like. c. There is no need to handle the exceptions in this question, but if you do, it wil be better. (Use "throws Exception" at the method header, in which the possible The methods of transforming strings into numerical values are: strings to int - The methods from String to separate one whole string with certain separator: exception would occur and handling of it is required.) Integer.parseInt(str); string to double - Double.parseDouble(str); str.split(separator); note that the return value is an array of string... find more in APIs. * Provide the source code lipse workspace-E

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

What are the steps involved in the HR planning process?

Answered: 1 week ago