I have been working on writing a java program (that goes with another I just got finished- see below CollegeCourse & Student) that prompts user to put in letter grades (A-F) for 5 different courses for a total of 10 different students.  So I need to prompt user to input a student ID, then the 1st course ID, then the grade, then the 2nd course ID- then grade, the the 3rd course ID then grade, then the 4th course ID then grade, then finally the 5th course ID then grade. Then it needs to go through the same thing 10 times (for a total of 10 students). It also says the user is asked to "Enter ID for student #s" where s is an integer from 1 through 10, indicating the student (and I don't really know how to do that but I tried as I googled java); AND "Enter course ID #n, where n is an integer from 1 through 5, indicating the course number. And last it needs to verify for grade entry that only the A, B, C, D, or F are entered. I started writing notes to try to keep track of where thing are but I'm getting really confused. When I tried to compile it of course it has errors... So I really need some guidence/ help you can provide.  Here's my code: import java.util.*; import stud.*; class InputGrades extends CollegeCourse { public static void main(String[] args) //main method { student[] students = new Student[10]; //declare array for 10 students info entered for int t,r,d; //declare variables for stu id, course numb, gradesand initialize String courseIDEntry, entry = " "; int sIDEntry, CreditHoursEntry; char letterGradeEntry= ' '; boolean isLetterGradeGood = false; //to verify letter A=F is put in final int NUM_COURSEID=5; //variable cannot be changed to have more than 5 courses per student char[]lettergrade= ['A', 'B', 'C', 'D', 'F']; //declare array of 5 grades for(t=0;t< students.length; ++t) //for loop that runs to let only 10 students ID's to be entered { Student stu = newStudentDetails(); //create student Scanner input = new Scanner(System.in); //prompt user to put in student ID do System.out.print("Enter student #" + (t+1) + ", enter the student ID number"); for(t=0;t

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I have been working on writing a java program (that goes with another I just got finished- see below CollegeCourse & Student) that prompts user to put in letter grades (A-F) for 5 different courses for a total of 10 different students. 
So I need to prompt user to input a student ID, then the 1st course ID, then the grade, then the 2nd course ID- then grade, the the 3rd course ID then grade, then the 4th course ID then grade, then finally the 5th course ID then grade. Then it needs to go through the same thing 10 times (for a total of 10 students).
It also says the user is asked to "Enter ID for student #s" where s is an integer from 1 through 10, indicating the student (and I don't really know how to do that but I tried as I googled java); AND "Enter course ID #n, where n is an integer from 1 through 5, indicating the course number.
And last it needs to verify for grade entry that only the A, B, C, D, or F are entered.
I started writing notes to try to keep track of where thing are but I'm getting really confused. When I tried to compile it of course it has errors...

So I really need some guidence/ help you can provide. 

Here's my code:

import java.util.*;
import stud.*;

class InputGrades extends CollegeCourse
{
public static void main(String[] args) //main method
{

student[] students = new Student[10]; //declare array for 10 students info entered for

int t,r,d; //declare variables for stu id, course numb, gradesand initialize

String courseIDEntry, entry = " ";
int sIDEntry, CreditHoursEntry;
char letterGradeEntry= ' ';
boolean isLetterGradeGood = false; //to verify letter A=F is put in
final int NUM_COURSEID=5; //variable cannot be changed to have more than 5 courses per student

char[]lettergrade= ['A', 'B', 'C', 'D', 'F']; //declare array of 5 grades

for(t=0;t< students.length; ++t) //for loop that runs to let only 10 students ID's to be entered
{
Student stu = newStudentDetails(); //create student

Scanner input = new Scanner(System.in); //prompt user to put in student ID

do
System.out.print("Enter student #" + (t+1) + ", enter the student ID number");

for(t=0;t<NUM_COURSES;++t)
{

Scanner input = new Scanner(System.in); //prompt user to put in course ID

do
System.out.print("student #" + (t+1) + ", enter the course ID #" + (r+1));


Scanner input = new Scanner(System.in); //prompt user to put in credit hours

do
System.out.print("student #" + (t+1) + ", enter the credit hours #" +(r=1));

Scanner input = new Scanner(System.in); //prompt user to put in letter grade
do
System.out.print("student #" + (t+1) + ", enter the letter grade #" +(r=1));
lettergradeEntry = entry.charAt(0);

}
}
{
//display student all info
Scanner.out.print(null, "For student number" + (t+1)+ ",enter course number" + (r+1));

Scanner.out.print(null, "For student number" + (t+1) + ",enter credits for course number" + (r+1));
credithours = Integer.parseInt(entry);

isGoodLetterGrade=false;
while(!isGoodLetterGrade)
{
Scanner.out.print(null, "For student number" + (t + 1) +",enter grade for course number" + (r + 1));

lettergradeEntry=entry.charAt(0);

for(z=0;z<lettergrade.length; ++z)
{

if(lettergradeEntry==lettergrade[z])
isGoodLetterGrade=true;
}
}

}

Scanner.out.println;

}
}

____________________________________________________________________________

public class CollegeCourse
{

private String courseID;
private int creditHours;
private char letterGrade;

public String getCourseID()
{
return courseID;
}

public int getCreditHours()
{
return creditHours;
}

public char getLetterGrade()
{
return letterGrade;
}

public void setCourseID(String idNum)
{

courseID=idNum;
}

public void setCreditHrs(int ch)
{

creditHours=ch;
}

public void setLetterGrade(char gd)
{
letterGrade=gd;
}
}

____________

class Student extends CollegeCourse
{

private int sID;

CollegeCourse[]obj = new CollegeCourse[5];

public int getSID()
{
return sID;
}

public void setSID(int SIDNum)
{
sID=SIDNum;
}
public CollegeCourse getCollegeCourse(int i)
{
return obj[i];
}

public void setCollegeCourse(CollegeCourse c, int i)
{
obj[i]=c;
}
public static void main(String args[])
{
CollegeCourse c1 = new CollegeCourse();
c1.setCourseID("CIS 210");
c1.setCreditHrs(3);
c1.setLetterGrade('A');

Student s1 = new Student();
s1.setSID(1);

s1.setCollegeCourse(c1,0);
CollegeCourse c2 = new CollegeCourse();

c2 = s1.getCollegeCourse(0);

System.out.println("Return for one of the student college course details-");
System.out.println(" Course ID: " + c2.getCourseID());
System.out.println(" Credit Hours: " + c2.getCreditHours());
System.out.println(" Letter Grade: " + c2.getLetterGrade());
}
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education