Close
Close

Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.

   NaniKammila034

It is one of practicing question in Codesdopes but I can’t do this, can anyone help me to solve this and get clarity in arrays of objects with dynamic initialization, please.

  • Its very simple
    - umairsahb
  • help me with this code with python
    - nafisul_mukit
  • help me with this code
    - Jerono

Answers

  •    Imran18

    import java.util.Scanner;


    public class pp4 {

        public static void main(String[] args) {

            String roll;

            float s1,s2,s3;

            Scanner sc = new Scanner(System.in);


            for(int i=1; i<=8; i++){

                    System.out.print("\nEnter Your Roll Number: ");

                    roll = sc.next();


                    System.out.print("Enter Your First Subject Mark: ");

                    s1 = sc.nextFloat();

                    System.out.print("Enter Your Second Subject Mark: ");

                    s2 = sc.nextFloat();

                    System.out.print("Enter Your Third Subject Mark: ");

                    s3 = sc.nextFloat();


                    float avg = (s1 + s2 + s3) / 3;


                    if(s1<=100 && s2<=100 && s3<=100){

                        System.out.printf("\nAverage Mark of Roll Number %s is %.1f\n", roll, avg);

                    }

                    else{

                        System.out.println("\nPlease Enter Your Marks Between 0 to 100");

                    }

                }

        }

    }



  •    frederickgragg

    Introducing the revolutionary TECH-V8 dumps [2023], the ultimate power boost for all your technological endeavors. Designed to surpass expectations, this cutting-edge solution unlocks unparalleled performance and efficiency. With its state-of-the-art architecture, TECH-V8 empowers you to conquer the digital landscape with ease. Its lightning-fast processing speed and expanded memory capacity ensure seamless multitasking, enabling you to tackle complex tasks effortlessly. Equipped with advanced security features, your data remains safeguarded at all times. Embrace the future of technology with TECH-V8 dumps [2023], the pinnacle of innovation. Experience unparalleled speed, unmatched reliability, and limitless possibilities. Upgrade to the next generation and revolutionize your digital journey with TECH-V8 dumps [2023].



  •    seoexpertim

    The finest aspect of contract-negotiation is the security measures they've implemented. As a consequence, I'm completely infatuated with it. It is highly recommended for you!



Ask Yours
Post Yours
Write your answer