Question: Please answer all the question 2 [7.5) Suppose you have a file named numbers.txt that contains more than 40 integer numbers. a) Read the file
Please answer all the question
2 [7.5) Suppose you have a file named "numbers.txt" that contains more than 40 integer numbers. a) Read the file and find the max, min and average of those numbers. b) Write the value of the max, min and average to a file named "result.txt" 3 [7.5] Suppose you have a java class named Dog, and a file named "dogs_data.txt" containing the data of 3 dogs like this: Class: Dog public class Dog { String breed; int age; String color; file: dogs_data.txt German Shepherd, 3, Golden and Black Dalmatian, 2, White and Black Greyhound, 4, White public Dog(String breed, int age, String color) { this.breed = breed; this.age = age; this.color = color; } Note that: The file "dogs_data.txt" contains the breed, age and color of different dogs in each line. The values are separated by a comma and a space. Now, a) create 3 dogs objects using the data from the file. b) Write the data of the 3 dogs objects that you just created to another file named "dogs_data_new.txt". The file "dogs_data_new.txt" should be similar to the file "dogs_data.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
