Question

In: Computer Science

Create a java program that will do the following: Create a method called getInt.Allow the user...

Create a java program that will do the following:

Create a method called getInt.Allow the user to enter up to 20 student names,and for each student 3 quiz scores (in the range 0-100). Once input is done, display each student’s name, their three quiz scores, and their quiz score average, one student per line. The output table does not need to line up perfectly in columns.Use dialog boxes for all input and output.Use the method to input the three scores.Parameter 1 is a String, used for the input prompt (example:“Enter the number of objects ordered"). Use 5 arrays, one for the names, 3 for the scores, and one for the average.Write a method that takes three values and returns their average, and use this to calculate each student’s average.

Solutions

Expert Solution

package as1;

import java.util.Scanner;

public class Application2 {
   public static void main(String[] args) {
       int i=0;
       Scanner sc=new Scanner(System.in);
       System.out.println("enter number of students ");
       int number=sc.nextInt();
String[]   student_name=new String[number];
       int [] quiz1=new int[number];
       int[] quiz2=new int[number];
int[]       quiz3=new int[number];
       float avg[]=new float[20];


       while(i<number){
          
  
           System.out.println("enter student name");
           String name=sc.next();
           student_name[i]=name;
           ///System.out.println(student_name[i]);
           System.out.println("enter first quiz score");
           int quiz_score1=sc.nextInt();
           quiz1[i]=quiz_score1;
           System.out.println("enter second quiz score");
           int quiz_score2=sc.nextInt();
           quiz2[i]=quiz_score2;
           System.out.println("enter third quiz score");
           int quiz_score3=sc.nextInt();
           quiz3[i]=quiz_score3;
           // for average
           avg[i]=((quiz1[i]+quiz2[i]+quiz3[i])/3);
          
           i++;
          
          
          
       }
       System.out.println("name quiz 1 quiz 2 quiz 3 average ");
       for(int j=0;j<=number-1;j++){
          
           System.out.println(student_name[j]+" "+quiz1[j]+" "+quiz2[j]+" "+quiz3[j]+" "+avg[j] );
       }
      
      
   }
  

}


Related Solutions

Java Programing Write a program called reverseProg.   This program will do the following Asks the user...
Java Programing Write a program called reverseProg.   This program will do the following Asks the user to input a string, it reads the string and does the followings Prints the string in reverse order. Displays the characters that are in position 7th, 8th and 9th of this string Displays the length of the string Displays the string in all UPPER CASE Sample output example: Enter a string: Wilmington University String Entered is: Wilmington University Wilmington University spelled backward is: ytsirevinU...
***JAVA PROGRAM Write a method called shrink that accepts an array of integers (that the user...
***JAVA PROGRAM Write a method called shrink that accepts an array of integers (that the user inputs) as a parameter and returns a new array containing the result of replacing each pair of integers with the sum of that pair. For example, if an array called list stores the values {7, 2, 8, 9, 4, 15, 7, 1, 9, 10}, then the call of shrink(list) should return a new array containing {9, 17, 19, 8, 19}. The first pair from...
Create a Netbeans project called LineNumbers The program should do the following: –Ask the user for...
Create a Netbeans project called LineNumbers The program should do the following: –Ask the user for how many lines of text they wish to enter –Declare and initialize an array of Strings to hold the user’s input –Use a while loop to prompt for and read the Strings (lines of text) from the user at the command line. Typically, this would be a 'for' loop since we know the number of times to execute the loop based upon the number...
Java programming Question1 You will create a full program called LetterGrade that will have the user...
Java programming Question1 You will create a full program called LetterGrade that will have the user enter in 2 test scores as double values. It will compute the average and then using else..if statements it will display the letter grade based on my grading scale listed in the course outline.
5) Create the following in a Java program Create a scanner Prompt the user to enter...
5) Create the following in a Java program Create a scanner Prompt the user to enter the name where the box of mail is shipping from and create the variable and relate to scanner Prompt the user to enter the name of destination where the box of mail will be shipped and create the variable and relate to scanner Prompt the user to enter the weight of the package and create variable to relate to scanner Calculate cost of shipping...
Create a Java method that does the following: 1) Ask the user for a dividend and...
Create a Java method that does the following: 1) Ask the user for a dividend and a divisor both of "int" type. 2) Computes the remainder of the division. The quotient (answer) must be of the "int" type. Do NOT use the method " % " provided in Java in your code. Remember that it gives wrong answers when some of the inputs are negative. Please see the videos for the explanation.
Create a Java method that does the following: 1) Ask the user for a dividend and...
Create a Java method that does the following: 1) Ask the user for a dividend and a divisor both of "int" type. 2) Computes the remainder of the division. The quotient (answer) must be of the "int" type. Do NOT use the method " % " provided in Java in your code. Remember that it gives wrong answers when some of the inputs are negative. Here is the code that I have so far I can't seem to get it...
Create a Java method that does the following: 1) Ask the user for a dividend and...
Create a Java method that does the following: 1) Ask the user for a dividend and a divisor both of "int" type. 2) Computes the remainder of the division. The quotient (answer) must be of the "int" type. Do NOT use the method " % " provided in Java in your code. Remember that it gives wrong answers when some of the inputs are negative. Please see the videos for the explanation. This is the code I have from the...
6) Create the following in a Java Program: Create payroll system Prompt the user to enter...
6) Create the following in a Java Program: Create payroll system Prompt the user to enter payroll information Employee name and create variable for scanner Hours worked Hourly pay rate Federal tax rate State tax rate Declare variable doubles for gross pay, federal, state and total deduction Display payroll statement example: Name of employee Hours worked Hourly pay rate Gross pay which is equal hours worked multiply hourly pay rate Federal withholding which is equal of gross pay multiply federal...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user to enter the name of the month he/she was born in (example: September). b) Prompt the user to enter his/her weight in pounds (example: 145.75). c) Prompt the user to enter his/her height in feet (example: 6.5). d) Display (print) a line of message on the screen that reads as follows: You were born in the month of September and weigh 145.75 lbs. and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT