Question

Develop an interactive program to assist a Philosophy professor in reporting students’ grades for his PHIL-224.N1...

Develop an interactive program to assist a Philosophy professor in reporting students’ grades for his PHIL-224.N1 to the Office of Registrar at the end of the semester.

Display an introductory paragraph for the user then prompt the user to enter a student record (student ID number and five exam-scores – all on one line). The scores will be in the range of 0-100. The sentinel value of -1 will be used to mark the end of data.

The instructor has decided to drop the lowest of the five scores. Your program should compute and store in memory the student average and the corresponding letter grade (A = 90%, B = 80%, C = 70%, D = 60%, F = 0%) based on the best (top) four exam-scores. For each student display in a box, the ID number, average (based on five scores), new average (based on best four scores), letter-grade (based on best four scores), and the lowest score with appropriate labels. You can use characters such as “*” or “+” to form/decorate the four sides of the box.

At the end, display a nice summary report to include the following items with appropriate labels: (a) class average based on the five scores and (b) class average based on the best four scores, (c) Number of A’s, B’s, C’s, D’s, and F’s (based on the best four scores only), and (d) the total number of records processed.

Use the following data set as input. Remember that for each of the five exam-scores your program is to output two sets of average and letter-grade (one before dropping the lowest score and one after).

Input Data

Student ID #                       Exam 1                  Exam 2                  Exam 3                  Exam 4                  Exam 5

11111                                            90                           90                           80                           90                   90

22222                                            100                         88                           87                           93             90

33333                                            80                           80                           80                           80         72

44444                                            80                           0                              0                              60      70

55555                                            70                           68                           66                           64             62

66666                                            77                           77                           77                           66           77

-1

Notes:

  1. See the next page for an example of input/output of the program.
  2. Develop an algorithm for this problem using either flowcharting or the pseudo-code technique.
  3. Documentation is necessary.
  4. Turn in a copy of the source code (using File, Print options), the program output (screen shots or the copy/paste technique and the use of MS Word).
  5. Run your program using the above data.
  6. Please direct your questions to the instructor.
  7. Please stop by his office during his office hours if you need any help.

An example of a portion of input and output of the program using two records may look something like the following:

.

.

.

Please enter student id and five scores all on one line <-1 to exit>.

11111 90 90 80 90 90

+++++++++++++++++++++++++++

+ Student ID:                    11111    +

+ Average:                         88.0        +

+ Lowest Score:                80.0        +

+ New Average:              90.0        +

+ Letter Grade:                A             +

+++++++++++++++++++++++++++

Please enter student id and five scores all on one line <-1 to exit>.

22222 100 88 87 93 90

+++++++++++++++++++++++++++

+ Student ID:                    11111    +

+ Average:                         91.6        +

+ Lowest Score:                87.0        +

+ New Average:              92.8        +

+ Letter Grade:                A             +

+++++++++++++++++++++++++++

.

.

.

Bonus Points Opportunities (earn up to 10 points):

  • Calculate letter grades based on the plus-and-minus grading system mentioned in the course syllabus (number of A’s, number of A-‘s, number of B+’s etc.)
  • Include the count of (number of) each of the available grades in the summary report.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER :

Please fine below the required code:

//LetterGrade.java

import java.util.Scanner;

public class LetterGrade {

//static variable for storing the count of grade

static int aCount,bCount,cCount,dCount,fCount;

public static void main(String[] args) {

String [] students = new String[100];

int count=0;

Scanner sc = new Scanner(System.in);

System.out.println("Enter the students when done enter -1 on new line");

String line="";

while(true)

{

line=getInput(sc);

if(line.equals("-1"))break;

students[count++]=line;

}

for(int i=0;i<count;i++)

{

String array[] = students[i].split(" ");

double sum=0;

int noOfExam=0;

for(int j=1;j<array.length;j++) {

noOfExam++;

sum+=Integer.valueOf(array[j]);

}

double avg = sum/(double)noOfExam;

System.out.println("**********************");

System.out.println("*"+String.format("%1$-20s", "ID : "+array[0])+"*");

System.out.println("*"+String.format("%1$-20s", "Average : "+String.format("%.2f", avg))+"*");

System.out.println("*"+String.format("%1$-20s", "Grade : "+getGrade(avg))+"*");

System.out.println("**********************");

System.out.println();

}

System.out.println("\nReport after dropping the minimum no \n");

//after dropping lowest

for(int i=0;i<count;i++)

{

String array[] = students[i].split(" ");

int min=Integer.MAX_VALUE;

double sum=0;

int noOfExam=0;

for(int j=1;j<array.length;j++)

{

if(Integer.valueOf(array[j])<min)

min=Integer.valueOf(array[j]);

sum+=Integer.valueOf(array[j]);

noOfExam++;

}

sum=sum-min;//dropped the min value

double avg = sum/(double)(noOfExam-1);

System.out.println("**********************");

System.out.println("*"+String.format("%1$-20s", "ID : "+array[0])+"*");

System.out.println("*"+String.format("%1$-20s", "Average : "+String.format("%.2f", avg))+"*");

System.out.println("*"+String.format("%1$-20s", "Grade : "+getGrade(avg))+"*");

System.out.println("**********************");

System.out.println();

}

//printing the summary

System.out.println("****************SUMMARY**********************\n");

System.out.println("No Of Record Processed : "+count);

System.out.println("No Of A Grade : "+aCount);

System.out.println("No Of B Grade : "+bCount);

System.out.println("No Of C Grade : "+cCount);

System.out.println("No Of D Grade : "+dCount);

System.out.println("No Of F Grade : "+fCount);

System.out.println("************************************************");

sc.close();

}

/*

* method for taking the input

*/

private static String getInput(Scanner sc)

{

String id ;String marks;

System.out.print("Enter the student id : ");

id= sc.nextLine();

if(id.equals("-1"))return "-1";

System.out.print("Enter the marks seprate by space : ");

marks= sc.nextLine();

return id+" "+marks;

}

private static char getGrade(double avg)

{

if(avg>=90) {

aCount++;

return 'A';

}

else if(avg<90 && avg >=80) {

bCount++;

return 'B';

}

else if(avg<80 && avg>=70) {

cCount++;

return 'C';

}

else if(avg<70 && avg>=60)

{

dCount++;

return 'D';

}

fCount++;

return 'F';

}

}

//OUTPUT

Add a comment
Know the answer?
Add Answer to:
Develop an interactive program to assist a Philosophy professor in reporting students’ grades for his PHIL-224.N1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • c++ implement a student class Determine the final scores, letter grades, and rankings of all students...

    c++ implement a student class Determine the final scores, letter grades, and rankings of all students in a course. All records of the course will be stored in an input file, and a record of each student will include the first name, id, five quiz scores, two exam scores, and one final exam score. For this project, you will develop a program named cpp to determine the final scores, letter grades, and rankings of all students in a course. All...

  • Java Program: In this project, you will write a program called GradeCalculator that will calculate the...

    Java Program: In this project, you will write a program called GradeCalculator that will calculate the grading statistics of a desired number of students. Your program should start out by prompting the user to enter the number of students in the classroom and the number of exam scores. Your program then prompts for each student’s name and the scores for each exam. The exam scores should be entered as a sequence of numbers separated by blank space. Your program will...

  • In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each gr...

    In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:-...

  • C ++ . In professor Maximillian’s course, each student takes four exams. A student’s letter grade...

    C ++ . In professor Maximillian’s course, each student takes four exams. A student’s letter grade is determined by first calculating her weighted average as follows:                                                 (score1 + score2 + score3 + score4 + max_score) weighted_average = -----------------------------------------------------------------------                                                                                                 5 This counts her maximum score twice as much as each of the other scores. Her letter grade is then a A if weighted average is at least 90, a B if weighted average is at least 80...

  • using java Program: Please read the complete prompt before going into coding. Write a program that...

    using java Program: Please read the complete prompt before going into coding. Write a program that handles the gradebook for the instructor. You must use a 2D array when storing the gradebook. The student ID as well as all grades should be of type int. To make the test process easy, generate the grade with random numbers. For this purpose, create a method that asks the user to enter how many students there are in the classroom. Then, in each...

  • SOLVE IN PYTHON:Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes...

    SOLVE IN PYTHON:Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array....

  • Write a grading program for the following grading policies:- a. There are two quizzes, each graded...

    Write a grading program for the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:- >90 A >=80 and <90 B...

  • please use the c language Assignment 12 The program to write in this assignment is a...

    please use the c language Assignment 12 The program to write in this assignment is a program that calculates score statistics and manages the grades of the students. First, the student list and are given in a file named "student.dat" as in the following: 이성우 77 홍길동 88 scores 201 1710086 2012700091 This program reads the input file "student.dat" and keeps this data in a linear linked list. Each node must be a struct which contains the following: student id...

  • in C porgraming . use #include〈stdio.h〉 #include〈stdlib.h〉 Assignment 12 The program to write in this assignment...

    in C porgraming . use #include〈stdio.h〉 #include〈stdlib.h〉 Assignment 12 The program to write in this assignment is a program that calculates score statistics and manages the grades of the students. First, the student list and scores are given in a file named "student.dat" as in the following: 이성우 77 홍길동 88 2011710086 2012700091 This program reads the input file "student.dat" and keeps this data in a linear linked list. Each node must be a struct which contains the following: student_id,...

  • Write a complete C++ program that reads students names and their test scores from an input...

    Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT