Please do in java as simply as possible with code available for copy and comments. Provide screenshots of code and how your incorporating the .txt file with the code.
Write a program that reads in temperatures from the text file temps.txt (file given in the assignment). Write the minimum temperature, maximum temperature and the new array (temperatures plus 10) to a new file.
The temperatures in file are:
83 87 81 88 90 92 95
Java code:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
public class Main{
public static void main(String[] args) {
try {
FileReader read = new FileReader("File.txt");
BufferedReader bReader = new BufferedReader(read);
String numbers;
String arr[] = new String[100];
int count = 0;
while ((numbers = bReader.readLine()) != null) {
arr = numbers.split(" ");
count = arr.length;
}
int inarr[] = new int[arr.length];
for(int i=0;i<count;i++)
{
inarr[i] = Integer.parseInt(arr[i]);
}
int max = Arrays.stream(inarr).max().getAsInt();
int min = Arrays.stream(inarr).min().getAsInt();
read.close();
FileWriter writer = new FileWriter("File1.txt", true);
writer.write("Maximum Temparature is :"+max+"\n");
writer.write("Minimum Temparature is :"+min+"\n");
writer.write("Modified Temparatures Array:");
for(int i=0;i<count;i++)
writer.write(inarr[i]+10+" ");
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Execution screenshots:
![Main.java File.txt File1.txt 6 import java.util.collections; 7. public class Main{ public static void main(String[] args) { t](http://img.homeworklib.com/questions/5cd3a040-c701-11ea-90d2-d703d43baf08.png?x-oss-process=image/resize,w_560)


Please do in java as simply as possible with code available for copy and comments. Provide...
Please do in java as simply as possible with code available for copy and comments Write a program that reads a file (provided as attachment to this assignment) and writes the file to a different file with line numbers inserted at the beginning of each line. Throw an exception if the file does not exist. An error message should result. For example if file input is: This is a test File output should be 1. This is a test I...
Write a program that demonstrates use of programmer - defined
data structures. Please provide code! Thank you.
Here are the temps given:
January 47 36
February 51 37
March 57 39
April 62 43
May 69 48
June 73 52
July 81 56
August 83 57
September 81 52
October 64 46
November 52 41
December 45 35
Janual line Iranin Note: This program is similar to another recently assigned program, except that it uses struct and an array of...
Please do in C# with the code available to copy :) Program 4: Design (pseudocode) and implement (source code) a program (name it MinMaxAvg) to determine the highest grade, lowest grade, and the average of all grades in a 4-by-4 two-dimensional arrays of integer grades (representing 4 students’ grades on 4 tests). The program main method populates the array (name it Grades) with random grades between 0 and 100 and then displays the grades as shown below. The main method...
JAVA / please add comments Write code for a method named loadDatagrams() that returns an array of type Datagram. The method will read from the filepath C:/folder/grams.dgf and the file contains an array of type Datagram ( you may assume that the class definition is visible to the method) Remember to include appropriate exception handling
Resource: "The Locale Object" text file For this assignment, you will develop Java™ code that relies on localization to format currencies and dates. In NetBeans, copy the linked code to a file named "Startercode.java". Read through the code carefully and replace all occurrences of "___?___" with Java™ code. Note: Refer to "Working with Dates and Times" in Ch. 5, "Dates, Strings, and Localization," in OCP: Oracle®Certified Professional Java® SE 8 Programmer II Study Guide for help. Run and debug your...
Please do in Java with the code available for copy :) Write a computer program that prompts the user for one number, n for the number of items in the array to sort, and create and sort 1000 different arrays of this size timing the run to get an average time to sort an array of this size. Then do the following: Initiate a variable running_time to 0 Create a for loop that iterates 1000 times. In the body of...
PLEASE UPLOAD or Write a simple PSEUDO CODE AND JAVA CODE for this program WITH COMMENTS IN BOTH TELLING WHAT EACH PART DOES. (I NEED BOTH CODES NOT JUST ONE OR THE OTHER) Problem Statement A golf club has a small tournament consisting of five golfers every weekend. The club president has asked you to design a program that does the following: Reads player’s names and their scores from the keyboard for each of the five golfers and simulates writing...
Hallo! I have a problem in my code, I need help please in java code. My task is : Write a program that can read a text from a file and do frequency analysis on the letters that occur . To store information (frequency) you must use an array. Tip! The place where you collect the frequency of eg the letter A is the equivalent of the ASCII code of "A" ie 65. The array should be 127 elements. For...
java pseudocode and source code help?
Write a program that uses an array of high temperatures for your hometown from last week (Sunday - Saturday). Write methods to calculate and return the lowest high temperature (minimum) and a method to calculate and return the highest high temperature (maximum) in the array. You must write YOUR ORIGINAL methods for minimum and maximum. You MAY NOT use Math class methods or other library methods. Write an additional method that accepts the array...
JAVA only Please do and post Code with Screenshot. Write a program that reads a paragraph from user and extract and print out any telephone number in the text. The telephone numbers can have the following formats. For this assignment you need to create objects from class Pattern and Matcher. (xxx) xxx-xxxx xxx-xxx-xxxx