p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_java thread: RE: check overall percentage


Message #1 by "naveedm" <naveedm@e...> on Tue, 9 Apr 2002 17:06:11 +0500
This is a multi-part message in MIME format.

------=_NextPart_000_0014_01C1DFE8.D9C222B0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

 hello Shan
 
            thanks a lot. 

-----Original Message-----
From: shan [mailto:shan@a...] 
Sent: Tuesday, April 09, 2002 3:46 PM
To: Beginning Java
Subject: [beginning_java] RE: check overall percentage


this line of code should be as follows. 
per=((java+oop+rdbms)*100/300); 
 
If u don't understand, please let me know i will explain you later.  I
am very busy right now.
 
Thanks
Shan

-----Original Message-----
From: naveedm [mailto:naveedm@e...]
Sent: 09 April 2002 12:11
To: Beginning Java
Subject: [beginning_java] check overall percentage


hello everyone ,
 
                i make a simple program in which i want to take overall
percentage of three subjects but it always give result zero. pleaze
check this code and help me
 
thanks in advance.
 
import java.io.*;
 
class GradeTest 
{
 public static void main(String args[]) throws IOException
{
 double per;
 int java;
 int oop;
 int rdbms;
 String num1,num2,num3;
 int opt;
 BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
 while(true) 
 { 
  
 System.out.println("Enter Your java Marks ::");
 
  
 num1=br.readLine(); 
 
 java =Integer.parseInt(num1);
 
 System.out.println("Enter Your OOPS Marks ::"); 
 
  
 num2=br.readLine();
 
 oop  =Integer.parseInt(num2); 
 


 System.out.println("Enter Your RDBMS Marks ::"); 
 
  
 num3=br.readLine();
 
 rdbms=Integer.parseInt(num3);
 
 
 if (java>100||rdbms>100||oop>100)
  
    {
     System.out.println("You enter wrong number please again enter::");

     
    } 
   
 if (java<=100&&rdbms<=100&&oop<=100)
 
 {
 per=((java+oop+rdbms)/300)*100;        
 
 System.out.println("Your overall percentage is "+per+"%");  // here it
return always zero
 
 if (java>=90&&java<=100)
 
    System.out.println("In JAVA you get A Grade");
 
 if (java>=80&&java<=89)
 
    System.out.println("In JAVA you get B Grade");    
 
 if (java>=70&&java<=79)
 
    System.out.println("In JAVA you get C Grade");
 
 if (java>=60&&java<=69)
 
    System.out.println("In JAVA you get D Grade");
 
 if (java<=59)
 
    System.out.println("You are Fail in JAVA");
 
 if (oop>=90&&oop<=100)
 
    System.out.println("In OOP you get A Grade");
 
 if (oop>=80&&oop<=89)
 
    System.out.println("In OOP you get B Grade");    
 
 if (oop>=70&&oop<=79)
 
    System.out.println("In OOP you get C Grade");
 
 if (oop>=60&&oop<=69)
 
    System.out.println("In OOP you get D Grade");
 
 if (oop<=59)
 
    System.out.println("You are Fail in OOP");
 
 if (rdbms>=90&&rdbms<=100)
 
    System.out.println("In RDBMS you get A Grade");
 
 if (rdbms>=80&&rdbms<=89)
 
    System.out.println("In RDBMS you get B Grade");    
 
 if (rdbms>=70&&rdbms<=79)
 
    System.out.println("In RDBMS you get C Grade");
 
 if (rdbms>=60&&rdbms<=69)
 
    System.out.println("In RDBMS you get D Grade");
 
 if (rdbms<=59)
 
    System.out.println("You are Fail in RDBMS");
 
 
 break;
 } 
 

 }
}
 
}
--- 
Do you need true END-TO-END (e2e) Java Messaging (JMS)? Softwired 
offers industry's ONLY complete 100% JMS messaging solutions for your 
needs TODAY. 
Visit
http://adtracking.wrox.com/track.asp?x=p2p%2Fe%2Fjava%2Dsoftwired&url=ww
w.softwired-inc.com Our unique product range includes: iBus//Mobile
(wireless data), 
iBus//MessageBus (IP Multicast), iBus//MessageServer (store and forward)

and much more! 
--- 
======================================================= 
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error, please notify the
sender or the System Administrator at esbi.rousch@e... .The
unauthorized use, disclosure or alteration of this message is strictly
forbidden. Moreover, this message has been scanned for the presence of
computer viruses. 


--- 
Do you need true END-TO-END (e2e) Java Messaging (JMS)? Softwired 
offers industry's ONLY complete 100% JMS messaging solutions for your 
needs TODAY. 
Visit
http://adtracking.wrox.com/track.asp?x=p2p%2Fe%2Fjava%2Dsoftwired&url=ww
w.softwired-inc.com Our unique product range includes: iBus//Mobile
(wireless data), 
iBus//MessageBus (IP Multicast), iBus//MessageServer (store and forward)

and much more! 
--- 


=======================================================
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error, please notify the sender or the System Administrator at
esbi.rousch@e... .The unauthorized use, disclosure or alteration of this message is strictly forbidden. Moreover, this
message has been scanned for the presence of computer viruses.


Message #2 by "naveedm" <naveedm@e...> on Tue, 9 Apr 2002 16:11:27 +0500
This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C1DFE1.351F6490
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

hello everyone ,
 
                i make a simple program in which i want to take overall
percentage of three subjects but it always give result zero. pleaze
check this code and help me
 
thanks in advance.
 
import java.io.*;
 
class GradeTest 
{
 public static void main(String args[]) throws IOException
{
 double per;
 int java;
 int oop;
 int rdbms;
 String num1,num2,num3;
 int opt;
 BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
 while(true) 
 { 
  
 System.out.println("Enter Your java Marks ::");
 
  
 num1=br.readLine(); 
 
 java =Integer.parseInt(num1);
 
 System.out.println("Enter Your OOPS Marks ::"); 
 
  
 num2=br.readLine();
 
 oop  =Integer.parseInt(num2); 
 

 System.out.println("Enter Your RDBMS Marks ::"); 
 
  
 num3=br.readLine();
 
 rdbms=Integer.parseInt(num3);
 
 
 if (java>100||rdbms>100||oop>100)
  
    {
     System.out.println("You enter wrong number please again enter::");

     
    } 
   
 if (java<=100&&rdbms<=100&&oop<=100)
 
 {
 per=((java+oop+rdbms)/300)*100;        
 
 System.out.println("Your overall percentage is "+per+"%");  // here it
return always zero
 
 if (java>=90&&java<=100)
 
    System.out.println("In JAVA you get A Grade");
 
 if (java>=80&&java<=89)
 
    System.out.println("In JAVA you get B Grade");    
 
 if (java>=70&&java<=79)
 
    System.out.println("In JAVA you get C Grade");
 
 if (java>=60&&java<=69)
 
    System.out.println("In JAVA you get D Grade");
 
 if (java<=59)
 
    System.out.println("You are Fail in JAVA");
 
 if (oop>=90&&oop<=100)
 
    System.out.println("In OOP you get A Grade");
 
 if (oop>=80&&oop<=89)
 
    System.out.println("In OOP you get B Grade");    
 
 if (oop>=70&&oop<=79)
 
    System.out.println("In OOP you get C Grade");
 
 if (oop>=60&&oop<=69)
 
    System.out.println("In OOP you get D Grade");
 
 if (oop<=59)
 
    System.out.println("You are Fail in OOP");
 
 if (rdbms>=90&&rdbms<=100)
 
    System.out.println("In RDBMS you get A Grade");
 
 if (rdbms>=80&&rdbms<=89)
 
    System.out.println("In RDBMS you get B Grade");    
 
 if (rdbms>=70&&rdbms<=79)
 
    System.out.println("In RDBMS you get C Grade");
 
 if (rdbms>=60&&rdbms<=69)
 
    System.out.println("In RDBMS you get D Grade");
 
 if (rdbms<=59)
 
    System.out.println("You are Fail in RDBMS");
 
 
 break;
 } 
 
 
 }
}
 
}

=======================================================
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error, please notify the sender or the System Administrator at
esbi.rousch@e... .The unauthorized use, disclosure or alteration of this message is strictly forbidden. Moreover, this
message has been scanned for the presence of computer viruses.


Message #3 by "shan" <shan@a...> on Tue, 9 Apr 2002 11:46:07 +0100
This is a multi-part message in MIME format.

------=_NextPart_000_005A_01C1DFBC.22D47840
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Messagethis line of code should be as follows.
per=((java+oop+rdbms)*100/300);

If u don't understand, please let me know i will explain you later.  I am
very busy right now.

Thanks
Shan
  -----Original Message-----
  From: naveedm [mailto:naveedm@e...]
  Sent: 09 April 2002 12:11
  To: Beginning Java
  Subject: [beginning_java] check overall percentage


  hello everyone ,

                  i make a simple program in which i want to take overall
percentage of three subjects but it always give result zero. pleaze check
this code and help me

  thanks in advance.

  import java.io.*;

  class GradeTest
  {
   public static void main(String args[]) throws IOException
  {
   double per;
   int java;
   int oop;
   int rdbms;
   String num1,num2,num3;
   int opt;
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   while(true)



   System.out.println("Enter Your java Marks ::");


   num1=br.readLine();

   java =Integer.parseInt(num1);

   System.out.println("Enter Your OOPS Marks ::");


   num2=br.readLine();

   oop  =Integer.parseInt(num2);


   System.out.println("Enter Your RDBMS Marks ::");


   num3=br.readLine();

   rdbms=Integer.parseInt(num3);


   if (java>100||rdbms>100||oop>100)

      {
       System.out.println("You enter wrong number please again enter::");

      }

   if (java<=100&&rdbms<=100&&oop<=100)

   {
   per=((java+oop+rdbms)/300)*100;

   System.out.println("Your overall percentage is "+per+"%");  // here it
return always zero

   if (java>=90&&java<=100)

      System.out.println("In JAVA you get A Grade");

   if (java>=80&&java<=89)

      System.out.println("In JAVA you get B Grade");

   if (java>=70&&java<=79)

      System.out.println("In JAVA you get C Grade");

   if (java>=60&&java<=69)

      System.out.println("In JAVA you get D Grade");

   if (java<=59)

      System.out.println("You are Fail in JAVA");

   if (oop>=90&&oop<=100)

      System.out.println("In OOP you get A Grade");

   if (oop>=80&&oop<=89)

      System.out.println("In OOP you get B Grade");

   if (oop>=70&&oop<=79)

      System.out.println("In OOP you get C Grade");

   if (oop>=60&&oop<=69)

      System.out.println("In OOP you get D Grade");

   if (oop<=59)

      System.out.println("You are Fail in OOP");

   if (rdbms>=90&&rdbms<=100)

      System.out.println("In RDBMS you get A Grade");

   if (rdbms>=80&&rdbms<=89)

      System.out.println("In RDBMS you get B Grade");

   if (rdbms>=70&&rdbms<=79)

      System.out.println("In RDBMS you get C Grade");

   if (rdbms>=60&&rdbms<=69)

      System.out.println("In RDBMS you get D Grade");

   if (rdbms<=59)

      System.out.println("You are Fail in RDBMS");


   break;
   }


   }
  }

  }
  ---
  Do you need true END-TO-END (e2e) Java Messaging (JMS)? Softwired
  offers industry's ONLY complete 100% JMS messaging solutions for your
  needs TODAY.
  Visit
http://adtracking.wrox.com/track.asp?x=p2p%2Fe%2Fjava%2Dsoftwired&url=www.so
ftwired-inc.com Our unique product range includes: iBus//Mobile (wireless
data),
  iBus//MessageBus (IP Multicast), iBus//MessageServer (store and forward)
  and much more!
  =======================================================
  This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please notify the sender or the
System Administrator at esbi.rousch@e... .The unauthorized use,
disclosure or alteration of this message is strictly forbidden. Moreover,
this message has been scanned for the presence of computer viruses.





  Return to Index