C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[70134] Assignment2.... anyone try?
KOREAN [] 6657 읽음    2013-09-17 05:10
Assignment #2
Due Date October 30
CIT 2266 Object Oriented Programming
Objective:
 To develop skills manipulating strings and becoming familiar with the String class
 Converting primitive type to Objects
 Converting Object to primitive types
 Converting one data type to others
Directions:
Design a class named MyString that implements the following methods
1. Write a static method isSubString in the class MyString that searches for a specific
string (could be a character or a word) within another string; the method must return
true if the former exists in the latter string otherwise the method must return false.
For example the following calls will return true
MyString.isSubString(“cat”,”the cat in the hat.”)
MyString.isSubString(“he cat”,”the cat in the hat.”)
MyString.isSubString(“at.”,”the cat in the hat.”)
while the following will return false:
MyString.isSubString(“bat”,”the cat in the hat.”)
MyString.isSubString(“mouse”,”the cat in the hat.”)
MyString.isSubString(“at!”,”the cat in the hat.”)
2. Write a non-static method isSubString in the class MyString that searches for a
specific string (could be a character or a word) within the object’s data; the method
must return true if the argument is in the object’s data otherwise the method must return
false.
For example the following calls will return true
MyString sentence = new MyString(“the cat in the hat.”);
sentence.isSubString(”cat”);
sentence.isSubString(“he cat”) ;
bool found = new MyString(“the cat in the hat.”).isSubString(“at.”);
while the following will return false:
sentence.isSubString(“bat”)
sentence.isSubString(“mouse”)
sentence.isSubString(“at!”)

+ -

관련 글 리스트
70134 Assignment2.... anyone try? KOREAN 6657 2013/09/17
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.