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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, huntbuck14
Which of the following methods could be considered a “best practice” in terms of informing respondents how their answers to an on-line survey about personal information will be protected? respondents are informed that investigators will try to keep their participation confidential; however, confidentiality cannot be assured. respondents are informed that a research assistant will transfer all the research data to a password-protected computer that is not connected to the internet, via a usb flashdrive. the computer is located in a research team member’s office. the investigator uses the informed consent process to explain her institution’s method for guaranteeing absolute confidentiality of research data. the investigator uses the informed consent process to explain how respondent data will be transmitted from the website to his encrypted database without ever recording respondents’ ip addresses, but explains that on the internet confidentiality cannot be absolutely guaranteed.
Answers: 1
image
Computers and Technology, 22.06.2019 06:20, Masielovebug
In what kind of attack can attackers make use of millions of computers under their control in an attack against a single server or network availability confidentiality integrity identity automated attack software? those who wrongfully disclose individually identifiable health information can be fined up to what amount per calendar year? single most expensive malicious attack hipaa what are script kiddies? advanced persistent threat security manager security engineer what level of security access should a computer user have to do their job what process describes using technology as a basis for controlling the access and usage of sensitive data? cybercriminal
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, gamingisfun
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
You know the right answer?
Write an expression to detect that the first character of the userinput matches the firstletter.

Questions in other subjects:

Konu
Arts, 28.09.2021 23:00
Konu
Mathematics, 28.09.2021 23:10
Konu
Computers and Technology, 28.09.2021 23:10