Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is in Java, I\'m having trouble formatting this correctly. Could someone he

ID: 3787467 • Letter: T

Question

This is in Java, I'm having trouble formatting this correctly.

Could someone help me out? Thanks in advance!

output = new Formatter("courses.txt");
output.format("%s;%d;%.2f%n","Python", "INSY 3300", "560-650 MW", 1, 3);
output.format("%s;%d;%.2f%n","Networking", "INSY 3303", "530-650 TR", 1, 3);
output.format("%s;%d;%.2f%n","DBMS", "INSY 3304", "900-950 MWF", 1, 3);
output.format("%s;%d;%.2f%n","Analysis&Design", "INSY 3305", "700-820 TR", 1, 3);
output.format("%s;%d;%.2f%n","Java I", "INSY 4305", "700-820 TR", 1, 3);
output.format("%s;%d;%.2f%n","Java II", "INSY 4306", "530-650 TR", 1, 3);
output.format("%s;%d;%.2f%n","Mobile App", "INSY 4308", "200-320 TR", 1, 3);
output.format("%s;%d;%.2f%n","Web Development", "INSY 4315", "1000-1050 MWF", 1, 3);
output.format("%s;%d;%.2f%n","Resource Management", "INSY 4325", "100-220 TR", 1, 3);

Explanation / Answer

import java.io.FileNotFoundException;
import java.util.Formatter;


public class TestFormatter {
public static void main(String[] args) throws FileNotFoundException
{
Formatter output = new Formatter("courses.txt");
output.format("%s;%s;%s;%d;%d%n","Python", "INSY 3300", "560-650 MW", 1, 3);
output.format("%s;%s;%s;%d;%d%n","Networking", "INSY 3303", "530-650 TR", 1, 3);
output.format("%s;%s;%s;%d;%d%n","DBMS", "INSY 3304", "900-950 MWF", 1, 3);
output.format("%s;%s;%s;%d;%d%n","Analysis&Design", "INSY 3305", "700-820 TR", 1, 3);
output.format("%s;%s;%s;%d;%d%n","Java I", "INSY 4305", "700-820 TR", 1, 3);
output.format("%s;%s;%s;%d;%d%n","Java II", "INSY 4306", "530-650 TR", 1, 3);
output.format("%s;%s;%s;%d;%d%n","Mobile App", "INSY 4308", "200-320 TR", 1, 3);
output.format("%s;%s;%s;%d;%d%n","Web Development", "INSY 4315", "1000-1050 MWF", 1, 3);
output.format("%s;%s;%s;%d;%d%n","Resource Management", "INSY 4325", "100-220 TR", 1, 3);
output.close();
}
}

/*

This is content of file being written

Python;INSY 3300;560-650 MW;1;3
Networking;INSY 3303;530-650 TR;1;3
DBMS;INSY 3304;900-950 MWF;1;3
Analysis&Design;INSY 3305;700-820 TR;1;3
Java I;INSY 4305;700-820 TR;1;3
Java II;INSY 4306;530-650 TR;1;3
Mobile App;INSY 4308;200-320 TR;1;3
Web Development;INSY 4315;1000-1050 MWF;1;3
Resource Management;INSY 4325;100-220 TR;1;3

*/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote