Home Answers Viewqa Java-Beginners the grade of students

 
 


ninenan
the grade of students
1 Answer(s)      a year and 7 months ago
Posted in : Java Beginners

Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the student�s programming mark. Determine how many student get A+ and A for their grade and how many students get D and E based on the following table:

Marks Grades 85-100 A+ 80-84 A 75-79 B+ 70-74 B 65-69 B- 60-64 C+ 55-59 C 50-54 C- 45-49 D+ 40-44 D 0 E

View Answers

October 24, 2011 at 11:37 AM


import java.util.Scanner;

public class StudentMarks {

    double totalMarks;
    String grade;

    public void setTotalMarks(double totalMarks) {
        this.totalMarks = totalMarks;
    }

    public double getTotalMarks() {
        return totalMarks;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getGrade() {
        return grade;
    }

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter number of students: ");
        int num = input.nextInt();
        StudentMarks data[] = new StudentMarks[num];
        for (int i = 0; i < data.length; i++) {
            System.out.println("Enter marks");
            double marks = input.nextDouble();
            data[i] = new StudentMarks();
            data[i].setTotalMarks(marks);
            if (marks < 40) {
                data[i].setGrade("E");
            }
            if (marks >= 40 && marks <= 44) {
                data[i].setGrade("D");
            }
            if (marks >= 45 && marks <= 49) {
                data[i].setGrade("D+");
            }
            if (marks >= 50 && marks <= 54) {
                data[i].setGrade("C-");
            }
            if (marks >= 55 && marks <= 59) {
                data[i].setGrade("C");
            }
            if (marks >= 60 && marks <= 64) {
                data[i].setGrade("C+");
            }
            if (marks >= 65 && marks <= 69) {
                data[i].setGrade("B-");
            }
            if (marks >= 70 && marks <= 74) {
                data[i].setGrade("B");
            }
            if (marks >= 75 && marks <= 79) {
                data[i].setGrade("B+");
            }
            if (marks >= 80 && marks <= 84) {
                data[i].setGrade("A");
            }
            if (marks >= 85 && marks <= 100)
                data[i].setGrade("A+");
        }

        int count1 = 0;
        int count2 = 0;
        int count3 = 0;
        int count4 = 0;
        for (int i = 0; i < num; i++) {
            StudentMarks show = data[i];
            String g = show.getGrade();
            if (g.equals("A+")) {
                count1++;
            }
            if (g.equals("A")) {
                count2++;
            }
            if (g.equals("D")) {
                count3++;
            }
            if (g.equals("E")) {
                count4++;
            }
        }
        System.out.println("Number of student getting A and A+ grade: "
                + (count1 + count2));
        System.out.println("Number of student getting D and E grade: "
                + (count3 + count4));
    }
}









Related Pages:
the grade of students
the grade of students  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the studentââ?¬â?¢s programming mark. Determine how many student get A+ and A for their grade
adding a method to calculate a students grade
adding a method to calculate a students grade  The Following program which displays a students name, id and mark works fine. But when i tried to add a method to display the grade based on the mark of the student i cant seem
create examination slip for students
create examination slip for students  hello,can anyone help me how to create examination slip that include subject code,courses,credit hours,grade ,and status
Java programs on students assesment
Java programs on students assesment  1) Write a Java program... subject marks. (v) Follow the table for grading: Average of Marks Grade < 40...) Output the Student name, Student id, subject marks, average mark and the grade
Write a program to display grade message according to the marks
of students and their marks and display the grade according to student's marks... is a code that accepts the number of students and their marks and display the grade...Write a program to display grade message according to the marks  pls
Highest average score among 25 students
the user to enter grades of 25 students in a class and grade them into 4 lessons... again the grade) calculate average per student and will calculate the highest average among students who should be printed. how can i solve this problem
final grade
a student?s final grade from 50-100. Evaluate the Final grade and display the Point...?s final grade from 50-100. Evaluate the Final grade and display the Point... final grade from 50-100. Evaluate the Final grade and display the Point
array of students with marks list
array of students with marks list  There are 4 array of numbers... students have got against each examination. The order of students remain same across all lists and also the number of students (4 in this case). Marks List 1
Write a JSP program to display the grade of a student by accepting the marks of five subjects.
Write a JSP program to display the grade of a student by accepting the marks of five subjects.  Write a JSP program to display the grade of a student by accepting the marks of five subjects
Internship in Delhi for Engineering Students
Internship in Delhi for Engineering Students Internship program in various software technologies for Engineering in Delhi & NCR. We are arranging the internship program in different software development technologies. All
Retrieve all the students in the same year(Java ArrayList)?
Retrieve all the students in the same year(Java ArrayList)?  ...); if(search != null){//if found 1 student by year do{//Search all students...;& !found_list.isEmpty()){ %> <html> "Displaying all the students
developing students dabase application implemented on oracle with support for object feature
developing students dabase application implemented on oracle with support for object feature   Design and develop a suitable Student Database application. One of the attributes to me maintained is the attendance of a student
Arithmetic Testing for School Students
Arithmetic Testing for School Students In this section, we have created an application that helps an elementary school student to learn arithmetic operations. This application allows the student to select the arithmetic operation
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.  write a java program to print marklist of "n " students. input Register number, name and marks of three subjects
Code to STOP Students from navigating anywhere else till the Online exam is over
Code to STOP Students from navigating anywhere else till the Online exam is over  hi guys i am a final year student of engineering and i am working on an ONLINE EXAMINATION SYSTEM just like GATE, GRE usually used by prometrics
c++ array find the average mark, highest mark, lowest mark, number of students passing,
c++ array find the average mark, highest mark, lowest mark, number of students passing,    i need help in adding the c++ code for the average mark, highest mark, lowest mark, number of students passing, using array. 01
c++ array find the average mark, highest mark, lowest mark, number of students passing,
c++ array find the average mark, highest mark, lowest mark, number of students passing,    i need help in adding the c++ code for the average mark, highest mark, lowest mark, number of students passing, using array. 01
What is Spring?
What is Spring?       Spring is great framework for development of Enterprise grade applications. Spring is a light-weight framework for the development
Please help with this code
= input.next(); System.out.println("What is the students grade...(); student.setName(name); student.setGrade(grade); students... for: "); int grade = input.nextInt(); if (result(grade, students
Java programming
Java programming       Java programming language is useful for development of enterprise grade applications. Java language comes in light from a language named Oak. Language Oak
Grades
Grades  Looking for help writing code for a Java Applet to store exam results from students. Upon entering the students names and exam results...: -Average Grade -Display lowest grade -Display highest grade -Sort and display
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  Write program which accepts five students id,name,age,department,courses, taken and its grade. a. calculate its GPA . display all student information in ascending order
java
of students in a class. Then, prompt user to input the student�s programming mark. Determine how many student get A+ and A for their grade and how many students
java beginner
java beginner  Write a program that will grade the students quiz... answers and the final grade as a percentage. The program will ask if the user want to grade another quiz
Java Example Codes and Tutorials
Java Tutorials - Java Example Codes and Tutorials Java is great programming language for the development of enterprise grade applications. This programming... of enterprise grade applications. Java language comes in light from a language named Oak
Record management application for a school
Record management application for a school In this section, we are going to create an application to record the information of all the students. All the data... of new students, edit the record of students and can delete the record
MySQL Network
-grade software, support and services directly from the developers of MySQL... problems before they occur  *Includes enterprise-grade software, support...; MySQL Network- Enterprise grade Database Achieving the highest levels
explaination
in order to count the number of students getting A, A+, D and E grade. To count.... import java.util.*; public class StudentMarks{ double totalMarks; String grade... double getTotalMarks(){ return totalMarks; } public void setGrade(String grade
using 2D Array
using 2D Array  Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C... should finally print the grade percentage (out of 100%) of each student, and also
using 2D Array
using 2D Array  Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C... should finally print the grade percentage (out of 100%) of each student, and also
please i want someone to answer me pleeeeeeeeeeeeease...
please i want someone to answer me pleeeeeeeeeeeeease...    Write a JAVA program using 2D array to auto-grade exams. For a class of N students, your... there are 5 questions in the test. Your program should finally print the grade
Online business management courses in India
opportunity to the students for a brighter career in the field. Many top... are the reason that a large number of students are unable to enroll with the institutions and that is why today students are opting online courses for business
flowchart and algorithm
A, A+, D and E grade. To count the number of students getting A and A+, the counter... StudentMarks { double totalMarks; String grade; public void setTotalMarks(double...() { return totalMarks; } public void setGrade(String grade) { this.grade
Problem analysis and algorithm design (i.e.: flowchart, algorithm)
)for this question.Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the students programming mark. Determine how many student get A+ and A for their grade and how many students get D and E based
Java Notes: Acknowledgements
Java Notes: Acknowledgements Students I'd like to thank the students at the following universities where I've had the pleasure of teaching. Assumption University, Thailand Universidad San Francisco de Quito, Ecuador University
MCA Project Training
; The training is designed for the MCA students who want to speed up... students. The students who have appeared for the fourth semester exam may also apply... may also apply for the course Computer Science students may also apply
what is the rong
what is the rong  Write a JAVA program to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each... print the grade percentage (out of 100%) of each student, and also the class
help for java
structure if student?s grade is greater than or equal to 90 Print ?A? else if student?s grade is greater than or equal to 80 Print ?B? else if student?s grade is greater than or equal to 70 Print ?C? else
Arrays, loops and string handling
students mark and the letter grade, and the class average... a program to mark and grade a set of multiple choice test results... for the number of students to process, thereafter the program must prompt the user
Java Training Online Class
. The competition in the field is fierce and students and professionals often look... of the students RoseIndia, offers online Java training classes to them. These online Java training classes are much in demand among students and professionals
Java Web Services Online Training
students and learners to make interactive web based services using Java and its..., Rose India offers customized training to the students so that they can master... services online training to the students so that they can master the various parts
how to solve this..
how to solve this..  Given a list of students and their marks Name... | 88 Grade : A = 100 - 90 B = 89 - 70 C = 69 - 50 D = 49 - 40 F = 39 - 0 Create an array for students and two
how to solve this..
how to solve this..  Given a list of students and their marks Name... | 88 Grade : A = 100 - 90 B = 89 - 70 C = 69 - 50 D = 49 - 40 F = 39 - 0 Create an array for students and two
java basics
java basics  1.Write a program that will grade the students quiz... answers and the final grade as a percentage. The program will ask if the user want to grade another quiz. 2Write a program that uses an array of 10 stings. Write
Student Result Application
a table for annual examination results for 10 students. For this, we have allowed...: a) Total marks obtained by each students b) The highest marks in each subject and roll no of the students who have secured it. c) The student who obtained
Java Online Training from Hyderabad
among students as it offers quality training to the students thanks to its... of students and professionals seek Java online training from Hyderabad as it offers
STUDENT MANAGEMENT SYSTEM
, COURSENAME, FEE, DETAILS) Result (STUDENTID, MONTH, YEAR, TOTAL, GRADE) Fee... :fee given report:view all students/courses :view result for a particular student/course :view fee details for a particular student/all students/course

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.