Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa IDE-Questions Problem analysis and algorithm design (i.e.: flowchart, algorithm)

Have Programming Question? Ask it here!
 
 
 


ninenan
Problem analysis and algorithm design (i.e.: flowchart, algorithm)
1 Answer(s)      2 years and 10 months ago
Posted in : IDE Questions


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 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.


Advertisement
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 Tutorials/Questions & Answers:
Problem analysis and algorithm design (i.e.: flowchart, algorithm)
Problem analysis and algorithm design (i.e.: flowchart, algorithm)  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
algorithm
algorithm  convert this algorithm to java code IsSample_PAS: 1.for every attribute value aj belongs to ti do begin (here aj=1,2...,ti=1,2..) 2.if(CF... false; (this is algorithm from ieee paper QUALITY AWARE SAMPLING AND ITS
Advertisements
algorithm
algorithm  Hi all, i have a task which is create an algorithm from a java code.and i need help from u guys to check on my algo put a comment... on this matter... thanks a lot. here is my algorithm: > Input
Algorithm - Java3D
Algorithm  what is NaiveSimilarity algorithm? How we use this algorithm to recognize a face in face recognition (using Java)? which is the steps involved in this? Which is the database used to store an image
efficiency of an algorithm
efficiency of an algorithm  how can we calculate the best or worst case efficiency of an algorithm
efficiency of an algorithm
efficiency of an algorithm  how can we calculate the best or worst case efficiency of an algorithm
C4.5 ALGORITHM
C4.5 ALGORITHM  I am doing my project in data mining.Any body having code for C4.5 decision tree algorithm in java with output.Help me Friends
Conflation Algorithm
Conflation Algorithm  implementation of conflation algorithm is possible using java?? conflation requires file handling a text contains stop words(is,or,and,.,)remove this words remove suffix(ing,ed..) remove equal words count
Algorithm - Java Beginners
Algorithm  (a) Describe the manual procedure, if one has to use the above algorithm and the first element as the pivot to sort the sequence... the algorithm you want to use to sort the sequence. Thanks
Asymmetric algorithm - Java Beginners
Asymmetric algorithm  hybrid Digital image embedding using invisible watermarking with rsa and dct algorithm? please send me this project with source code........ regards subramanian
flowchart and algorithm
flowchart and algorithm  import java.util.Scanner; public class StudentMarks { double totalMarks; String grade; public void setTotalMarks(double totalMarks) { this.totalMarks = totalMarks; } public double getTotalMarks
How to write a rsa algorithm using thread
How to write a rsa algorithm using thread   Hi... This my **rsa algorithm sequential code..can u anyone plz change/convert to concurrent...("Time required for sequential rsa algorithm:"+(endtime-starttime)+"millisecond
implementing an algorithm using multi threads - Java Beginners
implementing an algorithm using multi threads  Hi i need to implement an algorith in multi threads.Algorithm has data dependency so i need to pass data from one thread to another thread. I am posting my algorithm which needs
pattern matching --four way technique........brute force algorithm
pattern matching - four way technique  Hi, here's my question.. I am trying to implement pattern matching using brute force algorithm where I am trying to apply four way technique to search a given pattern in a text.in
Google Penguin Algorithm update issues and How to Recover
of the year 2013 and will "go deeper". Like all other Google algorithm updates
Stock Analysis and Prediction and trading league
Stock Analysis and Prediction and trading league  I am working on a project Stock Analysis and Prediction and trading league. In which i am using apriori algorithm for predicting the stock value on the basis of previous records
problem java - Design concepts & design patterns
problem java  Please help me again, i will try to create to txt with script you give to me but many error please help me to combine your script... the problem : import javax.swing.JOptionPane; public class FileWrite{ public static
JSP & CSS problem - Design concepts & design patterns
. There is a problem in css file. Try the following code. step1- JSP code
PESTLE analysis
PESTLE analysis   What is PESTLE analysis used in Business Analysis Techniques
Business Analysis
Business Analysis  What is Business Analysis
SWOT Analysis
SWOT Analysis  What is SWOT Analysis and how it is used for effective business analysis?   SWOT analysis is performed to find the existing...) Opportunities (O) Threats (T) To get more information about SWOT analysis
I have a small problem in my datagridview - Design concepts & design patterns
I have a small problem in my datagridview  i have datagridviewer in c#(platform) and i try that change cell beckground, this cell Should be for example 5(integer!) if in my datagridwiewer Will be 5(whatwhich should be take in my
Business Analysis Certifications
Business Analysis Certifications  What are the certifications available for business analyst in India
JSF security design problem - Java Server Faces Questions
JSF security design problem  Hi! I have to manage security (the quantity of roles and groups is rather huge) in java ee 5 + jsf (1.x) project... jsf at all? Please, provide your ideas of solving this problem. Thanks
HEPTALYSIS technique in Business Analysis
technique in Business Analysis?   HEPTALYSIS is a Business analysis technique... To get more information about HEPTALYSIS analysis and business analysis techniques, you can go to the link below: Business Analysis Techniques What
MOST technique in Business analysis
in Business analysis?   This MOST analysis technique is performed to analyse... maximum results. To get more information about MOST analysis and business analysis techniques, you can go to the link below: Business Analysis Techniques
Content Analysis
Content Analysis Content analysis is systematic replicable... of the content by checking it's authorship using content analysis technique. Criteria: The Criteria of Content analysis is not so easy to do. A set
result analysis issue
result analysis issue  i have given 100 users in my thread group for http sampler.some threads r getting response and some threads r getting error response.the error response shown in view results tree listener is as shown below
Design Pattern
Design Pattern         Template Design Pattern These types of design patterns are used as templates. These design patterns
Biquadratic regression analysis - Java Beginners
Biquadratic regression analysis  Hi Is there any code available to solve bi quadratic equation using regression analysis? Thanks in advance
What is Design Thinking?
faculty, in plain language thinking. Design thinking is an approach to this problem solving thinking pattern. In ultimate analysis design thinking can... to meticulous analysis and breaking through new opportunities en route to solve the problem
Methods involved to carry out an effective business analysis?
Methods involved to carry out an effective business analysis?  What are the methods involved to carry out an effective business analysis
computer graphics - Design concepts & design patterns
computer graphics  Digitise a line with endpoints (0, 1) and (11, 16) using (i) DDA algorithm and (ii) Bresenham Algorithm. Which of two lines is of better quality? Explain your answer
Business Analysis Techniques
There are many business analysis techniques that are quite useful in carrying out an effective and productive business analysis. Some of the important techniques for business analysis often used by business analysts are: PESTLE
Software Design
Software Design     ... solution is known as software design. In this process, first the purpose... as well as the issue of algorithm implementation and low level component
Analysis tool - SourceGlider for Eclipse
Analysis tool - SourceGlider for Eclipse  ... programs make heavy use of methods overloading, polymorphism and subtle design... and tracing the program. Static code analysis allows to get this information
CAP - Code Analysis Plugin
CAP - Code Analysis Plugin         CAP is a plugin for the eclipse platform and analysis the dependencies of your Java project. It opens a own perspective and displays
Design patterns interview questions
Design patterns interview questions       Design patterns... to a problem in a context. Each pattern describes a problem which occurs
PHP Design Patterns
PHP Design Patterns: A design pattern is like a template which guides us to solve a problem. Design patterns are not finished design that can be transformed directly into code. In Object Oriented based design patterns we can get
Assignment problem
Assignment problem  hello, I am designing a program partaining job assingment using hungarian algorithm,but i am totally confused, please help me out
Design patterns interview questions1
of problems. This would narrow down our search for design patterns. Read the problem... Design patterns interview questions1       Q1. What are design patterns? Ans. A pattern
Design patterns - Design concepts & design patterns
Design patterns  I am new to design patterns and desigining . Please refer me some tutorial or pdfs of design patterns and desigining in easy... (and recurring) solution to a problem in a context. Each pattern describes a problem which
Porter FiveForces Analysis
Michael E. Porter of Harvard Business School in 1979 provided five force model for industry analysis and business strategy development, which defines the competitive intensity of the market. Porter identified five forces
For reqirment - Design concepts & design patterns
For reqirment  I have to design loyalty card system which is related with Point of sale. Please send some document related to loyalty card. I have no idea related to this so please help me to resolve this problem as soon
java compilation - Design concepts & design patterns
java compilation  write an algorithm which uses a stack to print a given string in reverse order. For example, if the string is `Fat cat`, the output should be `tac taf`. Use the usual stack methods and a method nextChar(S
java design
java design  What is design by contract
Design pattern
Design pattern  explain factory pattern
IdafeUML
IdafeUML       IdafeUML is a set of tools for analysis and design of java software, using UML diagrams. This version is the first one of the product and includes
 

 

 

DMCA.com