Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package generalPractice1;
- /*
- * Practice Problem:
- * - There are a ton of students and you need to determine what letter grade each student got depending on their
- * percentage.
- * - Print out how many of each letter grade there are using a count variable.
- * - print each student's name along with their percentage and grade letter. One student per line.
- */
- public class Main {
- public static void main(String[] args) {
- int[] grades = {30, 60, 85, 50, 90, 40, 90, 95, 99, 54};
- String[] students = {"Harry", "Josh", "Kyle", "Katelyn", "Tommy", "Jackson", "Jane", "Conner", "Paul", "Nancy"};
- }
- public static void checkGrades() {
- for (int i: grades) {
- System.out.println(i);
- if (i >= 90) {
- System.out.println("This user has an A!"); }
- else if (i >= 80) {
- System.out.println("This user has a B!"); }
- else if (i >= 70) {
- System.out.println("This user has a C!"); }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment