资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

java答题卡编辑代码 javaweb答题系统

如何用java写个小型 试题库?

这个比较简单吧,去找一些CMS类的模板看一看,简单来说就是上传题目到数据库,取的时候random取一定数量的题出来就行了。

“只有客户发展了,才有我们的生存与发展!”这是创新互联的服务宗旨!把网站当作互联网产品,产品思维更注重全局思维、需求分析和迭代思维,在网站建设中就是为了建设一个不仅审美在线,而且实用性极高的网站。创新互联对成都网站建设、网站制作、网站制作、网站开发、网页设计、网站优化、网络推广、探索永无止境。

题目管理:

1,题目的上传

2,题目的编辑

3,题目的删除

4,答案的保存

5,评分

用户管理:

1,用户注册

2,用户登录

3,用户信息编辑

4,用户删除

前台:

1,如果题不多的话一个页面就能搞定,一个表单,答题,提交,完事

2,查询分数

大概这样就可以了,具体的一些需求你再仔细分析一下。

代码只能靠你自己了~一个简单的demo也很容易,要做的完善也很麻烦。

求助大神如何用Java写出这两个题目的代码?

第一题

package baidu;

public class Student {

protected String name;

protected int age;

public Student(String name, int age) {

this.name = name;

this.age = age;

}

public void show(){

System.out.println("name = " + name);

System.out.println("age = " + age);

}

}

---------------------------------

package baidu;

public class Undergraduate extends Student {

private String degree;

public Undergraduate(String name, int age, String degree) {

super(name, age);

this.degree = degree;

}

public void show(){

System.out.println("name = " + name);

System.out.println("age = " + age);

System.out.println("degree = " + degree);

}

}

------------------------

package baidu;

public class TestRun {

public static void main(String[] args) {

Student s = new Student("singi",12);

s.show();

Undergraduate ug = new Undergraduate("lily",23,"本科");

ug.show();

}

}

输出:

name = singi

age = 12

name = lily

age = 23

degree = 本科

第二题:

package baidu;

public class Man {

String name;

public Man(String name) {

this.name = name;

}

public void business(){

System.out.println("在方法内输出谈生意");

}

}

----------------

package baidu;

public class SuperMan extends Man {

String name;

public SuperMan(String name, String name1) {

super(name);

this.name = name1;

}

@Override

public void business() {

System.out.println("在方法内输出谈几个亿的大单子");

}

public void fly(){

System.out.println("在方法内输出超人不会飞");

}

}

------------------

package baidu;

public class TestMan {

public static void main(String[] args) {

Man m = new Man("singi");

System.out.println(m.name);

m.business();

SuperMan sm = new SuperMan("lily","xiaoming");

System.out.println(sm.name);

sm.business();

sm.fly();

}

}

输出:

singi

在方法内输出谈生意

xiaoming

在方法内输出谈几个亿的大单子

在方法内输出超人不会飞

java练习题求完整代码

按照题目要求编写的用javaBean规范设计的学生类Student的Java程序如下

需要创建user.java.test包,把Student.java文件和Test.java文件放入包中,编译Student.java文件并且编译运行Test.java文件得到运行结果

Student.java文件代码如下

package user.java.test;

import java.io.Serializable;

public class Student implements Serializable{

private static final long serialVersionUID = 1L;

private String no;

private String name;

private double score;

public Student(){}

public Student(String no,String name,double score){

this.no=no;

this.name=name;

this.score=score;

}

public String getNo(){ return no;}

public void setNo(String no){ this.no=no;}

public String getName(){ return name;}

public void setName(String name){ this.name=name;}

public double getScore(){ return score;}

public void setScore(double score){ this.score=score;}

public String toString(){

return "学号:"+no+",姓名:"+name+",成绩:"+score;

}

public static double getAvg(Student[] sArray){

double sum=0,avg;

for(int i=0;isArray.length;i++){

sum=sum+sArray[i].getScore();

}

avg=sum/sArray.length;

return avg;

}

}

Test.java文件代码如下

package user.java.test;

public class Test{

public static void main(String[] args){

Student[] sArray=new Student[5];

sArray[0]=new Student("001","张三",89.5);

sArray[1]=new Student("002","李四",82.5);

sArray[2]=new Student("003","王五",93);

sArray[3]=new Student("004","赵六",73.5);

sArray[4]=new Student("005","孙七",66);

System.out.println("这些学生的平均分:"+Student.getAvg(sArray));

for(int i=0;isArray.length;i++){

System.out.println(sArray[i].toString());

}

}

}

这两道题代码怎么写java?

创建一个名字为“ReportCard”的类,然后用下边的内容全部替换掉,你会成为全班最亮的仔。

import java.util.HashMap;

/**

* 学生成绩单

*/

public class ReportCard {

public static void main(String[] args) {

ReportCard reportCard = new ReportCard("张三", "070602213");

reportCard.set("语文", 80.0);

reportCard.set("数学", 59.5);

reportCard.set("英语", 66.0);

reportCard.set("java", 80, 99.0);

reportCard.set("数据库", 80, 66.0);

reportCard.set("毛概", null);

System.out.println(reportCard.getStudentName() + "语文分数:" + reportCard.get("语文"));

System.out.println(reportCard.getStudentName() + "数学考核结果:" + (reportCard.isPassed("数学") ? "合格" : "不合格"));

System.out.println(reportCard.getStudentName() + "期末是否挂科:" + (reportCard.isAllPassed() ? "否" : "是"));

}

// 学生姓名

private String studentName;

// 学生学号

private String studentNumber;

// 成绩单

private HashMapString, CourseResult cards = new HashMap();

public ReportCard() {

}

public ReportCard(String studentName, String studentNumber) {

this.studentName = studentName;

this.studentNumber = studentNumber;

}

public Double get(String courseName){

CourseResult courseResult = cards.get(courseName);

return courseResult == null ? Double.NaN : courseResult.getStudentScore();

}

public void set(String courseName, Double studentScore){

CourseResult courseResult = new CourseResult(courseName, studentScore);

cards.put(courseName, courseResult);

}

public void set(String courseName, double passMark, Double studentScore){

CourseResult courseResult = new CourseResult(courseName, passMark, studentScore);

cards.put(courseName, courseResult);

}

public boolean isPassed(String courseName){

return cards.get(courseName).isPassed();

}

public boolean isAllPassed(){

for(CourseResult cr : cards.values()){

if ( ! cr.isPassed()) {

return false;

}

}

return true;

}

public String getStudentName() {

return studentName;

}

public String getStudentNumber() {

return studentNumber;

}

public void setStudentName(String studentName) {

this.studentName = studentName;

}

public void setStudentNumber(String studentNumber) {

this.studentNumber = studentNumber;

}

/**

* 课程

*/

class Course{

// 课程名称

protected String courseName;

// 及格分

protected double passMark = 60;

public Course(String courseName, Double passMark) {

this.courseName = courseName;

if ( passMark != null) {

this.passMark = passMark;

}

}

}

/**

* 课程成绩

*/

class CourseResult extends Course{

// 学生成绩

private Double studentScore;

public CourseResult(String courseName, Double studentScore) {

this(courseName, null, studentScore);

}

public CourseResult(String courseName, Double passMark, Double studentScore) {

super(courseName, passMark);

this.studentScore = studentScore == null ? Double.NaN : studentScore;

}

public boolean isPassed(){

return studentScore = passMark;

}

public String getCourseName() {

return courseName;

}

public double getPassMark() {

return passMark;

}

public Double getStudentScore() {

return studentScore;

}

}


文章名称:java答题卡编辑代码 javaweb答题系统
网站URL:http://cdkjz.cn/article/ddohgjp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220