Advertisement

11.12.2004 at 11:00PM PST, ID: 21205541
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

java program problem

Asked by yuen_jk in Miscellaneous Programming

Tags: , ,

why is it that my gpa are shown as 0.0 and it's not a value??
below is the code that i include together...please help


import java.io.*;
public class Assignment
{
      public static void main(String[]args)throws IOException
      {
      
      
      try{

      int grade=0;
      float gpa;

      BufferedReader input = new BufferedReader(
            new InputStreamReader(System.in));

      System.out.print("Enter Student Id :");
      String s_id = input.readLine();

      System.out.print("Enter Student Name :");
      String s_name = input.readLine();

      System.out.print("\nEnter Grade for CS211 :");
      String cs211 = input.readLine();

      System.out.print("Enter Grade for CS212 :");
      String cs212 = input.readLine();

      System.out.print("Enter Grade for CS213 :");
      String cs213 = input.readLine();

      System.out.print("Enter Grade for CS214 :");
      String cs214 = input.readLine();

      System.out.print("Enter Grade for CS215 :");
      String cs215 = input.readLine();

      System.out.print("Enter admission test score :");
      String admission = input.readLine();



      if(cs211=="a" || cs211=="A")
      
            grade=4;
      else

            if(cs211=="b" || cs211=="B")
                  grade=3;
            else

                  if(cs211=="c" || cs211=="C")
                        grade=2;
                  else      
      
                        if(cs211=="d" || cs211=="D")
                              grade=1;



      if(cs212=="a" || cs212=="A")
      
            grade=grade+4;
      else

            if(cs212=="b" || cs212=="B")
                  grade=grade+3;
            else

                  if(cs212=="c" || cs212=="C")
                        grade=grade+2;
                  else      
      
                        if(cs212=="d" || cs212=="D")
                              grade=grade+1;



      if(cs213=="a" || cs213=="A")
      
            grade=grade+4;
      else

            if(cs213=="b" || cs213=="B")
                  grade=grade+3;
            else

                  if(cs213=="c" || cs213=="C")
                        grade=grade+2;
                  else      
      
                        if(cs213=="d" || cs213=="D")
                              grade=grade+1;



      if(cs214=="a" || cs214=="A")
      
            grade=grade+4;
      else

            if(cs214=="b" || cs214=="B")
                  grade=grade+3;
            else

                  if(cs214=="c" || cs214=="C")
                        grade=grade+2;
                  else      
      
                        if(cs214=="d" || cs214=="D")
                              grade=grade+1;


      if(cs215=="a" || cs215=="A")
      
            grade=grade+4;
      else

            if(cs215=="b" || cs215=="B")
                  grade=grade+3;
            else

                  if(cs215=="c" || cs215=="C")
                        grade=grade+2;
                  else      
      
                        if(cs215=="d" || cs215=="D")
                              grade=grade+1;
      


      gpa=(float)grade/5;

      
      System.out.println("\n\nStudent Id :" +s_id);
      System.out.println("Student Name :" +s_name);
      System.out.println("\n\nCS211 :"+cs211);
      System.out.println("CS212 :"+cs212);
      System.out.println("CS213 :"+cs213);
      System.out.println("CS214 :"+cs214);
      System.out.println("CS215 :"+cs215);
      System.out.println("GPA :" +gpa+ " and Admission test score: "+admission);

      
      }catch(Exception e){System.out.println("["+e+"]");}
      }
}

Start Free Trial
[+][-]11.12.2004 at 11:26PM PST, ID: 12572478

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.13.2004 at 05:33AM PST, ID: 12573863

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.13.2004 at 05:47AM PST, ID: 12573944

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Miscellaneous Programming
Tags: cs214, java, program
Sign Up Now!
Solution Provided By: ldbkutty
Participating Experts: 3
Solution Grade: A
 
 
[+][-]11.13.2004 at 09:13AM PST, ID: 12574882

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2004 at 09:19PM PST, ID: 12581373

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.14.2004 at 09:26PM PST, ID: 12581389

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.15.2004 at 01:30AM PST, ID: 12582323

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.15.2004 at 07:22AM PST, ID: 12584405

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43