Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Fubarable

Thread: i want help >>>>

  1. #1
    shoje is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default i want help >>>>

    i went code to get the max ,min number and avg for the following code :






    import java.util.Scanner;
    class Student{
    int mark1;
    int mark2;

    Student(int mar1, int mar2){
    mark1=mar1;
    mark2=mar2;
    }

    public int getMark1(){ return mark1; }
    public int getMark2(){ return mark2;}

    public int findTotal(){
    int ft=mark1+mark2;
    return ft;
    }

    }
    class Driver{
    public static void main(String[] arg){
    Scanner sk=new Scanner(System.in);

    Student[] stu=new Student[5];

    for(int i=0; i<5; i++){
    System.out.println("Enter the mark1 and mark2 of Student5: "+(i+1));
    int mar1=sk.nextInt();
    int mar2=sk.nextInt();
    stu[i]=new Student(mar1,mar2);}

    for(int i=0; i<5; i++){
    System.out.println("Details of Rectangle "+(i+1));
    System.out.println("=====================");
    System.out.println("Mark1: "+stu[i].getMark1());
    System.out.println("Height: "+stu[i].getMark2());
    System.out.println("Total: "+stu[i].findTotal());
    System.out.println("=====================");
    }


    }

    }






    i hope from you help me

    thanx alot

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: i want help >>>>

    Quote Originally Posted by shoje View Post
    i went code to get the max ,min number and avg for the following code :
    Sorry, this isn't a homework-doing service. We'll be more than happy to help you understand things so you can write code, but we're not here to provide you with code on demand. Please feel free to re-ask this question, just ask an actual question where you tell us where you're stuck or just what you don't understand. Please don't state that you "want code" though or your question will be locked again.
    quad64bit likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •