Write a complete Java program that do the following:
1. Get student information (first name and last name) from the user and store it
in the array named studentName (first name and last name are stored in the
first and last index of the studentName array).
2. Print elements of the array studentName using enhanced for statement.
3. Get student’s ID from the user, store it in the array named studentID and
print it
4. Find and print the sum and average of the array- studentID.
Typical runs of the program:
Note: Your answer should have the code as text as well as the screenshot of the program output (using your own student’s name and ID as part of your answer). Otherwise, zero marks will be awarded.
in the basic des of ming prof e, and Write a complete Java program that do the following: 1. Get student information (first name and last name) from the user and store it in the array named student Nume (first name and last name are stored in the first and last index of the studentName array). 2. Print elements of the array studentame using enhanced for statement. 3. Get student's ID from the teser, store it in the array med student and print it 4. Find and print the sum and average of the array- studentIÐ. fects of simming agos Zuricelcons of the program enter your time and lant Alba And that ter your de Your student 1234567890 The of your students. the verge of your stat' sd . ---- Note: Your answer should have the code as text as well as the screenshot of the program output (using your own stardent's name and ID es part of your answer Otherwise, gero marks will be awarded. 02 Question One Answer import java.util.Scanner public class Q1 public static void main(String[] args) double sum 0.0 double average 00: Scanners bew Scanner(System.in); String student Name new String 2 System.out.printlnter your testame studentNamejscetine);
Write a complete Java program that do the following: 1. Get student information (first name and last name) from the user
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am