Home / Expert Answers / Computer Science / hi-i-need-to-write-it-as-a-java-code-nbsp-download-the-following-test-cases-by-right-clicki-pa184

(Solved): Hi, I need to write it as a Java code   Download the following test cases by right-clicki ...



Hi, I need to write it as a Java code

Download the following test cases by right-clicking on it and choosing Save Target As.... Save them in the same directory as

2. Go to the directory where Assignmentl. java is located and compile this Java program by typing:
javac Assignmentl.java
If

 

Download the following test cases by right-clicking on it and choosing Save Target As.... Save them in the same directory as Assignmentl.java is located. Input The Input files are the test cases that will be used as input for your program (Right-click and use "Save As" in CANVAS page): Output The Output files are the expected outputs of the corresponding input files from the previous section (Right-click and use "Save As" in CANVAS page): Important Note: If you are downloading these files to a machine with Windows OS, an extra blank line will be added at the end of each file. However that line does not exist in the CSE205 server, so when you use these files to test your program, please delete or ignore the last blank line. If you make your program to produce an extra blank line at the end of output, your program will not pass the test cases when submitting on sever. In this assignment, each output file contains 5 lines, with one empty line at the very end. 1. This program uses the Scanner class. The Scanner class simplifies the way programs read input. You can open a DOS console by clicking "Start" and choose "Run". In the text box, type "cmd". You need to use commands such as "cd" to change the directory to get to where Assignment1.java is located. If you are doing this in your home computer, you might need to configure your machine. 2. Go to the directory where Assignmentl. java is located and compile this Java program by typing: javac Assignmentl.java If you are using Windows, choose Start->Run, then type "cmd". This opens up a MS-DOS. if you are using Mac, open 'Finder \( > \) Applications' or Command \( +A \), then go to 'utilities' and you can find 'Terminal'. In a DOS or a Terminal, you can use the command "cd" (change directory) to change your directory or folder: cd foldername will take you to the sub-folder in the current folder. \( c d . \) will take you back to the previous folder (the folder that contains the current folder.) Once you reach the folder where Assignment1.java is located, then you can type the above command (javac ...) to compile. Note that you can compile your program using any IDE such as TextPad or Eclipse. So if you can compile it with other means, then you don't need to use a DOS or Terminal in this step. 3. Then execute this program using the first test case by typing: java Assignment1 \( < \) input1.txt \( > \) myout1.txt Here the program reads from inputl.txt file, and write its output into the file named "myoutl.txt". Note that you need to have Assignmentl.java file and inputl.txt file in the same folder. 4. Now we compare the output ("myout1.txt") generated by this program and the expected output shown by the file "output1.txt")


We have an Answer from Expert

View Expert Answer

Expert Answer


pl
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe