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, 22.06.2019 15:00
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
question
Computers and Technology, 22.06.2019 21:00
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr.nextdouble(); minutestraveled = scnr.nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system.out.println("miles: " + milestraveled); } }
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Technician a says that with self-adjusting clutch systems, the release bearing constantly rotates. technician b says that the ball bearing portion of the release bearing should be lubricated with high-temperature grease during routine maintenance. which technician is correct?
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, 30.03.2021 22:10
question
Mathematics, 30.03.2021 22:10
Questions on the website: 13722360