palindrome is a word that is spelled the sam amples include "racecar" and "11:11".
Q: Science
A: The code is given as,
Q: Consider two arrays of Different sizes are given and your task is to multiply corresponding elements…
A: As no programming language is mention. So I will be using Java to answer this.
Q: A-1D-9 Given the code segment below, what will be the sum of ALL elements of dCData after running…
A: Please upvote. I am providing you the correct answer below. Please please please.
Q: A 2D matrix can be represented as a list and a column count value in Python. For example, the 3x3…
A: Tuple in python is to store multiple values within a single variable. The tuple are unchangeable,…
Q: 4-) Write a recursion function which counts the number of nodes with at least one child in a BST.…
A: Write a recursive function. To find the roots with at least one node. The tree should be binary…
Q: Write a program to check whether a given word is a palindrome by using pointers
A: i have provided code in step2.
Q: Write a program to find a 7x7 matrix and entries filled by random number between -50 to 50. In…
A: Requirements :- Approach :- %%(b-a)*rand(row,column)+a where a is lower limit and b is upper limit…
Q: Q2 : Write Matlab program to sort the following numbers into two groups: the first group contains…
A: Introduction : 1)declare and initialize x with the following values: k=0, j=0, sum1=0, sum2=0. 2)Use…
Q: For the square matrix of letters M, type a text that asks the user to enter a keyboard letter, then…
A: we write a matlab code to perform following task.…
Q: You can use the appropriate combination of loops and nested loops to solve the problem. You are not…
A: The Answer is
Q: Example2: Write a program to create a two dimensional matrix. Then print only the odd numbers in the…
A: Algorithm - Initialize the row(n) and col(m) values. now loop over the n and m and store the…
Q: I am working on a project to create a program containing a main() that uses a recursive function to…
A: Python Code to implement Koch curve from turtle import * def snowflake(lengthSide, levels): if…
Q: Need help with this python question with to parts. The first part doesn't correspond with the second…
A: Python program to solve the given problem is below. ***Note: According to Bartleby policy we…
Q: In Chapter 4, we developed an algorithm for converting A main function that tests the conversion…
A: Answer is given below .
Q: Choose any number as n, output all n-digit binary numbers which have equal total in right and left…
A: 6 digit binary numbers
Q: Q-4: a) In how many different ways can the letters of the word "CORPORATION" be arranged so that the…
A: Given the four parts of a question answers in the following:
Q: Q4\A) Write a MATLAB program that prompt the user to enter a matrix (A), then genera and display the…
A: Answer:
Q: Q2 : Write Matlab program to sort the following numbers into two groups: the first group contains…
A: 1)declare and initialize x with given values ,k=0,j=0,sum1=0,sum2=0 2)use for loop to iterate…
Q: 2, Towers of Hanoi Problem. (10 points) The Towers of Hanoi is a famous problem for studying…
A: Please find the Solution below in second step:-
Q: (a) Write a computer program to find the LU decomposition for the matrix A: [1 2 2] 1 su11 И12 U13…
A: Solution: Let, A be a square matrix. An LU factorization refers to the factorization of A, with…
Q: write a program to check that array is empty or not and write its algorithm in c++?
A: Given To do a c++ program to check that array is empty or not.
Q: IMPORTANT: Read the question carefully. This is as much an exercise in paying attention to specs as…
A: Please find the answer below :
Q: What is the time complexity of following code. Show the time complexity of each statement below and…
A: Language is one of the most widely used programming language which has been used to create different…
Q: we have a data set , how to split the sample into a trai
A: Given Computer Science we have a data set , how to split the sample into a training set and a…
Q: Can you help me with this program In C++ Check that in the series of integers a [1], a [2], ... a…
A: Required: Can you help me with this program In C++ Check that in the series of integers a [1], a…
Q: In c++ Check whether in the series of integers a [1], a [2], ... a [n-1] there are two subsequent…
A: Algorithm: Start Read array size Read array elements Initialize flag to false Iterate through the…
Q: Q// writing a program in C ++ language to read the values of the elements of a square matrix (4 x 4)…
A: 1) Declare the 4X4 array 2)Read the elements into the matrix 3)Display the array and simultaneously…
Q: Rewrite Exercise 3.4 using the following func tion to return the area of a pentagon: def area(s):
A: Given: Rewrite Exercise 3.4 using the following func tion to return the area of a pentagon: def…
Q: I would like to write a program in C++ to perform my algorithm but am having some trouble. Get the…
A: The program is written in C++ Consider the three inputs given to the program, 'A','n','u'. 1:…
Q: Write a Matlab code to perform the following: a) Ask the user to enter a number, and place it in the…
A: Note: Comments mentioned in code for understandability Code: Y=zeros(5,5); %Check matrix is full or…
Q: The goal is to rewrite the function, below, such that passes in a different list of parameters,…
A: Given below is the code for the question. PLEASE MAKE SURE INDENTATION IS EXACTLY AS SHOWN IN…
Q: Please do completely.all 3 parts
A: A parity-check grid of a straight square code C is a network which depicts the direct relations that…
Q: 3). For the following block-move program, is it repeat-until or while-do loop structure? Can you…
A: changing to while loop structure
Q: Q1 Write a C++ program to ask the user to record students’ ratings between (0 – 10) for 20 students…
A: function main(): Start Declare int responses[20], frequency[11], i, j Read 20 rating from user and…
Q: Write a programin basic language to arrange the numbers of matrix A[ 12 8 36 22 21 3 5 14 30 17]…
A: First, we will input the elements from the user. Then using nested for loop we will sort the matrix.…
Q: pls answer all how many asterisks does the following code fragment print?
A: As per our policy, "Since you have asked multiple questions, we will solve the first question for…
Q: Describe the following sets by regular expressions, (c) {01, 10} (d) {а, ab].
A: The Answer is
Q: Write a C++ program that reads a square matrix with sixteen elements, then perform the following…
A: PROGRAM EXPLANATION: - A 2d[][] to represent square matrix is defined to store 16 elements which…
Q: State whether the following are valid identifiers (function or variable name) and if so, whether…
A: Power – it is a valid identifier. So, it can be used to store power value or can be name of a…
Q: i. Design an algorithm that takes two arrays, and returns true if the arrays are disjoint, i.e. have…
A: design an array that takes two arrays and Create a hash table. Traverse the first array and store…
Q: Play with multi dimensional matrix Write a program in pascal to print the row number*column number…
A: Required:- Play with multi-dimensional matrix Write a program in pascal to print the row…
Q: 2/ Write C++ program, to find the greatest number in the second diagonal, in 4*4 array.
A: c++ program,to the greatest number in the second diagonal,4*4 array
Q: Explain in your own words what the code does step by step here:
A: Given: Explain in your own words what the code does step by step here:
Q: Open the simulator and fill the 4-line header properly Write a code that sorts a 32-element array…
A: Answer: I have done code and also I have attached code as well as code screenshot.
Q: Ql:- Answer by True or False (five only) 1-The colon ": " is one of the most important MATLAB…
A: In matlab, we have various operators and various functions and each of them will have its own uses…
Q: Write a Python program to check whether a nxn matrix is a magic square.The magic square is a set of…
A: Out of 27 statements given in the options two were unused in the program. These were magic = False…
Q: You are going to write a MIPS program that does the following (there is C++ sample code below to…
A: Actually, program is an executable software that runs on a computer.
Q: Q4/ Write C++ to represent the following series: 1,2,4,8,16,32,64 by using do -while.
A: As given, I need to write a C++ program to represent the given series: 1,2,4,8,16,32,64 using…
Q: 1. Write a recursive definition for the set of bit string that have m ones followed by n zeros for…
A: It is defined as a recursive procedure or routine is one that has the ability to call itself. This…
Step by step
Solved in 4 steps with 1 images
- The String class implements Comparable, which means that two strings can be compared to each other. However, the default implementation orders strings based on the ASCII values of their characters, which means that strings that begin with an uppercase letter are always ordered before strings that begin with a lowercase letter. This means that the string “Zoo” would be ordered before the string “aardvark”. Write a Comparator that compares two strings alphabetically so that “aardvark” is ordered before “Zoo”. Hint: convert both strings to upper or lowercase before comparing them.Two words are anagrams if they contain all of the same letters, but in a different order. For example, “evil” and “live” are anagrams because each containsone ‘e’, one ‘i’, one ‘l’, and one ‘v’. Create a program in python that reads two strings from the user, determines whether or not they are anagrams.Help me solve this problem /*** Using the Counter-controlled while Loop.** @author* @version*/public class PS06B{/*** Write the method xyzMiddle().** Given a String str, does "xyz" appear in the* "middle" of the string. To define middle, we'll* say that the number characters to the left and* right of the "xyz" must differ by, at most, one.** Examples:* xyzMiddle("AAxyzBB") returns true* xyzMiddle("AxyzBB") returns true* xyzMiddle("AxyzBBB") returns false** @param str the String to examine.* @return true if xyz is in the "middle" of str.*/// TODO - Write the method xyZMiddle here. /*** Write the method named repeatSeparator().** Given two String inputs, word and separator,* along with a third int input count, return a* big String consisting of count copies of word,* each separated by separator.** Note: This is a very common algorithm, called the* fencepost algorithm, because just like building a* fence, you need 11 fenceposts to hold up 10 sections* of fence.** Examples:*…
- given the strings s1 and s2, not necessarily of the same lenght, create a new string consisting of alternating characters of s1 and s2 (that is, the first character of s1 followed by the first character of s2, followed by the second characters of s1, followed by the second character of s2, and so on. Once the end of either string is reached, the reminder of the longer string is added to the end of the new string. For example, if s1 contained "abc" and s2 contained"uvqxyz", then the new string should contain "aubvcwxyz". Assign the new string to the variable s3. using python and loopsLanguage: Java Write a program that reads a sentence from the keyboard. Depending on the last character of the sentence, print the message identifying the sentence as declarative (ends with a period), interrogative (ends with a question mark), exclamatory (end with an exclamation point), or other. Hint: you can use charAt() method from the String class to extract the last character of the input line. The character of a String str is at str.length()-1 position. For taking a sentence as input use the nextLine() method from the Scanner class. You have to use if/else if selection. Sample input and output: Sample 1 Input: How are you? Output: Interrogative Sample 2 Input: I am good. Output: Declarative Sample 3 Input: That is amazing! Output: Exclamatory Sample 4 Input: Although, Output: Other Answer:Write an application that reads a five-letter word from the user and produces every possible three-letter string that can be derived from the letters of that word. For example, the three-letter words produced from the word “bathe” include “ate,” “bat,” “bet,” “tab,” “hat,” “the” and “tea.”
- Read the input one line at a time and output the current line if and only if it is largerthan any other line read so far or strictly smaller than the previously outputted line. (Here,smaller is with respect to the usual order on Strings, as defined by String.compareTo()). you have to use arrylist and cant modify any code under public static void main(string[] args). example: input 138456792 output: 138492 import java.util.*; import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Stack; public class Part2 { /** * Your code goes here - see Part0 for an example * @param r the reader to read from * @param w the writer to write to * @throws IOException */ public static void doIt(BufferedReader r, PrintWriter w) throws IOException { /*ArrayList<String> arr = new ArrayList<>(); int count…Given a text string, create and return a new string of same length where all vowels have been reversed, and all other characters are kept as they were. For simplicity, in this problem only the characters aeiouAEIOU are considered vowels, and y is never a vowel. For example, given the text string "Uncle Sente lives in Russia", this method should create and return the string "Ancli Sunti levis en Resseu".Furthermore, to make this problem more interesting and the result look more palatable, this method must maintain the capitalization of vowels based on the vowel character that was originally in the position that each new vowel character is moved into. For example, "Ilkka Markus" should become "Ulkka Markis" instead of "ulkka MarkIs". Use the handy character classification methods in the Character utility class to determine whether some particular character is in upper or lower case, and convert some character to its upper or lower case version as needed. Here's the tester it must…Write a program that reads a character and a string (an entire line, which may include spaces or tabs), and outputs the number of times the character appears in the string. Hint: use getline(cin, mystring) to read the entire line including spaces. Use mystring.length() to know how many characters. But to avoid a glitch when getline gets an empty string following a cin, do the following sequence: cin >> mychar; /* get character. cin leaves the newline in the input buffer*/ cin.ignore(80,'\n'); /* remove newline from the buffer, which getline would see as empty line*/ cout << "Enter a string: "; //prompt for string getline(cin, mystring); Example program run (the user types only the word "Monday" and the letter "a"): Enter character to count: a Enter a string: Monday count = 1 Example program run: Enter character to count: a Enter a string: Today is Monday count = 2 Example program run: Enter character to count: b Enter a string: Today is Monday count = 0 #include…
- Write a program that takes a string and creates a new string made of first two characters and last two characters from the given stringwrite a program that allows the input of a string from the user and prints the longest word in that string and its length. If there are multiple words with the same maximum length you must print the first one only.Implement a mechanism for performing basic string compression using repeated character counts. The string aabccccaaa, for example, would become a2blc5a3. Your method should return the original string if the "compressed" string does not grow smaller than the original string. You can assume that the string only contains uppercase and lowercase letters (a-z).