declare a 20-element one dimensional array using the following numbers to initia
ID: 3530936 • Letter: D
Question
declare a 20-element one dimensional array using the following numbers to initialize the array: 88,72,99,20,66,95,100,72,88,78,45,57,89,85,78,75,88,72, and 88. the procudre should prompt the user to enter a score from 0 thourgh 100. it then should display (in a Message Box) the number of students who earned that score.Explanation / Answer
import java.util.Scanner; class College { public static void main(String[] args) { double testGPA; int testScore; Scanner input = new Scanner(System.in); System.out.println("Welcome to Student Admisions"); System.out.println("Please student prospects GPA: "); testGPA = input.nextDouble(); System.out.println("Now enter prospect students Test Score: "); testScore = input.nextInt(); System.out.println("-----------------------"); if (testGPA >= 0.0 && testGPA = 0 && testScore = 3.0 && testScore >= 60 || testScore >= 85){ System.out.println("Student is ACCEPTED to university!"); System.out.println("Students GPA is a " + testGPA + " and students test score is a " + testScore + "%"); } else { System.out.println("Student is NOT ACCEPTED to university!"); System.out.println("Students GPA is a " + testGPA + " and students test score is a " + testScore + "%"); } } else{ System.out.println("Please Check GPA and Test score input!"); System.out.println("Your inputs were:"); System.out.println(testGPA + " = GPA should be between 0.0 and 4.0."); System.out.println(testScore + " = Test Score should be between 0 and 100"); } } }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.