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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


purple_coat
flow chart
0 Answer(s)      2 years and 11 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));


}
}

Advertisement
View Answers

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
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
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
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
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
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
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
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 - Java Beginners
..thanks,i want my chart to display dynamically from my database  Hi... database on your chart
 

 

 

DMCA.com