Java Program: Interactive Grading System Using Swing
Not what you're looking for?
Need assistance trying to figure out the Java Program that is attached.
Need assistance with the java program below.
1. Declare two String variables named testScoreString and classRankString.
2. Declare two integer variables named testScore and classRank.
3. Write the interactive input statements to retrieve a student's test score and class rank from the user of the program.
4. Write the statements to convert the String representation of a student's test score and class rank to the integer data type.
/* Program Name: CollegeAdmission.java
Function: This program determines if a student will be admitted or rejected.
Input: Interactive
Output: Accept or Reject
*/
import javax.swing.JOptionPane;
public class CollegeAdmission
{
public static void main(String args[])
{
// Declare variables
// Get input and convert to correct data type
// Test using admission requirements and print Accept or Reject
if( testScore >= 90 )
{
if( classRank >= 25)
{
System.out.println("Accept");
}
else
System.out.println("Reject");
}
else
{
if( testScore >= 80 )
{
if( classRank >= 50 )
System.out.println("Accept");
else
System.out.println("Reject");
}
else
{
if( testScore >= 70 )
{
if( classRank >=75 )
System.out.println("Accept");
else
System.out.println("Reject");
}
else
System.out.println("Reject");
}
}
} // End of main() method
} // End of CollegeAdmission class
Purchase this Solution
Solution Summary
This solution provides assistance for a java program.
Solution Preview
Dear student,
Thanks for restricting your post to me.
Please find the solution attached.
Thanks,
Kavita Narang
Modify The code to look like the following --
// Get input and convert to correct data type
testScoreString = javax.swing.JOptionPane.showInputDialog ("Enter the test score"); // Read test score as user input.
classRankString = javax.swing.JOptionPane.showInputDialog ("Enter the class Rank"); // Read class rank as user input.
// Use the Integer.parseInt method to convert a string to integer.
testScore = Integer.parseInt(testScoreString);
classRank = Integer.parseInt(classRankString);
Program:
Need assistance with the java program below.
1. Declare two ...
Purchase this Solution
Free BrainMass Quizzes
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
Basic Computer Terms
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.
C# variables and classes
This quiz contains questions about C# classes and variables.
Word 2010: Table of Contents
Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.
Javscript Basics
Quiz on basics of javascript programming language.