Question: OOPS with Design Patterns Input: S= 2-5g-3-J, K=2 Output: 2-5G-3J Explanation: Remove the dashes from string S as 25 3J; then divide it into groups

 OOPS with Design Patterns Input: S= "2-5g-3-J", K=2 Output: "2-5G-3J" Explanation:

OOPS with Design Patterns

Input: S= "2-5g-3-J", K=2 Output: "2-5G-3J" Explanation: Remove the dashes from string S as "25 3J; then divide it into groups of 2 separated by dashes as in "2-5g-3J" and then all lowercase converted to uppercase i.e., "2-5G-3J". Here, since the characters in the string could not be evenly divided into groups of 2, the first group had fewer characters. Driver Code: Input Flle: (Here S and K values are separated by a tab spoce) \begin{tabular}{ll} \hline 5F3Z2e9w & 4 \\ 25g3J & 2 \\ 4G GT-psTW & 6 \\ \hline \end{tabular} //You are encouraged to add more lines of input Corresponding Output File: \begin{tabular}{l} 5F3Z-2E9W \\ 2-5G-3J \\ 4-GTPSTW \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!