Write a program that takes a string of words, and prints out
these words one per...
Write a program that takes a string of words, and prints out
these words one per line
in a rectangular format (using # shape). The output must be
properly formatted. (Save your script as tabularFormat.py and
tabularFormat.txt)
If the input is: “Roses are red, sky is blue, I mind my own
business, why can’t you!”The output would be:
(With Comments )
Design an algorithm in pseudocode to determine whether any
5-letter word is a palindrome. Palindromes are...
Design an algorithm in pseudocode to determine whether any
5-letter word is a palindrome. Palindromes are words or sentences
that read the same backward or forward. For example, “kayak” is a
palindrome while “meter” is not. Ask the user to input 5
characters. You will need five separate variables to store these
five characters. After obtaining the characters, compare the
characters to determine if the word is a palindrome and output an
appropriate message.
Using PHP:
Write a function that:
Given a numerical parameter in input, computes and prints all...
Using PHP:
Write a function that:
Given a numerical parameter in input, computes and prints all
the prime numbers up to that value.
Example:
If input parameter is 10, output is "2, 3, 5, 7"
If input parameter is 100, output is "2, 3, 5, 7, 11, 13, 17,
19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89,
97"
Write a "tester function" that:
Given a specific subset of inputs, tests the...
Project File Processing.
Write a program that will read in from input file one line at...
Project File Processing.
Write a program that will read in from input file one line at a
time until end of file and output the number of words in the line
and the number of occurrences of each letter. Define a word to be
any string of letters that is delimited at each end by either
whitespace, a period, a comma or the beginning or end of the line.
You can assume that the input consists entirely of letters,
whitespaces,...
Write a recursive algorithm in a pseudo code,
Min-Max, for finding both the minimum and the...
Write a recursive algorithm in a pseudo code,
Min-Max, for finding both the minimum and the maximum elements in
an array A of n elements. Your algorithm calls itself only
once within the algorithm and should return a pair (a, b)
where a is the minimum element and b is the maximum element.
Algorithm Min-Max(A, n)
Input: an Array A of n elements
Output: a pair of (a, b) where a is the minimum
element and b is the maximum...
Finally, write a script named word_counts.sh
that prints out how many words are on each line...
Finally, write a script named word_counts.sh
that prints out how many words are on each line of standard input,
as well as the total number of words at the end. The script should
take no arguments. Instead, the script must work by reading every
line of standard input (using a while loop) and
counting the number of words on each line separately. The script is
intended to work with standard input coming from a pipe, which will
most often come...
Write a program (O(n), where n is the number of words) that
takes as input a...
Write a program (O(n), where n is the number of words) that
takes as input a set of words and returns groups of anagrams for
those words. Complete your code here -
For example, if the list is "debitcard", "elvis", "silent",
"badcredit", "lives", "freedom", "listen", "levis",
the output should be
silent listen
debitcard badcredit
elvis lives levis
Note that freedom has no anagram, and hence is not printed.
///////////////////////////////////////////////$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
anagram.cpp
#include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace...