Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
0 like 0 dislike
in JECRC University B.Tech(CSE-V Sem) Java Programming Lab by Goeduhub's Expert (5.8k points)

Given the following attributes: Regno(int), Name(string), Marks in subjects(Integer Array), Total (int)

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 360/- || For International Students- $9.99/-


Course Name



Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence || Labeled as Highest Rated Course by Udemy

Apply Coupon


Complete Machine Learning & Data Science with Python| ML A-Z Apply Coupon


Complete Python Programming from scratch | Python Projects Apply Coupon
    More Courses

1 Answer

0 like 0 dislike
by Goeduhub's Expert (5.8k points)
edited by
Best answer

Program Code


import java.util.*;

class Student


   Scanner sc=new Scanner(;

   int RegNo,Total=0,subjects;

   String name;

   int marks[];



      System.out.print("Enter Registration No.: ");


      System.out.print("Enter Student Name: ");;;



   public void getDisMarks()


       marks=new int[3];

       System.out.print("Enter marks of Physics: ");


       System.out.print("Enter marks of Chemistry: ");


       System.out.print("Enter marks of Maths: ");


       for(int i=0;i<3;i++)




       System.out.println("Total Marks of student "+name+": " +Total);



class StudentDemo


    public static void main(String args[])


        Student s[]=new Student[5];

        for(int i=0;i<5;i++)

              s[i]=new Student();




Enter Registration No.: 624

Enter Student Name: Ankit

Enter marks of Physics: 95

Enter marks of Chemistry: 94

Enter marks of Maths: 95

Total Marks of student Ankit: 284

Enter Registration No.: 527

Enter Student Name: Aditya

Enter marks of Physics: 97

Enter marks of Chemistry: 93

Enter marks of Maths: 89

Total Marks of student Aditya: 279

Enter Registration No.: 093

Enter Student Name: Namrata

Enter marks of Physics: 85

Enter marks of Chemistry: 90

Enter marks of Maths: 95

Total Marks of student Namrata: 270

Enter Registration No.: 123

Enter Student Name: Unknown

Enter marks of Physics: 69

Enter marks of Chemistry: 79

Enter marks of Maths: 89

Total Marks of student Unknown: 237

Enter Registration No.: 789

Enter Student Name: Known

Enter marks of Physics: 75

Enter marks of Chemistry: 65

Enter marks of Maths: 24

Total Marks of student Known: 164

For more JU V Sem Java Lab Experiments Click here

3.3k questions

7.1k answers


4.6k users

Related questions


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  |