Question: flow chart

Ads

 
 
 

Share on Google+Share on Google+

purple_coat
flow chart
0 Answer(s)      5 years and 6 months ago
Posted in : Java Beginners

can you provide the flowchart of this coding.

import java.util.*;

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("FAIL");
}
if(marks>=40&&marks<=50){
data[i].setGrade("E");
}
if(marks>50&&marks<=59){
data[i].setGrade("D");
}
if(marks>60&&marks<=70){
data[i].setGrade("C");
}
if(marks>70&&marks<=85){
data[i].setGrade("B");
}
if(marks>85&&marks<=95){
data[i].setGrade("A");
}
if(marks>95){
data[i].setGrade("A+");
}

}
int count1=0,count2=0,count3=0,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));


}
}
Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
flow chart
flow chart  can you provide the flowchart of this coding. import java.util.*; public class StudentMarks{ double totalMarks; String grade; public void setTotalMarks(double totalMarks){ this.totalMarks=totalMarks
flow chart
flow chart  can you provide the flowchart of this coding. import java.util.*; public class StudentMarks{ double totalMarks; String grade; public void setTotalMarks(double totalMarks){ this.totalMarks=totalMarks
Advertisements
flow charts
flow charts   draw a flow chart program with a user prompt of 5 numbers computing the maximum, minimum and average
Struts Flow
Struts Flow  can u explain about struts flow with clear explaination  Hello, Please visit the following link: http://www.roseindia.net/struts/ Thanks
Struts Flow In Depth
Struts Flow In Depth  Struts Flow In Depth
Struts control data flow
Struts control data flow  How Struts control data flow
pie chart
pie chart  how to create pie chart using struts2
jfree chart
jfree chart  i need donut chart using jfree
Flow control of hibernate application..
Flow control of hibernate application..  Hello Roseindia team, Please provide flow control of hibernate application.. i.e when it goes to mapping file? when it goes to DAO's? when it goes to hibernate config files?? etc
Pie chart
Pie chart  hi................. In my project i want to create a pie-chart by taking values at run time. As want to display it in pie chart form....   Java Swing PIE Chart
bar chart
bar chart  how to create a bar chart from values of the database and the string value should be the entities of the database??plzz help..needed badly
expression and flow control
expression and flow control  write the program calculate and print the bill of communication telephone mobile company the company offer 2 types of services is regular (r) and premium (p) the rates are computed as follow
plese expalin the flow of this program
plese expalin the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized(train
Please explain me the flow of this program..
Please explain me the flow of this program..  // Substring replacement. class StringReplace { public static void main(String args[]) { String org = "This is a test. This is, too."; String search
What is the general flow of Hibernate communication with RDBMS?
What is the general flow of Hibernate communication with RDBMS?  Hi, What is the general flow of Hibernate communication with RDBMS? thanks
draw chart in web application
draw chart in web application  how to draw bar chat from the record store in database? i.e. draw the bar chart according to selected record
please explain me the flow of this program
please explain me the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized
How to make animated flow river, make animated flow river, animated flow river
How to make animated flow river       Now you can make animation of the still river picture, it is very interesting because I have tried here to make a realistic animation
chart tutorial - Java3D
chart tutorial  Hi I need a JFree Chart class library in order to design a chart with java  Hi friend, For JFree Chart class library... information,Tutorials and Examples on JFree Chart visit to : http://www.roseindia.net
Bar chart implementation in PHP
Bar chart implementation in PHP  How to implements reports in bar graphs by using PHP
Clickable chart with Tool Tip
Clickable chart with Tool Tip  Can we generate the charts with tooltip and onclick events using jfreechart in jsps and servlets
surface chart - Java3D
surface chart  i have to make a surface chart of a piece of land with data given for each point in the xy plane....the chart should be such that the areas with different data range should show up in different colour. seriously
3d pie chart - Java3D
3d pie chart  Dear Sir, i want to create 3d pie chart using jsp, i have some code for 2d pie chart in jsp and 3d pie chart in applet. for 2d pie chart my jsp page is running properly but for 3d i used some code from applet
Pie chart on jsp
Pie chart on jsp  how can i create a pie chart on a jsp page using... that creates a pie chart using JFreechart api and takes the value from..."); dataset.executeQuery(query); JFreeChart chart = ChartFactory.createPieChart
line chart from database in jsp
line chart from database in jsp  how can i create line chart from database in jsp code
Jfree chart problem - Swing AWT
Jfree chart problem  hello i have a problem related to jfree chart i have some data and i want to display data in two different chart stacked area chart and line chart both in a single frame. That is hybrid combination
JFree chart package error
JFree chart package error  hi, I had asked u abt the jfree chart package and done what u have said. Its working but its giving me error that some... the jcommon jar file and jfree jar file for the bar chart code. but now its giving
create chart - JSP-Servlet
.jrxml report. I want to create a chart using ireport software. I m using sql...(primary key) title status I want to show chart of field "date" only... and free hours is green are filled that chart So pls help me to solve
Chart - Java Beginners
"); ChartUtilities.saveChartAsJPEG(image, chart, 400, 300); pw.println(" Display Chart"); Dis.html... system with help of URL.The chart is not coming.Its display empty page
Stacked Bar Chart
Stacked Bar Chart  How to display a stacked bar chart using java from the values stored in the ms access database?Plzz help..its urgent
Flex terminating event flow example
Flex terminating event flow example       In the example below, how to terminate an event flow is demonstrated. With this example the motive of previous event phase detecting
Tutorials   
Java Spring Hibernate Struts Training What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly?

Ads

 
Advertisement null

Ads