NEW
Font size
WorksheetsHTML PHP C++
Total questions: 10
Worksheet time: 50mins
In HTML, Set the max numbers of characters allowed in the input field to 40.
<input type="text" maxlength="40" >
<input type="40" maxlength="text" >
<input type="text" "maxlength"="40" >
<input type="text" maxlength="" >
Use the correct HTML attribute to make the link open in a new window.
<a href="html_images.asp" target="_blank" >HTML Images</a>
<a href="html_images.asp" target="blank" >HTML Images</a>
<br href="html_images.asp" target="_blank" >HTML Images</br>
<a link="html_images.asp" target="_blank" >HTML Images</a>
In the HTML form below, add two option elements to the drop down list.
The first option must have the value "Proton" The second option must have the value "Perodua".
<radio value="Proton">Proton</>
<radio value="Perodua">Perodua</>
<select value="Proton">Proton</>
<select value="Perodua">Perodua</>
<option value="Proton">Proton</>
<option value="Perodua">Perodua</>
<name value="Proton">Proton</>
<option name="Perodua">Perodua</>
Get the length of the string "Hello World!" in PHP.
echo ("Hello World!");
echo strlen("Hello World!");
echo strrev("Hello World!");
echo str_replace("Hello World!");
Use the correct comparison operator in PHP to check if $a is NOT equal to $b.
var_num($a != $b);
var_num($a == $b);
var_num($a x= $b);
var_num($a = $b);
Create a loop in PHP that runs from 0 to 9.
do ($i = 1; $i < 10; $i++) { echo $i; }
for ($i = 1; $i < 10; $i++) { echo $i; }
for ($i = 0; $i < 9; $i++) { echo $i; }
for ($i = 0; $i < 10; $i++) { echo $i; }
Use the correct keyword in C++ to get user input, stored in the variable y:
int x; cout << "Type a num: "; cin>> x;
int y; cout << "Type a num: "; cin>> y;
int y; cin<< "Type a num: "; cout>> y;
int x; cin<< "Type a num: "; cout>> x;
Print "Yes" if x is equal to y, otherwise print "No" in C++.
if (x==y){cout<<"No" ;}
else
{cout<<"Yes" ;}
if (x==y){cout<<"Yes" ;}
else
{cout<<"No" ;}
if (x!=y){cout<<"Yes" ;}
else
{cout<<"No" ;}
if (x==y){cin<<"Yes" ;}
else
{cin<<"No" ;}
Insert the missing part to print the number in main, by using a specific keyword inside myfunc in C++
int myfunc (int x) { cout 5 + x; }
int myfunc (int x) { cin 5 + x; }
int myfunc (int x) { return 5 + x; }
int myfunc (int x) { main 5 + x; }
Use access specifiers to set the x variable to public and y to private in C++
class MyClass { public:
int x;
private:
int y; };
class MyClass { public:
int y;
private:
int x; };
class MyClass { private:
int x;
private:
int y; };
class MyClass { public:
int y;
public:
int x; };
