Skip to main content

Algorithm Analysis and Design Concepts Hands-On | Replace Character

 Algorithm Analysis and Design Concepts

 Hands-On

 Replace Character

String – Replace Characters 

Write a recursive function 'public static String replace(String str,char from,char to) ' that changes all occurrences of 'from' in ‘str’ to ‘to’.

For example, if str were "codebook", and from = 'o' and to = 'e', then, str would become "cedebeek".

Function Definitions:

public static String replace(String str, char from, char to)


Problem Requirements:

Keyword

Min Count

Max Count

for

0

0

while

0

0

 

Note: 
Create the main() inside the class 'ReplaceDriver'

Refer sample input and output for formatting specifications.


Sample Input and Output :

Enter the string

Asia

Enter the character to be replaced

a

Enter the character to be replaced with

i

The modified string is Asii

Algorithm Analysis and Design Concepts   Hands-On   Replace Character  String – Replace Characters   Write a recursive function 'public static String replace(String str,char from,char to) ' that changes all occurrences of 'from' in ‘str’ to ‘to’.  For example, if str were "codebook", and from = 'o' and to = 'e', then, str would become "cedebeek".   Function Definitions:  public static String replace(String str, char from, char to)    Problem Requirements:  Keyword  Min Count  Max Count  for  0  0  while  0  0     Note: Create the main() inside the class 'ReplaceDriver'  Refer sample input and output for formatting specifications.   Sample Input and Output :   Enter the string  Asia  Enter the character to be replaced  a  Enter the character to be replaced with  i  The modified string is Asii      Evaluation Result:     Result Description Summary of tests  *Note: All the test cases might not have same weightage +------------------------------+ |  8 tests run/ 8 tests passed | +------------------------------+   Accenture 2022 Pre Learning 2023

Evaluation Result:


 

Result Description

Summary of tests
*Note: All the test cases might not have same weightage
+------------------------------+
|  8 tests run/ 8 tests passed |
+------------------------------+
 

Comments

Must Read:

RDBMS Data Definition Language | Create Sales_info table

  Write a query to create Sales_info with constraints mentioned. Refer the below schema  Result Description Summary of tests +------------------------------+ | 3 tests run / 3 test passed | +------------------------------+

Algorithm Analysis and Design Concepts Data Structure and Algorithms Post-Quiz

Algorithm Analysis and Design Concepts       Data Structure and Algorithms            Post-Quiz  

Algorithm Analysis and Design Concepts Analysis of Algorithms Post-Quiz

 Algorithm Analysis and Design Concepts       Analysis of Algorithms            Post-Quiz  

RDBMS Data Definition Language | Change the name of the table Sales Info

  RDBMS  Data Definition Language  Change the name of the table Sales Info Write an SQL statement to rename the table Sales Info to Sales_Information. (Hint: use alter command to rename the table name) Evaluation Result: Result Description Summary of tests +------------------------------+ | 1 tests run / 1 test passed | +------------------------------+

Mock 3 Slot3 - Quiz - 21st July Quiz Quiz

Mock 3 Slot3        Quiz - 21st July          Important Questions

Logic Development | Object Oriented Programming Post Quiz

 Logic Development | Object-Oriented Programming | Post Quiz

Programming using Java Hands On - Control Structures | Print Username

  Print Username Jeffy, who is going to complete the higher education in this year needs to create a simple application which accept the name of a person and welcome them with a message along with their name. She wants to read the data using the class "Scanner". Implement this scenario using Java. Sample Input 1:   Enter the name: Johson Sample Output 1: Welcome Johnson. Sample Input 2:   Enter the name: Stain Polson Sample Output 2: Welcome Stain Polson. Result Description Summary of tests *Note: All the test cases might not have same weightage +------------------------------+ | 2 tests run/ 2 tests passed | +------------------------------+

Logic Development | Object Oriented Programming Pre Quiz

 

Zig Zag Pattern

  /* @ToDo     Zig Zag Pattern         *               *                *       *       *       *        *               *               *        */ #include   <iostream> using   namespace   std ; int   main (){       #ifndef  ONLINE_JUDGE          freopen ( "../asset/input.txt" , "r" , stdin );          freopen (...

Subscribe to Get's Answer by Email