Page 1 of 1

Please answer with this additional 2 files : Lab When submitting this lab, submit a .java file called FormLetter, and cr

Posted: Thu Jul 14, 2022 2:10 pm
by answerhappygod
Please answer with this additional 2 files :
Lab
When submitting this lab, submit a .java file called FormLetter,and create the following structure in Eclipse:
Write a program that will read a CSV file containing scores forstudent assignments, and create a letter saved to a file for eachstudent who has one or more scores of 0, and then print outmessages to the console indicating which students have letterswritten (as show in the example run). In this program you willcombine data from the CSV file and the TXT file to create a letterto each student in the class who is missing one or moreassignments. The letter must have the following format:
<student name>,
<text from Warning Letter to Student - .txt file>
<list of missing assignments>
Each letter file must be saved with the following namingformat:
Warning letter to student - <student name>.txt
Downloads
For this lab you will need to download the file StudentAssignment Scores.csv DownloadStudent Assignment Scores.csv. This file contains a list ofstudents and the scores they received for 6 class assignments.Place this file in your PROJECT directory. You will also needto download the file Warning Letter to Students-.txt DownloadWarning Letter to Students -.txt. This file contains the body of aform letter to students who are missing assignments. Place thisfile in your PROJECT directory.
Steps
Reading an entire file into a String Variable
The Scanner has several different methods you are not fullyfamiliar with.
By setting the delimiter to a value you know is not foundanywhere in an input file, and then calling .next(), you cansuccessfully read the entire contents of a file into a Stringvariable.
Example:
Scanner letter = new Scanner(letterFile); //Create a new Scanner object (letter)that points to a File.
letter.useDelimiter("\\Z"); //Change the delimiter of the letter Scanner object to "\\Z" sinceyou know that the string "\\Z" is not found anywhere in your .txtfile.
String letterBody = letter.next(); // .next() will read the entire contents of thefile since the delimiter "\\Z" is not found in the .txt file. The String letterBody now contains the entire contents of thefile.
Example Run
Your program output should look like this:
Creating letters for:
Garrett WangEthan PhillipsRoxann DawsonRobert BeltranRobert McNeilArmin ShimermanDominic KeatingJohn Billings
Before you run your program, your directory should looklike this:
Please Answer With This Additional 2 Files Lab When Submitting This Lab Submit A Java File Called Formletter And Cr 1
Please Answer With This Additional 2 Files Lab When Submitting This Lab Submit A Java File Called Formletter And Cr 1 (272.26 KiB) Viewed 31 times
Opening one of the sample letter files in a document editorshould look like this:
Warning Letter to Student -.txt I am concerned with your current progress in CS 100. You have one or more missing assignments which is greatly hurting you grade. Please make every effort to get these assignments turned in for partial credit and ensure you complete all future assignments on time. I wish you the best in doing your part to succeed in this class. See below for a list of missing assignments. Sincerly, Professor Roddenberry