Jump to content

REDRIDINGHOODS

Member
  • Posts

    17
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Profile Information

  • Gender
    Male
  • Location
    Philippines
  • Interests
    Programming
  • Biography
    I'm a first-year college student taking up BSIT
  • Occupation
    Student

System

  • CPU
    AMD-A6-6400K APU with Radeon(tm) HD Graphics 3.90 GHz
  • Motherboard
    GIGABYTE GA-F2A68HM-S1-rev-10
  • RAM
    4x2 DDR3 Ram
  • GPU
    Nvidia Gt-610 2GB
  • Storage
    Seagate 1TB Harddrive
  • PSU
    Generic 550w
  • Operating System
    Windows 7 Ultimate 64x

REDRIDINGHOODS's Achievements

  1. I will try to learn this type of method but I still don't understand how an object works. I will try to learn on how this works. Also thank you for giving me a tip. I hope you have a nice day!
  2. the thing is my professor didn't teach us the 2d arrays and I didn't know that it exist. Thank you for the tip also
  3. thank you for the tip and explaning to me how 2d array works. I got my program fixed and ready to function well. You made my day thank you!
  4. what if I had to enter the number students and the number of exams then store the each students scores in the array? like this (5).mkv
  5. can you teach me how to create an object and explain how it works?
  6. The user has 2 students and 2 exams which creates the number sets the value to the array. then the user inputs the id number (2 students) then inputs the exams(2 exams). the program would calculate the sum of each students scores and gets the average. the program would individualy prints the id number, scores and the average. sorry for my bad english
  7. Good Day Everyone, I'm a first year student currently learning arrays using java. I created a program in which the user enters the id number and the test score, then it should compute its average and display the id number, test scores and average. The problem in my program which I can't display all the scores and average but it can display the inputted id number. Sorry for my bad english. import java.util.*; public class arrayactivity1 { static Scanner console = new Scanner(System.in); public static void main(String[] args) { int NumberofStudent = 0; int NumberofExam = 0; int k = 0; System.out.print("Enter the Numher of Students: "); NumberofStudent = console.nextInt(); System.out.print("\nEnter the Number of Exams: "); NumberofExam = console.nextInt(); int[] idNumber = new int[NumberofStudent]; int[] Exam = new int[NumberofExam]; System.out.println("\nEnter the Id Number of the Students: "); for(int i = 0 ; i < NumberofStudent ; i++)//Inputted ID Number of students from the user { idNumber[i] = console.nextInt(); } for(int i = 0 ; i < NumberofStudent ; i++)//prints the id number and enters the score of the student { System.out.println("\nId Number: " + idNumber[i]); System.out.println("Enter the Score of the Sudent: "); for(int j = 0; j < NumberofExam ; j++) { Exam[j] = console.nextInt(); } } int[] AverageScore = new int[NumberofExam]; int SumofAllExams = 0; int TotalofGivenExam = 0; TotalofGivenExam = Exam.length; for(int j = 0; j < NumberofExam ; j++)//calculates the sum of the exams of each students { SumofAllExams += Exam[j]; } for(int i = 0; i < NumberofExam ; i++)//calculates the average scores of each students { AverageScore[i] = SumofAllExams / TotalofGivenExam; } System.out.println("\n\n\t\t~RESULT~"); for(int i = 0; i < NumberofStudent ; i++)//prints out the id number of each students { System.out.println("\n\tId Number: " + idNumber[i]); System.out.println("\tScore of all the Exams: "); for(int j = 0 ; j < NumberofStudent ; j++) //prints out the scores exams of each students { k++; System.out.print("\tExam No." + k); System.out.println(" \tScore: \t" + Exam[j]); } System.out.println("\tAverage Score: " + AverageScore[i]); k = 0; } } }
  8. I mistyped it was "jre1.8.0_281", but it is the latest one on Java's websitet
  9. Thanks a lot. I thought I needed to upgrade and update my OS (Windows 7).
  10. The java runtime that I downloaded is version Java SE Development Kit 15.0.2 (which is the recent one on java's website) and, it runs perfectly on notepad++. But the problem is why I can't execute my program on cmd.
  11. I'm new on java programming but it occured a problem which is this:
  12. thank you for the tip and sorry i used uppercase in my program. I'm trying my best to understand and learn programming in C.
×