Write the statements to convert the string representation


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

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write the statements to convert the string representation
Reference No:- TGS01249668

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)