Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
2. Assume that the value of the alphabet a = 1, b = 2, c = 3, ... , z = 26. You are given a numeric string S. Write a program to print the list of all possible codes that can be generated from the given string.
Sample Input:
1123
Sample Output:
aabc
kbc
alc
aaw
kw
PREFERED LANGUAGE IS JAVA
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 14. Create a JAVA program to read a multi-word string from the user and then find the length of the largest word in the string. Testcase: {"This a Java Programming Problem."} Output: {11}arrow_forwardogramming Languages home-335 LAB Mad Lib-loops Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways Write a program that takes a string and an integer as input and outputs a sentence using the input values as shown in the example below The program repeats until the input string is quit and disregards the integer input that follows Ex If the input is apples 5 shoes 2 quit o the output is Eating 5 apples a day keeps you happy and healthy. Eating 2 shoes a day keeps you happy and healthy. LAB ACTIVITY B 9 3351 LAB Mad Lib-loops 2 #includearrow_forward2. Characters in Strings A large part of the text processing done by computers involves reading user input and figuring out what it means. We'll do something like that today: given a string supplied by a user, we report (1) the total length of the string, (2) how many alphabetic characters, (3) how many numeric characters, (4) how many vowels (a, e, i, o, u) were in that string, and (5) how many of the alphabetics were upper-case. For example, if a user input this line: the program would say: String length: 30 James Bond, 007, works for MI6 Alphabetics: 19, upper-case: 4 Numerics: 4 Vowels: 6 You will need to use a new (to us) function to read the user input. You have been using cin but this won't work for your needs in this program. Instead, use getline (cin,s) where s is a string variable. That string will contain everything the user typed up to but not including the Enter the user typed to end the line. So you have a string but you'll need a loop to check for each individual…arrow_forwardC Programming Lab For students with roll number ending with 5. Write a program to find the sum of the ASCII values of all uppercase alphabets and take the modulus of the sum with 26 and display the obtained value in the output.arrow_forwardThat One Digit Code in C languagearrow_forwardHawaiian Words CSC220 Must use Java Programming. Write a program that gives the pronunciation of a Hawaiian word. For instance, humuhumunukunukuapua’a phonetic guide would be Hoo-moo-hoo-moo-noo-koo-noo-koo-ah-poo-ah'ah The program should start by prompting for and reading in a Hawaiian word (or phrase) from the user. Check if the word is a valid by checking that it only has valid Hawaiian characters. If the word is not valid, warn the user about the offending character and prompt for a Hawaiian word again. Spaces are breaks for words and should be kept intact. The apostrophe is a hard stop andshould be kept in the word. Print the pronunciation of the word (or phrase). Print a dash after every sound as you see in the examples, so you get the syllables separated. Ask the user if they want to do another word. Valid responses are y, Y, n or N. If they want to play more, they can enter another word. If not, then the program ends. You won’t be able to just use the .replace() method.…arrow_forwardplese code in python The midfix of 3 is the middle 3 characters of a string. Given a string input, output the middle three characters of that string. Assume the word length is always odd and at least three characters. Ex: If the input is: xxxtoyxxx the output is: Midfix: toyarrow_forwardJava program not in pythonCreate a java program that will take a string ‘s’ and some integer ‘i’ from the user. Then proceed to write an algorithm that will check within the given string ‘s’, the most vowels found within any substring of ‘s’ of given length ‘i’. You may return an integer for the number of vowels found as the output, see examples below for further explanation • For example, if the user inputs the string; s = “iopuuugab” and an integer i = 3, then the output of “3” will be returned as the string “uuu” contains three vowels • Second example: if the user inputs string “gaspesie” and i =“3” then the output returned is “2”, the strings “esi” and “sie” both contain 2 vowels (note: the vowels do not need to be consecutive) • Third example: if the user inputs the string “Lynx” and integer = “4”, output would be “0” as there are no vowels present. • Fourth example: if the user inputs the string “hello” and integer “2”, output would be “1” as the combinations yield only one…arrow_forwardarrow_back_iosarrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education