
Concept explainers
Explanation of Solution
Program:
File name: “TestGrade.java”
//Import necessary header files
import java.util.*;
//Define a class named TestGrade
public class TestGrade
{
//Define a main method
public static void main(String args[]) throws Exception
{
//Create an object for Scanner class
Scanner input = new Scanner(System.in);
//Declare an array to store eight student ID numbers
int[] ids = {1234, 1245, 1267, 1278, 2345,
1256, 3456, 3478, 4567, 5678
};
//Declare test letter grades
char[] grades = new char[10];
String gradeString = new String();
//Declare the variables and initialize the values
final int HIGHLIMIT = 100;
String inString, outString = "";
int flag = 0;
//For loop to be executed until x exceeds 8
for (int x = 0; x < ids.length; ++x)
{
//Prompt the user to enter a letter grade for the //student
System.out.println("Enter letter grade for student id number: " + ids[x]);
inString = input.next();
grades[x] = inString.charAt(0);
//Try
try
{
TestGrade.isValidGrade(grades[x]);
}
//Catch the GradeException
catch(GradeException e)
{
//Print an appropriate message
System.out.println(e);
//Store I for student for whom
//an exception is caught
grades[x] = 'I';
}
}
//For loop to be executed until x exceeds 8
for (int x = 0; x < ids...

Trending nowThis is a popular solution!

Chapter 12 Solutions
Mindtap Programming, 1 Term (6 Months) Printed Access Card For Farrell's Java Programming, 9th
- Outline the overall steps for configuring and securing Linux servers Consider and describe how a mixed Operating System environment will affect what you have to do to protect the company assets Describe at least three technologies that will help to protect CIA of data on Linux systemsarrow_forwardNode.js, Express, Nunjucks, MongoDB, and Mongoose There are a couple of programs similar to this assignment given in the lecture notes for the week that discusses CRUD operations. Specifically, the Admin example and the CIT301 example both have index.js code and nunjucks code similar to this assignment. You may find some of the other example programs useful as well. It would ultimately save you time if you have already studied these programs before giving this assignment a shot. Either way, hopefully you'll start early and you've kept to the schedule in terms of reading the lecture notes. You will need to create a database named travel using compass, then create a collection named trips. Use these names; your code must work with my database. The trips documents should then be imported unto the trips collection by importing the JSON file containing all the data as linked below. The file itself is named trips.json, and is available on the course website in the same folder as this…arrow_forwardusing r languagearrow_forward
- using r languagearrow_forwardusing r languagearrow_forwardWrite a short paper (1 page/about 500 words) summarizing what we as System Admins can do to protect the CIA of our servers. Outline the overall steps for configuring and securing Linux servers Consider and describe how a mixed Operating System environment will affect what you have to do to protect the company assets Describe at least three technologies that will help to protect CIA of data on Linux systems Required Resourcesarrow_forward
- using r language Estimate the MSE of the level k trimmed means for random samples of size 20 generated from a standard Cauchy distribution. (The target parameter θis the center or median; the expected value does not exist.) Summarize the estimates of MSE in a table for k= 1,2,...,9arrow_forwardusing r language Estimate the MSE of the level k trimmed means for random samples of size 20 generated from a standard Cauchy distribution. (The target parameter θis the center or median; the expected value does not exist.) Summarize the estimates of MSE in a table for k= 1,2,...,9arrow_forwardusing r language The data law82 in bootstrap library contains LSAT and GPA for 82 law schools. Compute a 95% bootstrap t confidence interval estimates for the correlation statisticsarrow_forward
- using r language The data law82 in bootstrap library contains LSAT and GPA for 82 law schools. Compute a 95% bootstrap t confidence interval estimates for the correlation statisticsarrow_forwardusing r langauge The data law82 in bootstrap library contains LSAT and GPA for 82 law schools. Compute and compare the three 95% bootstrap confidence interval estimates for the correlation statistics.arrow_forwardWhat is the number of derangements of size k from the set {1,2,...n} to the set {1,2,...n} so that f(x) != x exactly k times with 1 <= k <= narrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning




