● (75) has become a fact of modern life, with millions of people now shopping on-line.
(75)
A. E-mail
B. E-commerce
C. E-learning
D. E-communication
查看答案
● 现需要将数字2和7分别填入6个空格中的2个(每个空格只能填入一个数字),
已知第1格和第2格不能填7,第6格不能填2,则共有 (63) 种填法。
(63)
A. 12
B. 16
C. 17
D. 20
试题六(共15分)
阅读以下说明和 Java 代码,将应填入 (n) 处的语句或语句成分写在答题纸的对
应栏内。
【说明】
某数据文件 students.txt的内容为100名学生的学号和成绩,下面的程序将文件中的
数据全部读入对象数组,按分数从高到低进行排序后选出排名前 30%的学生。
【Java代码】
import java.io.*;
class Student {
private String sNO; //学号
private int Credit; //分数
public int getCredit(){
return Credit;
}
public String toString() {
return "sNO = " + this.sNO + ", Credit = " + this.Credit;
}
Student(String sNO, int Credit){
(1) = sNO;
(2) = Credit;
}
}
public class SortStudent {
void sort(Student[] s) { //Sort the array s[] in decending order of Credit
for (int i = 0; i < s.length-1; i++) {
for (int j = i+1; j < s.length; j++) {
if (s[i]. (3) < s[j]. (4) ) {
Student tmp = s[i];
s[i] = s[j];
s[j] = tmp;
}
}
}
}
public static void main(String argv[]) {
Student[] testStudent = new Student[size];
try {
BufferedReader in = new BufferedReader(new FileReader("students.txt"));
boolean done = false;
int i = 0;
while (!done) {
String s = in.readLine(); //每次读取一个学生的学号和成绩
if (s != null) {
String tmp[] = s.split(",");
testStudent[i++] = (5) (tmp[0], Integer.parseInt(tmp[1]));
} else
done = true;
}
in.close();
(6) = new SortStudent();
ss.sort(testStudent);
System.out.println("top 30%:");
for (int j = 0; j < size * 0.3; j++)
System.out.println(testStudent[j]);
} catch (IOException e) {
System.out.println("io error!");
}catch (NumberFormatException e) {
System.out.println("not a number!");
}
}
(7) int size = 100; //学生总数
}
试题五(共15分)
阅读以下说明和 C++代码,将应填入 (n) 处的语句或语句成分写在答题纸的对应栏内。
【说明】
某数据文件students.txt的内容为100名学生的学号和成绩,下面的程序将文件中的数据全部读入对象数组,按分数从高到低进行排序后选出排名前 30%的学生。
【C++代码】
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Student {
private:
string sNO; //学号
int credit; //分数
public:
Student(string a,int b) { sNO = a; credit = b;}
Student(){}
int getCredit();
void out();
};
(1) ::getCredit() {
return credit;
}
(2) ::out() {
cout << "SNO: " << sNO << ", Credit=" << credit << endl;
}
class SortStudent {
public:
void sort(Student *s, int n);
SortStudent(){}
};
void SortStudent::sort(Student *s,int n) {
for(int i = 0; i < n-1; i++) {
for(int j = i+1; j < n; j++) {
if(s[i]. (3) < s[j]. (4) ) {
Student temp = s[i]; s[i] = s[j]; s[j] = temp;
}
}
}
}
int main(int argc, char* argv[])
{
const int number = 100; //学生总数
ifstream students;
students.open("students.txt");
if(!students.is_open()) {
throw 0;
}
Student *testStudent = (5) [number];
int k = 0;
string s;
while (getline(students,s,'\n')) { //每次读取一个学生的学号和成绩
Student student(s.substr(0,s.find(',')), atoi(s.substr(s.find(',')+1).c_str()));
testStudent[k++] = student;
}
students.close();
(6) ;
ss.sort(testStudent,k);
cout <<"top 30%: "<<endl;
for(k = 0; k < number * 0.3; k++) {
testStudent[k].out();
}
delete []testStudent;
return 0;
}
● 许多工作需要用曲线来拟合平面上一批离散的点,以便于直观了解趋势,也便于插值和预测。例如,对平面上给定的 n 个离散点{(Xi,Yi)|i=1,…,n},先依次将每 4 个点分成一组,并且前一组的尾就是后一组的首;再对每一组的4个点,确定一段多项式函数曲线使其通过这些点。一般来说,通过给定的4个点可以确定一条 (64) 次多项式函数曲线恰好通过这4个点。
(64)
A. 2
B. 3
C. 4
D. 5