Computer Programming 2 Module 2 & 3
Quiz yourself by thinking what should be in
each of the black spaces below before clicking
on it to display the answer.
Help!
|
|
||||
---|---|---|---|---|---|
Check if a character is a digit | show 🗑
|
||||
show | islower()
🗑
|
||||
show |
TEST STRING
🗑
|
||||
show | 4
🗑
|
||||
A function which checks if a character is printable | show 🗑
|
||||
#include <cctype> #include <iostream> #include <cstring> using namespace std; int main() { char str[] = "THIS IS A TEST"; for (int i=0; i<strlen(str); i++) putchar(tolower(str[i])); return 0; } | show 🗑
|
||||
#include <iostream> #include <string> using namespace std; int main () { string str1 = "Hello "; string str2 = "World"; string str3; str3 = str1.append(str2); cout << str3 << endl; return 0; } | show 🗑
|
||||
show | Word is found at index 10
🗑
|
||||
Which of the following converts string to float? | show 🗑
|
||||
Which of the following function converts a numerical value to string? | show 🗑
|
||||
show | Blank output
🗑
|
||||
show | stod
🗑
|
||||
show |
#####
🗑
|
||||
show |
#include <string>
🗑
|
||||
What is the output of the following program? #include <string> #include <iostream> using namespace std; int main() { string x = "Bad "; cout << x.append(Romance); return 0; } | show 🗑
|
||||
It returns true if str is an empty string | show 🗑
|
||||
Check if a character is blank | show 🗑
|
||||
What is the output of the given program? #include <iostream> #include <ctype.h> int main () { int i=0; char str[]="first line "; return 0; } | show 🗑
|
||||
Which of the following is a ctype function? | show 🗑
|
||||
show |
strcmp()
🗑
|
||||
It returns the uppercase version of a character expression. | show 🗑
|
||||
show |
strcat()
🗑
|
||||
Which of the following is a cstring function? | show 🗑
|
||||
show |
9 1 4
🗑
|
||||
#include <cctype> #include <iostream> #include <cstring> using namespace std; int main() { char str[] = "c++ programming"; for (int i=0; i<strlen(str); i++) putchar(toupper(str[i])); return 0; } | show 🗑
|
||||
What is the output of the following program? #include <string> #include <iostream> using namespace std; int main() { string x = "Bad "; cout << x.append("Liar"); return 0; } | show 🗑
|
||||
show | 1
🗑
|
||||
show |
14
🗑
|
||||
show |
string
🗑
|
||||
#include <iostream> #include <string> #include <cmath> using namespace std; int main () { string s = "54.55"; double php = stod(s); cout << "A dollar is equivalent to " << php return 0; } | show 🗑
|
||||
What is the output of the following program? #include <iostream> #include <string> using namespace std; int main () { string str1 = "Trust"; int len = str1.size() cout << len << endl; return 0; } | show 🗑
|
||||
show |
fprintf()
🗑
|
||||
Creates a new file or open an existing file | show 🗑
|
||||
show | iostream
🗑
|
||||
Which operator is used to insert the data into the file? | show 🗑
|
||||
Which header file is used for reading and writing to a file? | show 🗑
|
||||
Which stream class is to only read from files? | show 🗑
|
||||
show | Error
🗑
|
||||
show | Error
🗑
|
||||
show |
associate of the class
🗑
|
||||
Which of the following best defines a class? | show 🗑
|
||||
show |
Abstraction
🗑
|
||||
Blueprint of an object | show 🗑
|
||||
show | Error
🗑
|
||||
If a class is named Car and you will create an object named SportsCar, what would be the statement? | show 🗑
|
||||
If a class is named Fruits and you will create an object named Apple, what would be the statement? | show 🗑
|
||||
Which of the following operator is used for cout? | show 🗑
|
||||
show |
rb
🗑
|
||||
Closes a file | show 🗑
|
||||
What is the correct syntax for fclose() | show 🗑
|
||||
show | Gets a character, put it into a file pointer until an enter is pressed
🗑
|
||||
show |
fstream
🗑
|
||||
The ifstream would be used when: | show 🗑
|
||||
A C++ library that allows working with files | show 🗑
|
||||
What is meant by ofstream in c++? | show 🗑
|
||||
A behavior an object | show 🗑
|
||||
show |
Member Functions
🗑
|
||||
Objects created are based on what? | show 🗑
|
||||
An object is a _________________ of a class | show 🗑
|
||||
show |
Member function
🗑
|
||||
show |
A class has a default privacy specification of private
🗑
|
Review the information in the table. When you are ready to quiz yourself you can hide individual columns or the entire table. Then you can click on the empty cells to reveal the answer. Try to recall what will be displayed before clicking the empty cell.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.
Normal Size Small Size show me how
Normal Size Small Size show me how
Created by:
bobo ni jabez