试题与答案

故障分析和判断的基本方法有()方法和()方法。

题型:填空题

题目:

故障分析和判断的基本方法有()方法和()方法。

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2019/0930/b4bc295befa9a984fcc5d013a3472738.html

下面是错误答案,用来干扰机器的。

参考答案:制造信息系统分为3类:一类是通过技术实现产品生产的系统,如计算机辅助设计CAD,计算机辅助制造CAM,计算机数字控制CNC和机器人robot等;另一类是通过管理实现生产的系统,如材料需求计划MRP,资源制...

试题推荐
题型:填空题


请完善程序(程序文件名:Java_2.java),并进行调试。请在下画线处填入正确内容,然后删除下画线。请勿删除注释行和其他已有的语句内容。
题目要求:
对字符串进行缓存处理,程序运行的某次结果如下图所示。

源程序:
import javax.swing.*;
public class Java_2 {
public static void main( String args[] ) {
StringBuffer buf = new StringBuffer( "你好!祝你好运!");
String output = " buf = " + buf.toString( ) + " \nCharacter at 0:" + buf.charAt(0)+
" \nCharacter at 4: " + buf.charAt(4) ;
char charArray[]= (1) char[buf.length( )];
buf. (2) ( 0, buf.length(),charArray,0);
output + = " \n\n 在字符串缓存中的字符时: " ;
for(int i = 0; i< (3) ; ++i ) output += charArray[i];
buf.setCharAt( 0,’您’) ;
buf.setCharAt( 6,’材’);
output + = " \n\nbuf = " + buf.toString( ) ;
buf. (4) ;
output + = " \n\nbuf = " + buf.toString( ) ;
JOptionPane. showMessageDialog( null, output, "字符串缓存的字符相关方法示范",
JOptionPane.INFORMATION_MESSAGE);
System. exit(0) ;
}
}


查看答案
题型:问答题

请使用VC6或使用[答题]菜单打开考生文件夹proj3下的工程proj3,其中定义的Matrix是一个用于表示矩阵的类。成员函数max_value的功能是求出所有矩阵元素中的最大值。例如,若有3×3矩阵

则调用max_value函数,返回值为3。请编写成员函数max_value。

要求:

补充编制的内容写在“//********333********”与“//********666********”之间,不得修改程序的其他部分。

注意:程序最后将结果输出到文件out.dat中。输出函数writeToFile已经编译为obj文件,并且在本程序中调用。

//Matrix.h

#include <iostream>

#include <iomanip>

using namespace std;

const int M=18;

const int N=18;

class Matrix

int array[M][N];

public:

Matrix()

int getElement(int i,int j)constreturn array[i][j];

void setElement(int i,int j,intvalue)array[i][j]=value;

int max value()const;

void show(const char*s)const

cout<<endl<<s;

for(int i=0;i<M;i++)

cout<<endl;

for(int j=0;j<N;j++)

cout<<setw(4)<<array[i][j];

;

void readFromFile(const char*,Matrix&);

void writeToFile(char*,constMatrix&);

//main.cpp

#include"Matrix.h"

#include <fstream>

void readFromFile(const char* f,Matrix& m)

ifstream infile(f);

if(infile.fail ()) cerr<<"打开输入文件失败!"; return;

int k;

for(int i=0;i<M;i++)

for(int j=0;j<N;j++)

infile>>k;

m.setElement(i,j,k);

int Matrix::max value()const

//********333********

//********666********

int main()

Matrix m;

readFromFile(" ",m);

m.show("Matrix:");

cout<<endl<<"最大元素:"<<m.maxvalue()<<endl;

writeToFile(" ",m);

return 0;

查看答案
微信公众账号搜索答案