annotating small java code in detail and writing a report
$30-100 USD
Abgesagt
Veröffentlicht vor mehr als 16 Jahren
$30-100 USD
Bezahlt bei Lieferung
basically i have a simple code done and just need some body to annotate the code in detaile and write up a report regarding the code.
example of code.
import [login to view URL];
import [login to view URL];
import [login to view URL];
import [login to view URL];
import [login to view URL];
import [login to view URL];
public class Test
{
public static String inputFileName;
public static String outptFileName;
public static void main(String [] arg){
if(arg.length==0){
[login to view URL]("Please enter the absolute path of the input file.n");
InputStreamReader isr=new InputStreamReader([login to view URL]);
BufferedReader br=new BufferedReader(isr);
try {
Test.inputFileName=[login to view URL]();
[login to view URL]("nPlease enter the absolute path of the output filen");
Test.outptFileName=[login to view URL]();
} catch (IOException e) {
[login to view URL]();
}
}else if(arg.length==2){
inputFileName=arg[0]; //if the input file is given as a command line parameter.
outptFileName=arg[1]; //if the output file is given as a command line parameter.
}
else{
[login to view URL]("Usage : java Test <input file> <output file>n");
[login to view URL]("or Usage: java Testn");
return;
}
File file=new File(inputFileName);
BufferedReader bufferedFileReader=null;
try {
bufferedFileReader=new BufferedReader(new FileReader(file));
} catch (FileNotFoundException e) {
[login to view URL]();
}
MarkBook myMarkBook = new MarkBook("CS101", "Java", "Maths", "Stats", "Networks", "Database");
try {
while(true){
String line = [login to view URL]();
if(line==null)break;
String surname=[login to view URL](0, [login to view URL](" ", 0));
String forename=[login to view URL](10,[login to view URL](" ", 10));
String g1=[login to view URL]([login to view URL](20));
String g2=[login to view URL]([login to view URL](21));
String g3=[login to view URL]([login to view URL](22));
String g4=[login to view URL]([login to view URL](23));
String g5=[login to view URL]([login to view URL](24));
[login to view URL](surname, forename, g1, g2, g3, g4, g5);
}
} catch (IOException e) {
[login to view URL]();
}
[login to view URL]();
}//end method main()
} //end class Test
Hello, I can do it. Two minor suggestions to your project: (1) You'd better decide if the input file exists before you read it. (2) If the input file's format i.e. the line is less than 20, the program has no exception handler to process.