Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++ please! must use basic c++! WARNING: You MUST use while loop to complete this exercise to receive points! Write a program that accepts

In c++ please! must use basic c++!

WARNING: You MUST use while loop to complete this exercise to receive points!

Write a program that accepts in input 2 strings of equal (but variable) length. Iterate through the strings as long as the same letter appears at the same index. Output the number of matching letters found before the mismatch. For example, if the strings are:

ABHBFAAT ABHBFRAT 

The program should output:

5 

Because there are 5 matching letters before the first mismatch at index 5. Note that remaining letters are not counted, even if they match.

Any attempt to hard code answers will result in a 0 for the exercise.

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

Step: 3

blur-text-image

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

apply the principles of scheduling.

Answered: 1 week ago