subject

Write an expression to detect that the first character of the userinput matches the firstletter.
sample program:
#include
#include
using namespace std;
int main() {
string userinput;
char firstletter = '-';
userinput = "banana";
firstletter = 'b';
if () {
cout < < "found match: " < < firstletter < < endl;
}
else {
cout < < "no match: " < < firstletter < < endl;
}
return 0;
}
print "censored" if user text contains the word "darn", else print userinput. end with new line.
sample program:
#include
#include
using namespace std;
int main() {
string userinput;
userinput = "that darn cat.";
return 0;
}
set haddigit to true if the 3-character passcode contains a digit.
sample program:
#include
#include
#include
using namespace std;
int main() {
bool hasdigit = false;
string passcode;
int valid = 0;
passcode = "abc";
if (hasdigit) {
cout < < "has a digit." < < endl;
}
else {
cout < < "has no digit." < < endl;
}
return 0;
}
replace any space ' ' by '_' in 2-character string passcode.
sample program:
#include
#include
#include
using namespace std;
int main() {
string passcode;
passcode = "1 ";
cout < < passcode < < endl;
return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
question
Computers and Technology, 23.06.2019 21:10
Asample of 200 rom computer chips was selected on each of 30 consecutive days, and the number of nonconforming chips on each day was as follows: 8, 19, 27, 17, 38, 18, 4, 27, 9, 22, 30, 17, 14, 23, 15, 14, 12, 20, 13, 18, 14, 20, 9, 27, 30, 13, 10, 19, 12, 26. construct a p chart and examine it for any out-of-control points. (round your answers to four decimal places.)
Answers: 2
You know the right answer?
Write an expression to detect that the first character of the userinput matches the firstletter.
Questions
question
Mathematics, 05.02.2020 09:49
Questions on the website: 13722361