用Delphi完成(急急急!)

.NET快速开发框架
博客专家认证
2009-09-01 10:43:36
题目1 (入门)

A. 显示一个表单, 表单上左右分别有一个列表,

当点击Add按钮时, 左边列表中的选中的项目会被移动到右边的列表中去

当点击Remove按钮时, 右边列表中的选中的项目会被移动到左边的列表中去

B. 当用鼠标改变整个表单窗口的大小时, 表单中的两个列表框也按相同的比例改变大小.

说明: 您可以根据自己的创意在这个表单中加入其它功能.



题目2 (进阶)

写一个函数,函数接收的参数是(pStr, pStr_begin, pStr_end),函数输出是一个数组,该数组包含了pStr字符串中所有位于字符串pStr_begin和字符串pStr_end间的字符串。

比如, 参数是 '11AgoodB, AbadBqqqAmanB22', 'A', 'B'

应该得到一个包含了 'good', 'bad', 'man' 的数组.



题目3 (困难)

A. 建立一个数据库DB_test, 其中有一个表TB_test、 表中有ID, Title, Description 3个字段, 其中ID是主键,该表的记录数为十万条。要求接收用户输入的内容, 在该表里面查询, 按照查询结果输出Title和Description 。

B. 用户输入的内容形式有:

1. a b c (表示标题title字段和内容Description 字段中同时含a b 和 c 字或词)

例如用户输入: 中国 历史 今天 事件 ,要求在查询的结果中 标题和描述中同时含有 中国 历史 今天 事件 四个词

2. a -b c(表示标题title字段和内容Description 字段中同时含a 和 c ,但不包含b)

例如用户输入: 中国 -历史 今天 -事件 ,要求在查询的结果中 标题和描述中同时含有 中国 今天 两个词 同时不含 历史和事件两个词

C. 用户输入的字词的数量不定。(根据自己对题目的理解进行发挥)
...全文
248 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
diecode 2009-09-02
  • 打赏
  • 举报
回复
这些题目比较简单

楼主最好自己解决,这样成长的快些
jackylove1985 2009-09-02
  • 打赏
  • 举报
回复
晕,你这是把测试题发来这里问,去非技术区看“圳万兴软件delphi软件工程师面试题”。
我有给你回复。这问题也太简单了吧。都是运用于控件,逻辑以及数据库而已。
火龙岛主 2009-09-02
  • 打赏
  • 举报
回复
题目1:
A:Delphi中有现成的向导,直接生成。
B:在Resize事件中写调整的代码。
题目2:需求不明确,分词?
题目3:数据库基础知识操作!
yangxiangpao 2009-09-02
  • 打赏
  • 举报
回复
type
Tarr=array of string;
end;

function TForm1.getarr(const pStr, pStr_begin, pStr_end: string): Tarr;
var
ilen,x,ipos,icount:Integer;
str:string;
bol:Boolean;
begin
ilen:=1;
str:='';
bol:=False;
icount:=0;
ipos:=0;
ShowMessage(IntToStr(length(pStr)));
while (ilen<=Length(pStr)-length(pStr_begin)+1) do
begin
if pStr[ilen]=pStr_begin[1] then
begin
x:=1;
while (x<Length(pStr_begin)) and (pStr[ilen+x]=pStr_begin[x+1]) do
begin
x:=x+1;
end;
if (x=Length(pStr_begin)) and (ilen+x<=Length(pStr)) then
begin
ipos:=ilen+X;
bol:=True;
end;
end;
if bol then
begin
if pStr[ipos]<>pStr_end[1] then
begin
str:=str+pstr[ipos];
ipos:=ipos+1;
end
else
begin
x:=1;
while (x<Length(pStr_end)) and (pStr[ipos+x]=pStr_end[x+1]) do
begin
x:=x+1;
end;
if x=Length(pStr_end) then
begin
Inc(icount);
SetLength(Result,icount);
Result[icount-1]:=Trim(str);
str:='';
bol:=False;
end
else
begin
str:=str+pstr[ipos];
ipos:=ipos+1;
end;
end;
end;
Inc(ilen);
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
arr:Tarr;
i:Integer;
begin
arr:=getarr(Edit3.Text,Edit4.Text,Edit5.Text);
for i:=Low(arr) to High(arr) do
begin
Memo1.Lines.Add(arr[i]);
end;
end;

测试通过,pStr_begin和pStr_end可以为字符串
给分 楼主
yangxiangpao 2009-09-02
  • 打赏
  • 举报
回复
第二道
type
Tarr=array of string;
end;
getarr(const pStr, pStr_begin, pStr_end: string): Tarr;
var
ilen,x,ipos,icount:Integer;
str:string;
bol:Boolean;
begin
ilen:=1;
str:='';
bol:=False;
icount:=0;
ipos:=0;
ShowMessage(IntToStr(length(pStr)));
while (ilen<=Length(pStr)-length(pStr_begin)+1) do
begin
if pStr[ilen]=pStr_begin[1] then
begin
x:=1;
while (x<Length(pStr_begin)) and (pStr[ilen+x]=pStr_begin[x+1]) do
begin
x:=x+1;
end;
if (x=Length(pStr_begin)) and (ilen+x<=Length(pStr)) then
begin
ipos:=ilen+X;
bol:=True;
end;
end;
if bol then
begin
if pStr[ipos]<>pStr_end[1] then
begin
str:=str+pstr[ipos];
ipos:=ipos+1;
end
else
begin
x:=1;
while (x<Length(pStr_end)) and (pStr[ipos+x]=pStr_end[x+1]) do
begin
x:=x+1;
end;
if x=Length(pStr_end) then
begin
Inc(icount);
SetLength(Result,icount);
Result[icount-1]:=Trim(str);
str:='';
bol:=False;
end
else
begin
str:=str+pstr[ipos];
ipos:=ipos+1;
end;
end;
end;
Inc(ilen);
end;
end;
wxsan 2009-09-01
  • 打赏
  • 举报
回复
的确有难度
goalone1985 2009-09-01
  • 打赏
  • 举报
回复
不是吧 我虽然刚学DElPHI不久。相对大虾还是菜鸟
但是你这些问题也太简单了。。。自己摸索吧
网上查查资料3个小时以内你肯定解决、、、
husion01 2009-09-01
  • 打赏
  • 举报
回复
10分没有威慑力
winstonbonaparte 2009-09-01
  • 打赏
  • 举报
回复
你这是发面试题呢还是想叫别人帮你做啊。分却这么少
zhitaoyang 2009-09-01
  • 打赏
  • 举报
回复
不回答,只接分.哈哈
leeky 2009-09-01
  • 打赏
  • 举报
回复
就是花时间而已.............
老之 2009-09-01
  • 打赏
  • 举报
回复
就看了最后那个,字符串解析,找空格来确定条件数,找减号来确定是用 and 还是 and not,之后组一个SQL查询
cnhxjtoa 2009-09-01
  • 打赏
  • 举报
回复
ding ding ding..................

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧