Please circle final answer 20 points) Com , contains at least three strings such that the...
(9 pts 3 pts each) For each of the following languages, name the least powerful type of machine that will accept it, and prove your answer. (Hint: a finite state automata is less powerful than a pushdown automata, which in turn is less powerful than a Turing Machine.) For example, to prove a language needs a PDA to accept it, you would use the Pumping Lemma to show it is not regular, and then build the PDA or CFG that...
1. Construct a DFSM to accept the language: L w E ab): w contains at least 3 as and no more than 3 bs) 2. Let E (acgt and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg. ge. Construct both a DFSM to accept the language and a regular expression that represents the language. 3. Let ab. For a string w E , let w denote the string w with the...
C++ help Format any numerical decimal values with 2 digits after the decimal point. Problem description Write the following functions as prototyped below. Do not alter the function signatures. /// Returns a copy of the string with its first character capitalized and the rest lowercased. /// @example capitalize("hELLO wORLD") returns "Hello world" std::string capitalize(const std::string& str); /// Returns a copy of the string centered in a string of length 'width'. /// Padding is done using the specified 'fillchar' (default is...
Please read the problem carefully and answer the 2 questions
below
code:
/*****************************************************************
* Program: palindrome.c
*
* Purpose: implements a recursive function for determining
* if a string is a palindrome
*
* Authors: Steven R. Vegdahl, Tammy VanDeGrift, Martin Cenek
*
*****************************************************************/
#include
#include
#include
/*****************************************************************
* is_palindrome - determines whether a string of characters is a
palindrome
*
* calling sequence:
* result = is_palindrome(str, first_index,
last_index)
*
* parameters -
* str - the string to test
* first_index -...
Programming project in Java: You are allowed to use the following methods from the Java API: class String length charAt class StringBuilder length charAt append toString class Character any method Create a class called HW2 that contains the following methods: 1. isAlphabeticalOrder takes a String as input and returns a boolean: The method returns true if all the letters of the input string are in alphabetical order, regardless of case. The method returns false otherwise. Do not use arrays to...
Q1. Write a recursive function in C++ void printNumberedChars(string str, int i=0) { ... } which prints each character of the given string str on a new line, with each line numbered 1, 2, 3, …. For example calling the function with printNumberedChars("hello"); should output the following: 1. h 2. e 3. l 4. l 5. o Q2. Write a recursive function in C++ int sumArray(const int* arr, unsigned int size) { ... } which takes an array of integers,...
could you please help me with this problem, also I
need a little text so I can understand how you solved the
problem?
import java.io.File; import java.util.Scanner; /** *
This program lists the files in a directory specified by * the
user. The user is asked to type in a directory name. * If the name
entered by the user is not a directory, a * message is printed and
the program ends. */ public class DirectoryList { public static...
please help with the operator overloading lab
(intArray) in c++ will provide what it is being required and the
code that was given from the book.
the code that was provided is below
-------------------------------------------------------------------------------------------------------------------------
// iadrv.h
#ifndef _IADRV_H
#define _IADRV_H
#include "intarray.h"
int main();
void test1();
void test2();
void test3();
void test4();
void test5();
void test6();
void test7();
void test8();
void test9();
void test10();
void test11();
void test12();
void test13();
void test14();
void test15();
void test16();
void test17();
void test18();...
Hey guys I need help with this assignment. However it contains 7
sub-problems to solve but I figured only 4 of them can be solved in
one post so I posted the other on another question so please check
them out as well :)
Here is the questions in this assignment:
Note: Two helper functions Some of the testing codes for the functions in this assignment makes use of the print_dict in_key_order (a dict) function which prints dictionary keyvalue pairs...
Part 3: Transposition Ciphers #can't use ord or chr functions You must implement three transposition ciphers (the "backwards" cipher, the Rail Fence cipher, and the Column Transposition cipher) where the ciphertext is created via an altered presentation of the plaintext. The algorithm for each is detailed in the function descriptions in this section. (13 points) def backwards_cipher(plaintext, key): • Parameter(s): plaintext ----- a string; the message to be encrypted key ----- an integer; the number to control this cipher •...