Write a java program that create a 2 dimensional array of type double of size 10 by 10.
Fill the array with random numbers using a random number generator.
Print the array contents.
Write a java program that creates a file called data.txt that uses the PrintWriter class.
Write the numbers 1 to 42 into the file. Close the file. Attach both files.
Thank you in advance

import java.util.Random;
public class RandomMatric {
public static void main(String[] args) {
Random random = new Random();
int[][] matrix = new int[10][10];
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
matrix[i][j] = random.nextInt(1000);
}
}
// print array
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
System.out.print(matrix[i][j] + " ");
}
System.out.println();
}
}
}

import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class WriteFile42 {
public static void main(String[] args) throws FileNotFoundException {
PrintWriter pw = new PrintWriter("data.txt");
for (int i = 1; i <= 42; i++) {
pw.println(i);
}
pw.close();
}
}
Write a java program that create a 2 dimensional array of type double of size 10...
Write a java program that creates a file called numbers.txt that uses the PrintWriter class. Write the odd numbers 1 to 99 into the file. Close the file. Using Scanner, open the numbers.txt file and read in the numbers. Add them all up and print the total. Close the file.
Write a Java method that will take an array of integers of size n and shift right by m places, where n > m. You should read your inputs from a file and write your outputs to another file. Create at least 3 test cases and report their output. I've created a program to read and write to separate files but i don't know how to store the numbers from the input file into an array and then store the...
Write a Java program in Eclipse. . Write a Java program that: 1. Creates an array of 100 integers. Initialize the array to have all zeros. 2. Puts even numbers starting from 6 (excluding multiples of 12) into the first 50 slots of the array above. So numbers 6,8,10,14,16,18,20,22,26, etc. go into the first 50 positions in the array. Print the array. 3. Puts random numbers between 45 and 55 into the second 50 slots of the array above (second...
Write a Java program to create a two-dimensional array, myFifthMatrix, with the following specifications: Initialize myFifthMatrix with int type and with size [3][3]. Use a for loop to fill the myFifthMatrix with random values between 0 and 99. Print the myFifthMatrix using a for loop. For each column, use a variable named total to store its sum. Add each element in the column to total using a for loop
Create a class with an array of type integer of size 15. Fill the array with random integers of size 1 to 1000. Sort the array. Print out the contents of the array. Thank you in advance
Write a program in C that creates an array of 100 random numbers from 0-99. The program sums the random numbers and prints the sum. It then writes the numbers to a new file using open, close and write. Then looks in the current directory for files that match the pattern “numbers.XXXX”. For each file, open the file and read the file. You can assume that the file will contain 100 integers. Sum the integers. Print the filename and the sum...
We use bluej for our JAVA program. If you can help id greatly
appreciate it.
Create a new Java program called Flip. Write code that creates and populates an array of size 25 with random numbers between 1-50. Print the array. Print array in reverse.
in java eclipse, Create a program “FibonacciFifteen.java” and a method called “double[] getFibonacci()” that creates an array with a length of 15 that contains the first 15 numbers in the Fibonacci sequence and returns it. Set the first element to 0 and the second element to 1, then use a for loop to fill out the rest of the array by adding the prior two elements.
Using Java. Write a program that creates a “triangular” two-dimensional array A of 10 rows. The first row has length 1, the second row has length 2, the third row has length 3, and so on. Then initialize the array using nested for loops so that the value of A[i][j] is i+j. Finally, print out the array in a nice triangular form.
Write a simple Java program with the following naming structure: Open Eclipse Create a workspace called hw1 Create a project called hw1 (make sure you select the “Use project folder as root for sources and class files”) Create a class called Hw1 in the hw1 package (make sure you check the box that auto creates the main method). Add a comment to the main that includes your name Write code that demonstrates the use of each of the following basic...