云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 程序员考试大纲+2008年真题

程序员考试大纲+2008年真题

  • 62 次阅读
  • 3 次下载
  • 2025/5/7 4:25:34

} while ( key<=1 );

printf( \decode of telegraph:'%s' is:\\n'%s'\\n\old,key ) ); }

试题五(15分,每空3分)

阅读以下说明及Visual Basic 程序代码,将应填入___(n)___处的字句写在答题纸的对应栏内。

[说明]

本程序实现如下功能:首先,单击“生成”按钮,生成一个由10个随机大写字母组成的字符串,并在文本框中显示。然后,单击“排序”按钮,将此随机字符串中的各个字母按递增顺序添加到列表框中。

程序运行界面如下:

[程序]

As String

Private Sub get_Click()

Dim i As Integer

Randomize

For i = 1 To 10

str1 = Trim(str1) & Chr(Int( ___(1)___ ))

Next

Text1.Text = str1

End Sub

Private Sub sort_Click()

Dim i As Integer

Dim j As Integer

For i = 1 To 26

j = ___(2)___

Do While j > 0

___(3)___

j = j - 1

Loop

Next

End Sub

Private Function search(str1 As String, str2 As String) As Integer

Dim int1 As Integer, int2 As Integer

int1 = 1

Do

int1 = ___(4)___

If int1 = 0 Then Exit Do

int2 = int2 + 1

int1 = int1 + 1

Loop

search = ___(5)___

End Function (

试题六(15分,每空3分)

阅读以下说明和C++程序,将应填入___(n)___处的字句写在答题纸的对应栏内。

[说明]

字符串在程序设计中扮演着重要角色。现需要设计字符串基类string,包含设置字符串、返回字符串长度及内容等功能。另有一个具有编辑功能的串类edit_string,派生于string,在其中设置一个光标,使其能支持在光标处的插入、删除操作。

[程序]

#include

#include

#include

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<

};

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);

搜索更多关于: 程序员考试大纲+2008年真题 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

} while ( key<=1 ); printf( \decode of telegraph:'%s' is:\\n'%s'\\n\old,key ) ); } 试题五(15分,每空3分) 阅读以下说明及Visual Basic 程序代码,将应填入___(n)___处的字句写在答题纸的对应栏内。 [说明] 本程序实现如下功能:首先,单击“生成”按钮,生成一个由10个随机大写字母组成的字符串,并在文本框中显示。然后,单击“排序”按钮,将此随机字符串中的各个字母按递增顺序添加到列表框中。 程序运行界面如下: [程序] As String Privat

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com