
a.
Explanation of Solution
Program:
File name: “CollegeCourse.java”
//Define a class named CollegeCourse
public class CollegeCourse
{
//Declare the private variables
private String courseID;
private int credits;
private char grade;
//Define a get method that returns the course ID
public String getID()
{
//Return the value
return courseID;
}
//Define a get method that returns the credit hours
public int getCredits()
{
//Return the value
return credits;
}
//Define a get method that returns the letter grade
public char getGrade()
{
//Return the value
return grade;
}
//Define a set method that takes the course ID
public void setID(String idNum)
{
//Assign the value
courseID = idNum;
}
//Define a set method that takes the credit hours
public void setCredits(int cr)
{
//Assign the value
credits = cr;
}
//Define a set method that takes the letter grade
public void setGrade(char gr)
{
//Assign the value
grade = gr;
}
}
File name: “Student...
b.
Explanation of Solution
Program:
File name: “InputGrades.java”
//Import necessary header files
import college.CollegeCourse;
import college.Student;
import javax.swing.*;
//Define a class named InputGrades
public class InputGrades
{
//Define a main method
public static void main(String[] args)
{
//Declare an array to store data of 10 students
Student[] students = new Student[10];
//Declare the variables and initialize the values
int x, y, z;
String courseEntry, entry = "", message;
int idEntry, credits;
char gradeEntry = ' ';
boolean isGoodGrade = false;
final int NUM_COURSES = 5;
//Declare an array to store five grades
char[] grades = {'A', 'B', 'C', 'D', 'F'};
//For loop to be executed until x exceeds 10
for(x = 0; x < students.length; ++x)
{
//Create a student object
Student stu = new Student();
//Prompt the user to enter the student ID
entry = JOptionPane.showInputDialog(null, "For student #" +
(x + 1) + ", enter the student ID");
idEntry = Integer.parseInt(entry);
//Function call
stu.setID(idEntry);
//For loop to be executed until y exceeds 5
for(y = 0; y < NUM_COURSES; ++y)
{
//Prompt the user to enter the course
courseEntry = JOptionPane.showInputDialog(null,
"For student #" + (x + 1) + ", enter course #" +
(y + 1));
//Prompt the user to enter the credits for each //course
entry = JOptionPane.showInputDialog(null,
"For student #" + (x + 1) +
", enter credits for course #" + (y + 1));
credits = Integer.parseInt(entry);
//Assign the value false to isGoodGrade
isGoodGrade = false;
//While the user does not enter isGoodGrade
while(!isGoodGrade)
{
//Prompt the user to enter the grade for //course
entry = JOptionPane.showInputDialog(null,
"For student #" + (x + 1) +
", enter grade for course #" + (y + 1));
gradeEntry = entry...

Trending nowThis is a popular solution!

- The attached picture shows the RTCAPI memory mapped register which has the address 0x180. 1) Program the MCU's registers so that a) SIRC is the clock source b) the clock is divided by 16K c) the clock is enabled d) load is enabledarrow_forwardWhat is the ALU result if the 4-bit ALU Control signal is 0100? What happens if the ALU Control signal is 0101?arrow_forwardIn the past, encryption and decryption were mostly done by substitution and permutation of letters in a text message. study those classic cryptographic schemes Then, develop an automatic cipher using a programming language of your choice. The cipher should be able to perform the following tasks: generate keys encrypt a given plaintext message with a key selected from the list of keys generated decrypt a given ciphertext message with a known cipher keyarrow_forward
- Case Study Instructions: Offshore Wind Energy in the North Sea For this case study, students will analyze the institutional challenges and social rules surrounding offshore wind energy development in the Dutch North Sea, as explored in the case study from the textbook (pages 44-46). Additional resources in this week’s learning module will provide further perspectives on the impact of wind energy on different stakeholders. Students should refer to the syllabus for specific guidelines regarding length, format, and content requirements. Reflection Questions to Consider: What are the key institutional challenges in implementing offshore wind energy in the North Sea? How do formal and informal social rules shape the use of this shared space? What conflicts arise between different stakeholders (e.g., fishermen, naval transport, military, and wind energy developers)? How can policymakers balance economic, environmental, and social considerations when allocating space for wind energy?…arrow_forwardAlphabetic Telephone Number TranslatorMany companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion: A, B, and C = 2 D, E, and F = 3 G, H, and I = 4 J, K, and L = 5 M, N, and O = 6 P, Q, R, and S = 7 T, U, and V = 8 W, X, Y, and Z = 9 Write a program that asks the user to enter a 10-character telephone number in the format XXX-XXX-XXXX. The application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For example, if the user enters 555-GET-FOOD, the application should display 555-438-3663.arrow_forwardI would like help to resolve the following casearrow_forward
- 7. Character AnalysisIf you have downloaded the source code you will find a file named text.txt in the Chapter 08 folder. Write a program that reads the file’s contents and determines the following: The number of uppercase letters in the file The number of lowercase letters in the file The number of digits in the file The number of whitespace characters in the filearrow_forwardProvide the full blue terminal commands & output and other things that are usefularrow_forwardHomework You have the row vector (A) that has values from (-100 to 100), write MATLAB codes to: (1) Interchange the first 10 elements with last ten elements. (2) Replace the elements at indices (93,9,17,50) of A with 99. (3) Return the second element and the element before the last of A as a column vector (C1). (4) Extract the first five elements and the last five elements of A and append them as a row vector (R). (5) Set the elements of A with odd indices to zeros(0).arrow_forward
- if the error in a closed-loop Servo motor system is zero, why does the motor Contimac ranning instead of stoppingarrow_forwardWhen the FCC added Color Television to the Industry Standards, they went with the system developed in the 1940s by Peter Goldman for CBS. Question 15 options: True False Part of the reason that many critics disliked 1950s gameshows was the fact that gameshows offered one of the few opportunities to see unscripted interactions with "real" (average/non-famous) people on television. Question 16 options: True False The Andy Griffith Show is an example of the "rural revival" shows that become enormously popular on 1960s American television. Question 19 options: True False During the Network Era, the hours before primetime each day were exclusively devoted to locally-produced programming, not programming dictated by an affiliate station's parent network. Question 20 options: True Falsearrow_forwardAlthough color television was not added to the industry standard until 1956, CBS had been broadcasting selected special events in color as early as 1950. Question 1 options: True False Two key factors in creating the Network Era of American television were the FCC licensing freeze and ______________. Question 4 options: The Quiz Show Scandals Habitual Viewing Operation Frontal Lobes Drop-In Viewing Least Objectionable Programming was designed to embrace the public service-oriented vision of using television to elevate mass culture and enrich viewers. Question 6 options: True False By the end of the 1950s, all three remaining networks (NBC, CBS, & ABC) were broadcasting their entire nightly programming schedule in full color. Question 9 options: True Falsearrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT



