十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
在百度上面想要这种收费的代码基本上是不太可能的!
成都创新互联是专业的宿州网站建设公司,宿州接单;提供网站制作、网站设计,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行宿州网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!
还有你说也太笼统了吧!试卷生成和题库管理系统这里面有详细的要求吗?
要求都没有,基本上都不能开发制作的
import java.util.ArrayList;
import java.util.List;
public class Random {
public static void main(String[] args) {
String[] tiMu = new String[20];
for (int i = 0; i tiMu.length; i++) {
tiMu[i] = "第" + (i + 1) + "题";
}
String[] temp = new String[10];
//开始抽取题目
//产生10个随机数
ListInteger list = new ArrayListInteger();
int i;
while(list.size() 10){
i = (int) (Math.random() * 20);
if(!list.contains(i)){
list.add(i);
}
}
for (int j = 0; j list.size(); j++) {
temp[j] = tiMu[list.get(j)];
}
for (int iloop = 0; iloop temp.length; iloop++) {
System.out.print(temp[iloop] + " ");
}
}
}
代码已经写完了,亲测可用,望采纳哦!
//第一题:Test.java
public class Test {
public static void main(String[] args) {
int array[]=new int[10];//声明数组并声明
array[0]=array[1]=1;//赋初始值
System.out.println(array[0]);
System.out.println(array[1]);
for(int i=2;iarray.length;i++){
array[i]=array[i-2]+array[i-1];//用for语句完成相应的运算
System.out.println(array[i]);
}
}
}
//第二题 RandomTest.java
import java.util.Random;//随机数包声明
import java.util.Scanner;//用户输入包声明
public class RandomTest {
public static void main(String[] args) {
Scanner reader=new Scanner(System.in);//声明并创建用户输入对象
System.out.println("我心里有一个0~99之间的数,你猜是什么?");
int i=(int)(Math.random()*100);//生成一个随机数
int input=reader.nextInt();//用户输入
while(i!=input){//判断用户输入的数和随机生数的大小
if(inputi){
System.out.println("小了点,再猜!");
}
if(inputi){
System.out.println("大了点,再猜");
}
input=reader.nextInt();
}
System.out.println("猜对了!");
System.out.println("继续加油!");
}
}
创建一个名字为“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;
}
}