Edit this code to be Allow to input a double number The code is //AssignmentMarks.java import java.util.Scanner; public class AssignmentMarks { XXXXXXXXXXpublic static void main(String[] args) { //...

Edit this code to be Allow to input a double number The code is //AssignmentMarks.java import java.util.Scanner; public class AssignmentMarks { public static void main(String[] args) { // defining number of students and assignments final int students_count = 5; final int assignments_count = 10; // initializing a 2d integer array int scores[][] = new int[students_count][assignments_count]; // scanner for reading input from keyboard Scanner sc = new Scanner(System.in); // looping through each index from 0 to students_count-1 for (int i = 0; i < students_count;="" i++)="" {="" each="" row="" represent="" marks="" of="" each="" student.="" so="" asking="" user="" to="" enter="" assignments_count="" marks="" for="" current="" student="" (one="" for="" each="" assignment)="" system.out.print("enter="" student="" #"="" +="" (i="" +="" 1)="" +="" "'s="" scores="" (out="" of="" 10)="" for="" "="" +="" assignments_count="" +="" "="" assignments:="" ");="" asking="" and="" reading="" assignment="" scores="" for="" current="" student,="" storing="" in="" scores="" array="" at="" index="" i="" for="" (int="" j="0;" j="">< assignments_count;="" j++)="" {="" scores[i][j]="sc.nextInt();" }="" }="" now="" we="" have="" read="" the="" marks,="" its="" time="" to="" count="" the="" 10s="" in="" each="" column="" (each="" column="" represent="" an="" assignment,="" so="" sum="" of="" 10s="" in="" each="" column="" is="" the="" number="" of="" students="" who="" got="" full="" scores="" for="" that="" assignment)="" looping="" through="" each="" column="" for="" (int="" i="0;" i="">< assignments_count;="" i++)="" {="" initializing="" count="" to="" 0="" int="" count_full="0;" looping="" through="" each="" row="" under="" current="" column="" for="" (int="" j="0;" j="">< students_count; j++) { // if score is 10, incrementing count if (scores[j][i] == 10) { count_full++; } } // displaying count of students who got full marks for current // assignment system.out.println(count_full + " student(s) scored full marks for assignment #" + (i + 1)); } } } students_count;="" j++)="" {="" if="" score="" is="" 10,="" incrementing="" count="" if="" (scores[j][i]="=" 10)="" {="" count_full++;="" }="" }="" displaying="" count="" of="" students="" who="" got="" full="" marks="" for="" current="" assignment="" system.out.println(count_full="" +="" "="" student(s)="" scored="" full="" marks="" for="" assignment="" #"="" +="" (i="" +="" 1));="" }="" }="">
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here