文件名称:ep3
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
北京理工大学面向对象程序设计第三次上机习题答案~-1. Define MyString class with demands as follows:
1.1 MyString can save any string
1.2 Overload operator+ to append string to another one
1.3 Define Find function to locate the position of searching a character
1.4 Define Mid function to get substring one string
1.5 The client can use MyString you define like as in the main:
void main()
{
MyString s1( China ), s2
s2 = Love
cout << I + s2+ s1
int pos = s1.Find( a ) // pos is 4, or zero if a is not found.
int a = 1, b = 3
MyString my = s2.Mid(a, b) // a represents starting position, b represents length. So Mid can get substring.
}
NOTE: The type, string in C++, is forbidden in your program.
2. Define InternetURL class to save a URL string like as www.bit.edu.cn ,and finish the demands as follows:
2.1 Use MyString you just finished before to save URL string;
2.2 Define member function getDomain
1.1 MyString can save any string
1.2 Overload operator+ to append string to another one
1.3 Define Find function to locate the position of searching a character
1.4 Define Mid function to get substring one string
1.5 The client can use MyString you define like as in the main:
void main()
{
MyString s1( China ), s2
s2 = Love
cout << I + s2+ s1
int pos = s1.Find( a ) // pos is 4, or zero if a is not found.
int a = 1, b = 3
MyString my = s2.Mid(a, b) // a represents starting position, b represents length. So Mid can get substring.
}
NOTE: The type, string in C++, is forbidden in your program.
2. Define InternetURL class to save a URL string like as www.bit.edu.cn ,and finish the demands as follows:
2.1 Use MyString you just finished before to save URL string;
2.2 Define member function getDomain
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1120141884-刘晶晶\exper3-1.cpp
.................\exper3-2.cpp
.................\exper3-3.cpp