Question
please rewrite this code as Pseudo-Code,.. basically rewrite the code but in english language , Thank you so much! Example : if(5 > x) should
please rewrite this code as Pseudo-Code,.. basically rewrite the code but in english language , Thank you so much!
Example : if(5 > x) should be like if(5 is greater than x)
import java.util.Arrays; import java.io.BufferedWriter; import java.io.BufferedReader; import java.io.FileWriter; import java.io.FileReader; import java.io.IOException;
class WriteToFile{ /*Static method to write data to file from Array */ static void writeArray(String filename,int[] array) {
FileWriter fw = null; BufferedWriter bw = null; try {
fw = new FileWriter(filename); bw = new BufferedWriter(fw); bw.write(Arrays.toString(array));
System.out.println("Done");
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (bw != null) bw.close();
if (fw != null) fw.close();
} catch (IOException ex) {
ex.printStackTrace();
} } } /*Static method to read data from file. if want to add data to array, import JSON library and uncomment the commented code . */ static void readArray(String filename,int[] array) { try { BufferedReader br = new BufferedReader(new FileReader(filename));
String Line;
while ((Line = br.readLine()) != null) { System.out.println(Line); } /* JSONArray jsonArray = (JSONArray) new JSONObject(new JSONTokener("{data:"+Line+"}")).get("data"); for(int i=0; i }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started