2. Generate a random string of length 10 that contains only lowercase alphabets from 'a' to 'z'. Print the string in the output.
Q: Greece has capital Athens. Each of the strings 'Greece', and 'Athens' has 6 characters. Show the…
A: #include <iostream>using namespace std; int main(){ string name, capital;…
Q: Write a code that determines if a string is a palindrome (can be read forward and backward with the…
A: Solution: Note : You didn't mention coding language so i am using JAVA. 1. Implementation of…
Q: Write a program that takes a range from the user and display all the even numbers between the range…
A: Note - Since there is nothing mentioned about the programming language to be used, so this program…
Q: 1- Given an input consisting of one or more sets of strings, followed by a final line containing…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: 21. You are given a string s = "125647898". Write a Java program to find the index where the…
A: given question has asked java program as per question requirement.
Q: write a program that prompts the user to enter a string and displays the number of vowels and…
A: The java program is given below:
Q: Strings can be added together with a + (plus) sign A.) True B.) False
A: String can be added by two ways By + (String concatenation) operator By concat() method String…
Q: What happens if you try to multiply a string by a string, "a" * "b"?
A: In certain languages like python, multiplying a string with an int is allowed. However, multiplying…
Q: 3. In a given string, there will be two uppercase letters in between some lowercase letters. Print…
A: Since the programming language is not mentioned, so we'll do it in python The programming…
Q: Write a program that takes a string and creates a new string made of first two characters and last…
A: NOTE: As the programming language is not mentioned in the question. So, we have solved this question…
Q: 3. Capital of the Country by CodeChum Admin I'm a passionate tourist, touring to a lot of countries…
A: The C program to solve the above problem is given in the below steps. Pease UPVOTE if you like the…
Q: e in a new line? (
A: Below in program where i print string of three names and each name in a new line with separate…
Q: Write a program that reads a string and checks the longest substring starting with "a" and ending…
A: I am using java language to solve the above problem. see below step
Q: Take the following Python code that stores a string: str = **#ABC123*#*123*abc**#* I ***##*****I…
A: The given string is: Str = '**#ABC123*#*123*abc**#****##*****' Remove the * and # from the string…
Q: 3. Capital of the Country by CodeChum Admin I'm a passionate tourist, touring to a lot of countries…
A: #include <ctype.h> #include <stdio.h> int main() { char ch = 'A'; // checking…
Q: Using Javascript and HTML: An interesting application of computers is drawing graphs and bar charts…
A: <html><head><title>Drawing Graph and Bar Chart</title><script>var…
Q: Your task is to take 2 strings from the user and then check whether All occurrences of a character…
A: Required: Your task is to take 2 strings from the user and then check whether All occurrences of a…
Q: Given a string in which the same character occurs in many.consecutive character elements. Your task…
A: Python code for above : # get input string str = input() # to store final result result = 0 #…
Q: Language :Python write a program that asks the user to enter a series of single digit numbers with…
A: Program: #Function to compute sum of all the single digit numbers in the string def…
Q: 4. Word Separator:Write a program that accepts as input a sentence in which all of thewords are run…
A: Approach Input string. Take an empty new string. Set counter to 0. for each character of the input…
Q: 5. You are given a string that contains alphanumeric characters only. Your task is to sort the…
A: As no programming language is mention so I will be using Python.
Q: String personName is read from input. Output personName left aligned with a width of 6, followed by…
A: Reads the input name from the user.personName is the input string read from the user.Format the…
Q: ord Separator:Write a program that accepts as input a sentence in which all of thewords are run…
A: Approach Input string. Take an empty new string. Set counter to 0. for each character of the input…
Q: The loop below is intended to collect all characters that occur more than once in a given string.…
A: xRead the input string. Initialize an empty HashSet called collected to keep track of the characters…
Q: Three numbers a. Write a program that reads three numbers and prints “all the same” if they are all…
A: Note:- Since programming language is not mentioned we are providing solution in c++ . please repost…
Q: Write a program that asks the user to enter their first name and their last name, separated by a…
A: Question: Q1: Write a program that asks the user to enter their first name and their last…
Q: 6. A palindrome is a number or text phrase that reads the same backwards or forwards. For example,…
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the main function.…
![2. Generate a random string of length 10 that contains only lowercase alphabets from 'a' to 'z'. Print the
string in the output.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fcc224598-99a1-4b54-9ad8-a4653dc9c4cd%2F7e3390a6-7f0c-4b37-8aac-cd5bbf9877b5%2F2rll364_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
- Q1: Write a program that asks the user to enter their first name and their last name,separated by a space. Break the input string up into two strings, one containing thefirst name and one containing the last name. You can do that by using the indexOf()subroutine to find the position of the space, and then using substring() to extracteach of the two names. Also output the number of characters in each name andoutput the user’s initials. (The initials are the first letter of the first name togetherwith the first letter of the last name.) A sample run of the program should looksomething like this:Please enter your first name and last name, separated bya space.? Mary SmithYour first name is Mary, which has 4 charactersYour last name is Smith, which has 5 charactersYour initials are MSstring of three names print each name in a new line? (separate every word in new line)City and State. Extract the city name and state from strings like “Utica, NY” and “Los Angeles, CA”. Assume the state is always the last two characters in the string, the city name has at least one character, there is a comma following the city name, and a single space after the comma. Use the split method to separate the city name from the state (Notice the city name will still have a comma at the end). The following attachement is a sample execution:
- Write a program that reads a string and checks the longest substring starting with "a" and ending with "z" included in it. Note that, the substring cannot contain another a or another z in it. For example: Ifs="bcd bbccdd badefgze tabdz", the longest substring is: 6Section Test of Application... Note: You need to press "Final Submit" for your pr Given a string in which the same character occurs in many.consecutive character elements. Your task is to find the characters that have even frequency and are consecutive. Display the sum of every frequency count (For even frequency only). Example1: Input aaabbaccccdd Input String Output: Explanation: Input string "aabbaccccdd" contains 'a' 3 times, b' 2 times, again 'a' 1 time, 'c' 4 times, and 'd 2 times Here, the frequency of b.c and d is even and the frequency count is 2,4 and 2 respectively. Hence the output32-4-2%3D8 Example2: input: vdkkmmmnn Output Buns andur-5. You are given a string that contains alphanumeric characters only. Your task is to sort the string in the following manner: a. All sorted lowercase letters are ahead of uppercase letters. b. All sorted uppercase letters are ahead of digits. c. All sorted odd digits are ahead of sorted even digits. Sample Input Sample Output Bracu1234 acruB1324
- Using Javascript and HTML: An interesting application of computers is drawing graphs and bar charts (sometimes called histograms). Write a script that reads five numbers between 1 and 30. For each number read, output HTML5 text that displays a line containing the same number of adjacent asterisks. For example, if your program reads the number 5, it should out HTML5 test that displays *****.e) Create a new StringBuilder from the String "Prepare for your Midterm Exam". Check the capacity of the StringBuilder and if it's empty. Find the index of the letter 'y'. Delete a substring from the starting index till this index (of 'y'). Insert a string "Good luck on " at the beginning of the StringBuilder. Append '!" to it. Print your StringBuilder to Console.write a program that prompts the user toenter a string and displays the number of vowels and consonants in the string. Assume lettersA, E, I, O, U (or a, e, i, o, u) as the vowels.1. Prompt the user for a String. (Note: The user input String may contain spaces)2. Print the number of vowels and consonants in the String. The count displayed mustaccount for all the vowels and consonants in the String regardless of case (upper orlower case). You must use a loop in your solution.Hint: charAt(index) and length() method for the String, toUpperCase(ch) (ortoLowerCase(ch)), isLetter(ch) method for the Character is helpful for thisassignment3. The output from the program must be enclosed in quotes as shown below in the samplerun of the program.
- Greece has capital Athens. Each of the strings 'Greece', and 'Athens' has 6 characters. Show the name and capital where the name and the capital have the same number of characters. You can use the LENGTH function to find the number of characters in a stringCreate a string from two given strings by concatenating common characters of the given strings. Sample Input harry, hermione dean, tom Sample Output hrrhr Nothing in common. Again, you have lost your USIS password!! You went to the registrar office and requested for a new password. This time, you need to follow some rules to set your password. Otherwise, they won't change it. The rules are At least one lowercase letter At least one uppercase letter At least one digit (0-9) At least one special character (_ , $ , #, @) Your task is to find whether a given password follows all those rules. If it breaks any rule, you have to print Lowercase Missing, Uppercase Missing, Digit Missing or Special Missing respective to the missing case. For more than one rule break, print all the rules that were broken (order doesn't matter). If the password is ok, print OK. Sample Input ohMyBR@CU ohmybracu OhMyBR@CU20 Sample Output Digit missing Uppercase character missing,…Q3: Write a complete program to read a string from the user at the runtime and check if it is palindrome (syetrical).
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)