Exercise 1: Ask for a birthday, a favorite gift, and their dream job is and display that information within a block in a fromated string
Q: X166: nestParen Given a string, return true if it is a nesting of zero or more pairs of parentheses,…
A: Given To complete the java function public boolean nestParen(String str) { }
Q: 1. Write a regular expression to find the set of all strings with two consecutive repeated words…
A: Given: 1. Write a regular expression to find the set of all strings with two consecutive repeated…
Q: 7.10 LAB: Mad Lib - loops (edited) Mad Libs are activities that have a person provide various words,…
A: Since you are not specifying any language for implementation, I choose python language. Program…
Q: 1- The operator must be followed by the variable that will store the data that is going to be…
A: Answers: Answer-1: The correct option is (a) => the stream Explanation: The stream is used in C++…
Q: 1. Using FLEX, write a program that works like a letter generator. The program must start by reading…
A: similar/same code given in step 2: Explanation: The accompanying flex input indicates a scanner…
Q: Wap How to search a word inside a string?
A: Introduction: A Java string is a character sequence that exists as an object of the type java. lang.…
Q: Morse code is a code where each letter of the English alphabet, each digit, and various punctuation…
A: Morse code is a method used in telecommunication to encode text characters as standardized sequences…
Q: Write a program that reads your id and full name and display. And also display the index of first…
A: To do: write program according to given
Q: Assume nextWord is a String variable that has been given a String value that is entirely made up of…
A: Here, A program statement is given.
Q: 5. The correct way to check if the following two String objects, max and min, contains same values…
A: we have to compare max and min strings equals() is the method to compare strings and it is case…
Q: Q3: Write a program to: • ask the users for a line of text then re-display this line, but with all…
A: Given: Java program to : ask users for a line of text then re-display this line with all lowercase…
Q: Question 4a: Construct a DFA which accepts all strings over A = {a, b, c, d, e, f, g} which have…
A: DFA short for Deterministic Finite Automata is a machine with a fixed number of states which accepts…
Q: Assume nextWord is a String variable that has been given a String value that is entirely made up of…
A: SOLUTION : Given that: Here the topic is about a String variable that has been given a String…
Q: A string object is ______ which means its contents cannot be changed. Select one: a. Absolute b.…
A: Answer to the above question is in step2.
Q: t. Write a JAVASCRIPT program to create a random string of lowercase alphabets of length 10 and…
A: Write a JAVASCRIPT program to create a random string of lowercase alphabets of length 10 and display…
Q: Question 2: (Using JAVA) Given the following strings: dateOfBirth = "900113": stateCode = "13" ¡CNO…
A: Pal! You haven't mentioned what a correct IC Number should look like, so I have written the code…
Q: 12. Fibonacci numbers are the numbers in a sequence in which the first three elements are 0, 1, and…
A: 12.Program:a = 0;b = 1;c = 1;fprintf('First 25 Fiboncci numbers are:\n')fprintf('%i %i %i ', a, b,…
Q: JavaScript program to convert object to string and also check whether this is converted into string…
A: Requirements:- JavaScript program to convert the object to string and also check whether this is…
Q: 28. Write a few lines of code to declare a bag of strings and place the strings squash and handball…
A: #include <iostream>#include <vector>#include <string>using std::string; int…
Q: # Exercise 1: Ask for a birthday, a favorite gift, and their dream job is and display = that…
A: I have provided PYTHON CODE along with SCREENSHOT OF CODE WITH OUTPUT-----
Q: 3.8 Declare a string variable containing the name of your favorite color, initialize it as a null…
A: INTRODUCTION: The variable length strings can have as numerous characters as required. For the…
Q: 3. Show the Huffman Code for each character in the following string. “boss demigoddess ship”
A: We are given a string and we are asked the Huffman code for each character. First, we will check…
Q: Write a program to count the number of spaces in a sentence. The sentence is saved in the string…
A: Program code: //include the header files #include <iostream> //std using namespace std;…
Q: 2. Doubloons A string is said to be a doubloon if every letter that appears in the string appears…
A: Program: def isDoubloon(s):d={}for ch in s:if ch in d.keys():d[ch]+=1else:t={ch:1}d.update(t) for k…
Q: Biologists use a sequence of letters A, C, T, and G to model a genome. A gene is a substring of a…
A: Programming Language : Python #prompt and read the genome from the usergenome=input("Enter the…
Q: 13. Consider a freight company. This company may deliver packages around the world. Each package has…
A: 13. Algorithm: Start Read tracking code and store it in code Craete an object of regex b by passing…
Q: xiv) In JAVASCRIPT, write a function that takes input a string and prints whether the first…
A: In JAVASCRIPT, write a function that takes input a string and prints whether the first character of…
Q: EMOTIFY PROBLEM: Create a function that changes specific words into emoticons. Given a sentence as a…
A: def emotify(string): #creating a function if("smile" in string):…
Q: State whether each of the following is true or false . If false , explain why. a. When String…
A: let's see the solution
Q: Question 11 reads a line of input, including leading and embedded spaces, and stores it in a string…
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other…
Q: QUESTION 11 An anonymous String a. has no value b. can be changed c. None of these d. is a string…
A:
Q: Checkpoint 3.59 Assume the variables name1 and name2 reference two different String objects,…
A: Given:
Q: Please include justification: An RNA string is a string over the alphabet {A, C, G,U}.
A: First let's understand what is RNA . We all might have heard about the DNA already . DNA stands for…
Q: 1. Write a program to show the following sentences: I am a student. I love China.…
A: 1) As Coding language is not mentiones i am providing the code in c++: #include…
Q: Excercisel: write a program to enter a user name and display the message (hello) three times. The…
A: As no programming language is mentioned, it is solved using basic C++
Q: **6.18 (Check password) Some websites impose certain rules for passwords. Write a method that checks…
A: Explanation or Logic of code: To carry out this we will utilize the accompanying methodology: we…
Q: d) Write a JAVASCRIPT code to repeat every character thrice of the word "Javascript" and print the…
A: Javascript program to solve the given problem is below.
Q: Write a PHP program to find whether a string entered by the user contains any of the characters '+',…
A: Step 1: Prompt and accept a string. Step 2: Invoke the function charMatch() to check for special…
Q: n a string, the last item is at position (or index) ___________. A 1 B 0 C 10 D -1
A: A string can be refereed as character of array. The indexing of first character begins at index 0.…
Q: Question 4: Write a program that reads in a line consisting of a student's name, Social Security…
A: Program approach:- Using the necessary header file. Using the namespace standard input/output.…
Q: Tick (V) the right answer [True or False]. Statement True False 1 If w is a string then wlw* is a…
A: 1) w1wr is the condition when we check both the strings and returns 1 which is true for string is…
Q: (Yes/No): Must string literals be enclosed in single quotes?
A: In python, String literals can be enclosed in matching single quotes or double quotes.
Q: 2. Write a java program which accepts a string from user and Apply translation operation and show it…
A: Given:
Q: 4.18 Password requirements Websites commonly require a password that satisfies several requirements.…
A: Given: 4.18 Password requirements Websites commonly require a password that satisfies several…
Q: 5. Consider a triangle with vertices at (0,0), (1,0), and (0,1). Write a function with header [S] =…
A: PROGRAM: function [S] = myInsideTriangle(x,y) %Initializing first vertex x1=0; y1=0;…
Q: Write a JavaScript function that would accept a string and return the reverse of that string.…
A: Here I have created a function named reverse(). In this function, I have created an array and then…
Q: Write a F95 program to concatenate two string firstName and last name. Print the concatenated string…
A: Two strings in fortran can be concatenated using // between them like '+' operator in languages like…
Q: - 9. Use string methods to extract the website domain from an email, e.g., from the string…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Step by step
Solved in 3 steps with 1 images
- public static String pancakeScramble(String text) This nifty little problem is taken from the excellent Wolfram Challenges problem site where you can also see examples of what the result should be for various arguments. Given a text string, construct a new string by reversing its first two characters, then reversing the first three characters of that, and so on, until the last round where you reverse your entire current stringcapCount.py make a program called capCount.py that has a function that takes in a string and prints the number of capital letters in the first line, then prints the sum of their indices in the second line. The string "hEllo, World" would should look like this: 2810.17: Morse Code Converter C++Morse code is a code where each letter of the English alphabet, each digit, and various punctuation characters are represented by a series of dots and dashes. Table 10-8 from the textbook shows part of the code. Write a program that asks the user to enter a string, and then converts that string to Morse code. Note that Morse code represents both upper and lower case letters so that both 'A' and 'a' will be converted to ".-". Input Validation.None. Instructor Notes: Note: You can use the Morse table in the book or this site (space isn't listed, but it is just mapped to a space). You will most certainly need to create two parallel arrays to map the characters to the Morse code strings.
- public static String pancakeScramble(String text) This nifty little problem is taken from the excellent Wolfram Challenges problem site where you can also see examples of what the result should be for various arguments. Given a text string, construct a new string by reversing its first two characters, then reversing the first three characters of that, and so on, until the last round where you reverse your entire current string.This problem is an exercise in Java string manipulation. For some mysterious reason, the Java String type does not come with a reverse method. The canonical way to reverse a Java string str is to first convert it to mutable StringBuilder, reverse its contents, and convert the result back to an immutable string, that is,str = new StringBuilder(str).reverse().toString(); Here's the tester it must pass: @Test public void testPancakeScramble() throws IOException {// Explicit test casesassertEquals("", P2J3.pancakeScramble(""));assertEquals("alu",…Can u debug this Program gets a store's department code and a sale transaction value // Output is a list of department codes, names, and total sales // Additionally, a grand total sales value is displayed start num dept num saleValue num NUM_DEPTS = 5 num total[NUM_DEPTS] string DEPT_NAME[NUM_DEPTS] = "Women's apparel", "Men's apparel", "Children's apparel", "Cosmetics", "Accessories", num grandTotal input dept, saleValue while not eof total[dept] = total[dept] + sale endwhile while dept < NUM_DEPTS output dept, DEPT_NAME[dept], total[dept] endwhile output "Grand total", grandTotal stopMad 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 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away. user_text word = "" while True:user_text = input().split()word = (user_text[0])if word == 'quit':breaknumber = (user_text[1]) print('Eating {} {} a day keeps the doctor away.'.format(number, word))
- 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 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away.French Articles: French country names are feminine when they end with the letter e, masculine otherwise, except for the following which are masculine even though they end with e: le Belize le Cambodge le Mexique le Mozambique le Zaïre le Zimbabwe Write a program that reads the French name of a country and adds the article: le for masculine or la for feminine, such as le Canada or la Belgique. However, if the country name starts with a vowel, use l’; for example, l’Afghanistan. For the following plural country names, use les: les Etats-Unis les Pays-Bas5.13 LAB: Password modifier Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "!" to the end of the input string. i becomes 1 a becomes @ m becomes M B becomes 8 s becomes $ Ex: If the input is: mypassword the output is: Myp@$$word! Hint: Python strings are immutable, but support string concatenation. Store and build the stronger password in the given password variable. my code: please help me word = input() password = '' # Modify characters i, a, m, B, and o in passwordfor character in word: if character == 'i': # IF character equals 'i' change to '!' password += '!' elif character == 'a': # ELSE IF character equals 'a' change to '@' password += '@' elif character == 'm': # ELSE IF character equals 'm' change to 'M' password += 'M' elif character == 'B': # ELSE IF character equals 'B'…
- Assume nextWord is a String variable that has been given a String value that is entirely made up of letters. Create Java code that displays the message "First half of the alphabet," assuming that nextWord comes before "N" in alphabetical sequence. If nextWord does not precede "N" in alphabetic ordering, the code should output "Second half of the alphabet". (Note that "N" uses double quotes to produce a St Answer 117Mad 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 0 the output is: Eating 5 apples a day keeps you happy and healthy. Eating 2 shoes a day keeps you happy and healthy.3. Show the Huffman Code for each character in the following string. “boss demigoddess ship”