Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C,

C,

Scheduled Pinned Locked Moved C / C++ / MFC
databasetutorialquestion
3 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ajay Kumar May2021
    wrote on last edited by
    #1

    Question:
    Replace all the vowels of the given input string with a single digit number.
    Input:
    String of length L and all lower-case letters.
    Output:
    Input String replaced with the digit.
    Program explanation:
    Replace all the vowels in the given input string with a single digit number you get after all the below
    steps.
    Step 1: Get the index of the vowel in the given input.
    Step 2: Multiply the index with 100.
    Step 3: Sum all the prime numbers between 1 and the resulting number from last step.
    Step 4: Add the digits of the number you get from the last step until you get a single digit.
    Step 5: Now, Replace the vowel with the digit from the last step.

    Input: hello Output: h7ll9 Explanation: Step 1: First vowel found at index 1. Step 2: 1 * 100 = 100 Step 3: Sum of prime numbers between 1 and 100 is 1060 Step 4: Sum of each digit until we get single digit: = 1 + 0 + 6 + 0 = 7 Step 5: Replace e with 7 Output now: h7llo Step 1: Next vowel found at index 4. Step 2: 4 * 100 = 400 Step 3: Sum of prime numbers between 1 and 400 is 13887 Step 4: Sum of each digit until we get single digit: = 1 + 3 + 8 + 8 + 7 = 27 = 2 + 7 = 9 Step 5: Replace o with 9 Final output: h7ll9 Example 2: Input : replace this Output. : r7pl9c1 th5s

    L 2 Replies Last reply
    0
    • A Ajay Kumar May2021

      Question:
      Replace all the vowels of the given input string with a single digit number.
      Input:
      String of length L and all lower-case letters.
      Output:
      Input String replaced with the digit.
      Program explanation:
      Replace all the vowels in the given input string with a single digit number you get after all the below
      steps.
      Step 1: Get the index of the vowel in the given input.
      Step 2: Multiply the index with 100.
      Step 3: Sum all the prime numbers between 1 and the resulting number from last step.
      Step 4: Add the digits of the number you get from the last step until you get a single digit.
      Step 5: Now, Replace the vowel with the digit from the last step.

      Input: hello Output: h7ll9 Explanation: Step 1: First vowel found at index 1. Step 2: 1 * 100 = 100 Step 3: Sum of prime numbers between 1 and 100 is 1060 Step 4: Sum of each digit until we get single digit: = 1 + 0 + 6 + 0 = 7 Step 5: Replace e with 7 Output now: h7llo Step 1: Next vowel found at index 4. Step 2: 4 * 100 = 400 Step 3: Sum of prime numbers between 1 and 400 is 13887 Step 4: Sum of each digit until we get single digit: = 1 + 3 + 8 + 8 + 7 = 27 = 2 + 7 = 9 Step 5: Replace o with 9 Final output: h7ll9 Example 2: Input : replace this Output. : r7pl9c1 th5s

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Sorry, but this site does not provide code to order. This is your assignment so you are expected to do the work. If you need some guidance to get started then take a look at How to Write Code to Solve a Problem, A Beginner's Guide[^].

      1 Reply Last reply
      0
      • A Ajay Kumar May2021

        Question:
        Replace all the vowels of the given input string with a single digit number.
        Input:
        String of length L and all lower-case letters.
        Output:
        Input String replaced with the digit.
        Program explanation:
        Replace all the vowels in the given input string with a single digit number you get after all the below
        steps.
        Step 1: Get the index of the vowel in the given input.
        Step 2: Multiply the index with 100.
        Step 3: Sum all the prime numbers between 1 and the resulting number from last step.
        Step 4: Add the digits of the number you get from the last step until you get a single digit.
        Step 5: Now, Replace the vowel with the digit from the last step.

        Input: hello Output: h7ll9 Explanation: Step 1: First vowel found at index 1. Step 2: 1 * 100 = 100 Step 3: Sum of prime numbers between 1 and 100 is 1060 Step 4: Sum of each digit until we get single digit: = 1 + 0 + 6 + 0 = 7 Step 5: Replace e with 7 Output now: h7llo Step 1: Next vowel found at index 4. Step 2: 4 * 100 = 400 Step 3: Sum of prime numbers between 1 and 400 is 13887 Step 4: Sum of each digit until we get single digit: = 1 + 3 + 8 + 8 + 7 = 27 = 2 + 7 = 9 Step 5: Replace o with 9 Final output: h7ll9 Example 2: Input : replace this Output. : r7pl9c1 th5s

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Step 0: Get input.

        It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups