If I get the new job, I () buy a better car.A、willB、wouldC、might

题目
If I get the new job, I () buy a better car.

A、will

B、would

C、might


相似考题

4.阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。【说明】字符串在程序设计中扮演着重要角色。现需要设计字符串基类string,包含设置字 符串、返回字符串长度及内容等功能。另有一个具有编辑功能的串类edlt_string,派生于string,在其中设置一个光标,使其能支持在光标处的插入、删除操作。【程序】include <iostream.h>include <stdio.h>include <string.h>class string{int length;char *data;public:int get_length() {return length;}char *get_data() {return data;}~string() {delete data;}int set data(int in_length, char *in_data);int set_data(char *data);void print() {cout<<data<<endl;}};class edit_string: public string{int cursor;public:int get_cursor() {return cursor;}void move_cursor(int dis) {cursor=dis;}int add_data(string *new_data);void delete_data(int num);};int string::set_data(int in_length,char *in_data){length=in_length;if(!data)delete data;(1)strcpy(data,in_data);return length;}int string::set data(char *in_data){(2)if(!data)delete data;(1)strcpy(data,in_data);return length;}int edit_string::add_data(string *new_data){int n,k,m;char *cp,*pt;n=new_data->get_length();pt=new_data->get_data();cp=this->get_data();m=this->get_length();char *news=new char[n+m+1];for(int i=0; i<cursor; i++)news[i]=cp[i];k=i;for(int j=0; j<n; i++,j++)news[i]=pt[j];cursor=i;for(j=k; j<m; j++,i++)(3)news[i]='\0';(4)delete news;return cursor;}void edit string::delete_data( int num){int m;char *cp;cp=this->get_data();m=this->get_length();for(int i=cursor; i<m; i++)(5)cp[i]='\0';}

参考答案和解析
参考答案:A
更多“If I get the new job, I () buy a better car. ”相关问题
  • 第1题:

    向量类vector中的get(i)方法不能够返回向量中下标为i的元素值。()

    此题为判断题(对,错)。


    正确答案:错误

  • 第2题:

    ArraryLista=newArrayList();a.add(Alpha”);a.add(Bravo”):a.add(Charlie”);a.add(Delta”);Iteratoriter=a.iterator();Whichtwo,addedatline17,printthenamesintheArrayListinalphabeticalorder?()

    A.for(inti=0;i<a.size();i++) System.out.println(a.get(i)));

    B.for(inti=0;i<a.size();i++) System.out.println(a[i]);

    C.while(iter.hasNext()) System.out.println(iter.next());

    D.for(inti=0,i<a.size();i++) System.out.println(iter[i]);

    E.for(inti=0;i<a.size();i++) System.out.println(iter.get(i));


    参考答案:A, C

  • 第3题:

    B)阅读短文,然后从短文括号中所给词的适当形式填空。

    Climbingthehighestmountainsintheworldisnotan78(easily)job.Youhavetofightbadweather,illnessandfear.ButJordanRomero,athirteen-year-oldboyfromAmerica,willclimb79(Asia)highestmountain,MountQomolangma.Hewillsetoutthismonth.80(He)parentsandhelperswillclimbwithhim.Heplanstotake81(second)monthsforhisclimb.“I'mready.ButifIdon'treachthetop82(successful),I'lltrynexttime,”hesaid.Jordanhasalreadyclimbedthehighestmountainsofsixothercontinents(洲).Ifhe83(get)tothetopthistime,hewillbecometheyoungestpersontoclimbtheworld'shighestmountain.

    78_________


    正确答案:
    easy

  • 第4题:

    使用VC6打开考生文件夹下的工程test37_1,此工程包含一个源程序文件test37_1.cpp,但该程序运行有问题,请改正函数中的错误,使该程序的输出结果为:

    0149 16 25 36 49 64 81

    源程序文件test37_1.cpp清单如下:

    include<iostream.h>

    template <class T, int N = 100> class Vector

    {

    T vec[N];

    public:

    void set(int pos, T val);

    T get(iht pos);

    /***************** found *****************/

    }

    template <class T, int N> void Vector<T, N>::set(int pos, T val)

    {

    vec[pos] = val;

    }

    /***************** found *****************/

    template <class T, int N> Vector<T, N>::get(int pos)

    {

    return vec[pos];

    }

    int main ()

    {

    Vector<double, 10> v;

    int i = 0;

    double d = 0.0;

    for (i = 0; i < 10; i++)

    v.set(i, double(i * i));

    for (i = 0; i < 10; i++)

    cout<<v.get(i)<<" ";

    cout<<end1;

    /***************** found *****************/

    }


    正确答案:(1) 错误:} 正确:}; (2) 错误:templateclass Tint N>VectorTN>::get(int pos) 正确:templateclass Tint N>T VectorTN>::get(int pos) (3) 错误:缺少返回值 正确:加入 return 0;
    (1) 错误:} 正确:}; (2) 错误:templateclass T,int N>VectorT,N>::get(int pos) 正确:templateclass T,int N>T VectorT,N>::get(int pos) (3) 错误:缺少返回值 正确:加入 return 0; 解析:(1)主要考查考生对于类定义的理解,即使使用了类模板,在类定义的结尾仍然需要使用分号,这是C++的规定;
    (2)主要考查考生是否会掌握了模板类的定义,template是关键字,在0中间是类型的定义,题目中Vector是一个类的名称,前面应该有该模板的名称,即T,这样才是完整的定义;
    (3)主要考查考生对于函数返回值的掌握,任何返回值类型不为int型的函数最后都必须使用returen语句返回对应类型的值,就算是main函数也不例外。

  • 第5题:

    下面程序输出的结果是()。includeusing namespace std;void main(){ char ch[][8]={"g

    下面程序输出的结果是( )。 #include<iostream> using namespace std; void main() { char ch[][8]={"good","better","best"}; for(int i=1;i<3;++i) { cout<<ch[i]<<endl; } }

    A.good better

    B.better best

    C.good best

    D.good


    正确答案:B
    解析:二维数组ch共3行8列,for循环语句输出第2、3行的数组元素

  • 第6题:

    下面的代码用于输出字符数组ch中每个字符出现的次数,应该填入的代码是()public static void main(String[] args) { char[] ch = { 'a', 'c', 'a', 'b', 'c', 'b' }; HashMap map = new HashMap(); for (int i = 0; i < ch.length; i++) { < 填入代码 > } System.out.println(map); }

    A.if (map.contains(ch[i])) { map.put(ch[i], map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }

    B.if (map.contains(ch[i])) { map.put(ch[i], (Integer) map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }

    C.if (map.containsKey(ch[i])) { map.put(ch[i], (int) map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }

    D.if (map.containsKey(ch[i])) { map.put(ch[i], (Integer) map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }


    if (map.containsKey(ch[i])) { map.put(ch[i], (Integer)map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }