Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please create a function aka header file. for the following question in CPP. 3. Broken Key on the Keyboard Suppose we have a user, where
Please create a function aka header file. for the following question in CPP.
3. Broken Key on the Keyboard Suppose we have a user, where we ask them to confirm their name. We already know their name, but they enter a text that's different from what we have on record. Write a function that takes in two strings, the expected string, and the actual string we recieved, and determine whether we should display a message saying "A key on your keyboard might be broken". A broken key is defined as follows: the user pressed it, but it did not appear in the string. Function signature: bool broken_keys(std::string expected, std::string actual) Example: Input: expected="ANGELO", actual="ANELO" Output: true Explanation: Since we were expecting to see ANGELO, and the user wrote ANELO, they missed the G. It is possible that they pressed it but it did not register, hence the possibility of a broken key. Input: expected="TOM", actual="TOM" Output: false Explanation: We have no evidence of a broken key here, because all the chars we expeced have been entered
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started