Question: Exercise 6 : Extracting the Middle ( Reference: Textbook Chapter 3 Worked Example 3 . 1 ) ( for coamination of the problem. save Companice
Exercise : Extracting the Middle Reference: Textbook Chapter Worked Example
for coamination of the problem. save Companice Site
Your task is to extract a string comtaining the middle character from a given string ser For example, if the string is "crate", the result is the string However, if the string has an even number of letters, extract the midlle rwo charactes If the string is "crases", the result is
Step Decide on the branching condition
We aced to tuke different actions for strings of codd and cuen length.
Derefore, the condizion is s the lingth of the srring odd?
In lava, you use the remainder of division by in find out utether a value is even of odd Then ife lest becomes strjengthi
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
