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.
Question One (2 2 Marks) 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: enter your first and last name? Ahmad Alhambi your name is Ahmad Alharbi enter your student's ID NO 0 Your student's NO is 234567890 The sum of your student's id is 44.0 The average of your student's id is 4.888888888888889 ----GRASP: operation complete. 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.
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