轻舞飞扬
(七烨)
高级会员

神
UID 94218
精华
0
积分 760
帖子 1425
金钱 760 喜悦币
威望 0
人脉 0
阅读权限 50
注册 2007-6-20 来自 魔族(墨月)
状态 离线
|
再发几个笔试题
// ----------- Test PHP questions ---------------------
// Write a function that determines if a string starts with an upper-case letter A-Z
//写一个函数,判断一个字符串首字母是否以大写字母A-Z开头。
function startsWithUpper( $str ) {
// --- Your code here ---
}
// Write a function that determines the area of a circle given the radius
//写一个函数,判断一个给定半径的圆的面积。
function areaOfCircle( $radius ) {
// --- Your code here ---
}
// Add up all the values in an array of numbers.
// 给一个数值型数组添加值(成员)
function addValuesInArray( $array ) {
// --- Your code here ---
}
// Write a recursive function to multiply all the values in an array of numbers.
// 写一个递归函数,用来遍历一个数值型数组中的所有值(成员)
function recursiveArrayMultiply( $array ) {
// --- Your code here ---
}
// Are there any bugs in the following function, and if so, what are they?
//在下边的函数中是否有小bug,如果有,是什么bug?
/**
* Determines whether the string contains a certain character.
* @param char $char A single character
* @param string $string A string of characters
* @return boolean True if the string contains the specified character.
*/
function stringContainsChar( $char, & $string ) {
for( $i=1; $i<=strlen( $string ); $i++) {
if( $string[$i] = $char ) return true;
}
return 'false';
}
// You are given this sample code:
//给出一些代码(例子)
$a = new A();
$a->addNumber( 3 );
$a->addNumber( 5 );
print $a->getNumber() . "\n"; // prints "8\n";
// From the above code, write an implementation of class A.
// 从上边的代码开始,写一个完整的类A.
// Create a dynamic web page that displays a list of countries in alphabetical order,
// and which allows countries to be removed from the list, and allows new countries to be
// added to the list. The list of countries should be stored in a text file,
// called countries.txt , in the same directory as your PHP script, and each line of
// the file should correspond to one country. An example countries.txt file is:
United States
Australia
Serbia
Canada
China
// Bonus question: Attempt the above (displaying the list of countries, and allowing countries
// to be added or removed) using MediaWiki 1.9.3, and storing the list of countries in a wiki page.
// The form for displaying, adding, and removing countries should be a Special page.
// MediaWiki 1.9.3 can be downloaded from http://download.wikimedia.org/me ... iawiki-1.9.3.tar.gz
// Some documentation on writing a special page can be accessed from here:
// http://www.mediawiki.org/wiki/Writing_a_new_special_page
// Credit WILL be given for partial or incomplete answers, so even if you have a partial
// or unfinished answer, please submit that.
|  我轻轻地舞着,在拥挤的人群之中!
你投射过来异样的眼神.
诧异也好,欣赏也罢.
并不曾使我的舞步凌乱.
因为令我飞扬的,不是你注视的目光.
而是我年轻的心! |
|