Question

In: Computer Science

Exercise 2: You are employed as a work study student on campus and have been asked...

Exercise 2:

You are employed as a work study student on campus and have been asked by a professor to create a spreadsheet to help with final grade reporting. The professor would like to record final grades for 10 students. The first column should contain the student’s last name (input), the second column should contain the student’s first name (input), and the third column should contain the student’s final course percentage grade (input) -- enter as a whole number, not a percent…ie: 85 not .85 or 85%. The fourth column will be the output and will use a LOOKUP formula to calculate the letter grade earned in the course.

The professor’s grading scale is as follows:

A            90-100

B            80-89

C            70-79

D            60-69                  

F            Below 60

Solutions

Expert Solution

Short Summary:

Implemented the program as per requirement in java (as coding language is not mentioned in the question)
Attached source code and sample output


**************Please do upvote to appreciate our time. Thank you!******************

Source Code:

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

/** This class generates a spreadsheet with student data **/
public class CSVOperations {

   public static void main(String args[]) throws IOException
   {
       //Initialize array with size
       try   
       {
           //Use Scanner to get user data
           Scanner in=new Scanner(System.in);
           //BufferedWriter to write csv data
           BufferedWriter outputWriter = new BufferedWriter(new FileWriter("C:\\Users\\asus\\GradeReport.csv"));
           outputWriter.write("Last Name"+","+"First Name"+","+"Final Score"+","+"Grade"+"\n");
           //Iterate and write to same csv file
           for(int i=0;i<10;i++)
           {
               System.out.print("Enter student last name: ");
               String lname=in.nextLine();
               System.out.print("Enter student first name: ");
               String fname=in.nextLine();
               System.out.print("Enter student's final grade:(Enter as whole number 85,90 etc.,)");
               int gradeScore=in.nextInt();
               char grade='A';
               if(gradeScore>=90 && gradeScore<=100)
                   grade='A';
               else if(gradeScore>=80 && gradeScore<90)
                   grade='B';
               else if(gradeScore>=70 && gradeScore<80)
                   grade='C';
               else if(gradeScore>=60 && gradeScore<70)
                   grade='D';
               else if(gradeScore<60)
                   grade='F';
               in.nextLine();
              
               outputWriter.write(lname+","+fname+","+gradeScore+","+grade);
               outputWriter.newLine();

           }
           in.close();
           outputWriter.close();
       }
       catch (IOException e)   
       {
           e.printStackTrace();
       }   
   }
}

Code Screenshot:

Output:

Have attached output for first 3 records:

CSV file:


**************Please do upvote to appreciate our time. Thank you!******************


Related Solutions

2) You have been asked to study whether there are any differences in the proportions of...
2) You have been asked to study whether there are any differences in the proportions of stores that have experienced a return rate of the shirt over the recent period of at least 20% based upon the region of the country where the stores are located. Random samples of stores in four regions of the country are selected. The sample data concerning whether the store has experienced a return rate of at least 20% for the item over the given...
You are just starting work at a new health department and you have been asked to...
You are just starting work at a new health department and you have been asked to outline the steps that should be taken to update the department’s preparedness plan for an influenza outbreak. Outline the steps of the report and explain why each is an important component of a preparedness plan.
You have been asked by the CFO of the company where you work or previously worked...
You have been asked by the CFO of the company where you work or previously worked to evaluate the use of a professional service organization for processing the company’s payroll. Identify the top-three issues that should be discussed when considering contracting the services of a payroll service provider. Evaluate the impact, both positive and negative, of each issue on the process in question. Provide specific examples to support your response. Using the information from the e-Activity, identify the key elements...
You have been asked by the CFO of the company where you work or previously worked...
You have been asked by the CFO of the company where you work or previously worked to evaluate the use of a professional service organization for processing the company’s payroll. Identify the top-three issues that should be discussed when considering contracting the services of a payroll service provider. Evaluate the impact, both positive and negative, of each issue on the process in question. Provide specific examples to support your response. Using the information from the e-Activity, identify the key elements...
You have been asked by the CFO of the company where you work or previously worked...
You have been asked by the CFO of the company where you work or previously worked to evaluate the use of a professional service organization for processing the company’s payroll. Identify the top-three issues that should be discussed when considering contracting the services of a payroll service provider. Evaluate the impact, both positive and negative, of each issue on the process in question. Provide specific examples to support your response. Using the information from the e-Activity, identify the key elements...
Imagine you work for an industrial chemical company and you have been asked to design a...
Imagine you work for an industrial chemical company and you have been asked to design a novel cleaning agent against a group of microorganisms. Select a specific organism representative of the group you chose, gather information about it, and identify the potential "target" within the organism suitable for your cleanser to attack, discussing how your chemical will control the growth of the organism.
You work for Altuve Company and you have been asked to research the issues presented in...
You work for Altuve Company and you have been asked to research the issues presented in the case and questions and to prepare a memo that addresses the issues and questions. Altuve Company, an SEC registrant, is a construction company that manufactures commercial and residential buildings. On March 1, 2019, the Company entered into an agreement with a customer, Judge Offices, to construct an office building for a fixed price of $3 million. The Company estimates that it will incur...
(Q.5 As a student of corporate valuation ,You have been asked to estimated the value of...
(Q.5 As a student of corporate valuation ,You have been asked to estimated the value of Nomad limited, aprivate company using the discounted cash flow approach .You have been provided with the following information to enable you carry out the assignment. On 31st December 2016,Nomad Limited earned Kenya shillings Five(5,000,000) million in earnings Before interest and Tax on revenue of Kenya shillings 30 million.The following extracts on data has also been provided for the financial year 2016. (i) Total amount...
You have been asked to work, as an adviser, on a major infrastructure project. It involves...
You have been asked to work, as an adviser, on a major infrastructure project. It involves a response to the prospect of coastal flooding. The investment suggested is to build a seawall. Critically assess this suggestion. [We are particularly interested in how your advice would be structured, based on whether the situation we are dealing with (the prospect of coastal flooding) represents a “risky”, “uncertain”, or “fundamentally uncertain” situation.]
You work for a shipping line and have been asked to issue a Switch Bill of...
You work for a shipping line and have been asked to issue a Switch Bill of Lading because the goods covered have been resold on the high-seas and the discharge port has now been changed to another port, at which your ship also calls. Analyze FIVE (5) points you should check to protect the shipping line from any possible claims before issuing the Switch Bill of Lading.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT