Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you please tell me how to fix this code (C++) Answer doesn't match Input h10567 Your output Invalid Expected output Valid 5: Compare output

Could you please tell me how to fix this code (C++)

Answer doesn't match

image text in transcribedimage text in transcribed
Input h10567 Your output Invalid Expected output Valid 5: Compare output Input 7260584013 Your output Invalid 6: Compare output Input 6TNA8vn Your output Invalid X 7: Compare output Output differs. See highlights below. Input 528B30Y6 Your output Invalid Expected output ValidOutput "Valid" if input contains at least 4 numbers and input's length is less than or equal to 8. Otherwise, output "Invalid". Ex: If input is test123, output: Invalid Recall isdigit() checks if the character passed is a digit. EX: isdigit( '8' ) returns a non-zero value. isdigit( ' a' ) returns 0. #include using namespace std; int main () { bool isValid; string keyword; int count = 0; cin >> keyword; for (int i = 0; i=8; it+) { if (isdigit (keyword [i] ) ) { count++; if (isValid) { cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions