I need a prompt and GUI that allows the user to log in as a teacher, the password for the teacher login should be "Teacher123" and once the user logs in, it should display to the user a grade book, using this code below.
JAVA
I need a prompt and GUI that allows the user to log in as a teacher, the password for the teacher login should be "Teacher123" and once the user logs in, it should display to the user a grade book, using this code below.
import java.util.Scanner;
public class Teacher{
public static void main(String[] args) {
System.out.println("Enter the number of grades that are going to be calculated of that subject: "); //input
Scanner scanner = new Scanner(System.in);
int cla = scanner.nextInt();
double[] arr = new double[cla]; //Declaring array of elements
double total = 0;
for(int i=0; i<arr.length; i++){
System.out.print("Enter in grade #" +(i+1)+" : "); //input of the grade
arr[i] = scanner.nextDouble();
}
scanner.close();
for(int i=0; i<arr.length; i++){
total = total + arr[i];
}
double average = total / arr.length; //finding the total average
System.out.format("The average is: %.3f", average); //print from input
}
}
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)