Write a simple student performance management program using Java

WBOY
Release: 2024-01-16 13:30:18
forward
1297 people have browsed it

Write a simple student performance management program using Java

Who knows how to write questions using java to write a simple student score using java

import java.io.*;

public class Test

{

public static void main(String[] args) throws Exception

{

int n;

float[] s;

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

String [] strs;

System.out.print ("Please enter the number of students:");

n=Integer.parseInt(br.readLine());

s=new float[3*n];

for(int i=0;i {

System.out.print ("Please enter the scores of the students' 3 courses" (i 1) "separated by spaces:");

strs=br.readLine().trim().split("\\s ");

s[3*i]=Float.parseFloat(strs[0]);

s[3*i 1]=Float.parseFloat(strs[1]);

s[3*i 2]=Float.parseFloat(strs[2]);

// System.out.println(""" s[3*i] " " s[3*i 1] " " s[3*i 2]);

}

System.out.println ("The scores of the " n " students you entered are: ");

for(int i=0;i {

System.out.println(""" s[i] " " s[i 1] " " s[i 2]);

}

}

}

JAVA code. The following questions are scored out of 100 points. The student’s score is recorded as x

package test;

import java.util.Scanner;

public class Score {

/**

* @param args

*/

public static void main(String[] args) {

try {

Scanner student_score_input = new Scanner(System.in);

System.out.print ("Please enter the student's score: ");

int student_score = student_score_input.nextInt();

if (student_score >= 90 & student_score

System.out.print ("The student's score is excellent");

} else if (student_score >= 80 & student_score

System.out.print("The student's score is good");

} else if (student_score >= 60 & student_score

System.out.print ("The student's score is passing");

} else if (student_score >= 0 & student_score

System.out.print ("The student's grade is failing");

} else {

System.out.print("Input error!");

}

} catch (Exception e) {

System.out.print("Input error!");

}

}

}

The above is the detailed content of Write a simple student performance management program using Java. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:docexcel.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!