Q1. Write the algorithm to evaluate a Postfix expression? Q2. Show the evaluation of the given Postfix Expression: 8 2 5 – 7 * # + - [Hint: use single quotes (e.g. '= to help you type using symbols] Q3. Write a simple code in your choice language to perform the evaluation of postfix expression
Q: thislist = ["apple", "banana", "melon", "cherry", "orange", "kiwi", "mango"] # Using the given list…
A: The list can be accessed index wise. For displaying the first 3 elements from the given list range…
Q: n C++ Write a program with a function that implements the Addition Algorithm with base 10 addition…
A: Algorithm: Start of the program Declare variable Read the value from user Call function with first…
Q: 2. Consider the following 3 strings over the alphabet {a,b} : S 3 ааааа, T = abbb, R= bbbbb. Which…
A: Let's solve the question step by step: Given words S = aaaaa T = abbb R = bbbbb Option (a) There…
Q: Evaluate the following postfix expressions by hand (a) 5 5 * 2 2 * 4 / + (b) 10 10 * 1 - 9 / (c) 3 3…
A: a) 5 5 * 2 2 * 4 / + First calculate 5*5 = 25 Then 2*2= 4 Now 4/4= 1
Q: How do I set a boolean hasDigit to true if string userInput contains a digit? bool hasDigit; string…
A: Please find the answer below :
Q: java Use a loop to count how many times the characters java and python are found in the given String…
A: The above question is answered in step 2 :-
Q: Q2/ Write a program in the Fortran language to read 10 numbers and find the sum of the numbers that…
A: Program :- IN Fortran Language program sum INTEGER, DIMENSION(1:10) :: x INTEGER…
Q: Rewrite the following program after removing the syntactical error(s), if any.Underline each…
A: 1) int should be used instead of void. 2) return should be mentioned. 3) iostream.h should be…
Q: Exercise 7. Let E= {a,b,c}. Write a regular expression which can generate the language that has odd…
A: Answer the above questions are as follows:
Q: 1) Write a string and then print out that string without i-th element in it. Example: Input:…
A: 1)Take a input string and take a integer i value. Print the string after removing the i-th character…
Q: 10. Consider the following procedures for string manipulation. Procedure Call Explanation concat…
A: The string manipulation concat() method returns a single string str1 as str1=str1+str2 ie. str1 is…
Q: a) Give an example of a string containing 11 that is accepted by the following automaton. b) Give an…
A: We are given a DFA and we are going to solve the questions based on it. I have answered all the 4…
Q: Write the regular expression that can match only complete words which have repeating letters. Assume…
A: Regular expression answer: \b(?=\w*(\w)\1)\w+\b
Q: QUESTION 1 Examine the following DFA: B 1 A D 0. Identify in the list below the string that this…
A: Given a DFA, to identify which of the given string is accepted.
Q: Q2\ Write C++ program to sorting the following set of numbers from left to right in descending (4,…
A: If we can write the sorting algorithm we can use the vector in c++
Q: Q2/ Write a program in the Fortran language to read 10 numbers and find the sum of the numbers that…
A: Algorithm: 1. Start 2. Read 10 numbers in an array. 3. Declare s 4. Using for loop traverse…
Q: Write a program in js to check how many times vowels are present in a given string.
A: To Do: To write js code.
Q: 4.16 LAB: Parsing dates java please: Complete main() to read dates from input, one date per line.…
A: import java.util.*;public class Main { public static int getMonthAsInt(String monthString) {…
Q: Q3: Write a program in C++ to read a string (s) from keyboard , then do the following : 1- Check if…
A: Code for : #include <iostream> using namespace std; // Function to check if the first // and…
Q: Q4. Write a program to check whether two strings are anagrams or not. Two words are said to be…
A: The above question is solved in step 2 :-
Q: Write regular expressions for the following patterns. Use auxiliary definitions wherever convenient.…
A: The Answer is
Q: Write a program that prompts the user to input a string (a string can be a word, a phrase and/or a…
A: 1. declare an array space to sore the string i am using 20 characters. 2. take input from user I am…
Q: 4. Write an algorithm that reads two values, determines the largest value and prints the largest…
A: Algorithm is a step-by-step procedure to solve a particular problem. The algorithm gives the logic…
Q: 4. Evaluate the following postfix expression. 355* + 5 7 + 6 / - The value of the above postfix…
A: The value of the postfix expression is a) 26 Steps are explained below
Q: Write a recursive function that reads words from the standard input stream and displays them in…
A: Program code: //include the required packages #include <iostream> #include <string>…
Q: Write a Java program to search a letter from the given word (list of characters) using linearsearch…
A: The code is written below: import java.util.Scanner; // importing package class Main // main…
Q: 23. Consider the two regular expressions, L1 = a* + b* L2 = ab* + ba* + b*a + (a*b)* a) Find a…
A: The * takes value from 0 to infinity a) In L1, we can generate aa by put * = 2 in a* The same…
Q: Q 6. Accept a string from the user that consists of multiple sentences. Write a pro removes vowels…
A: here in this question we have asked to write a program in c which takes any sentence as input and…
Q: | Write the C# or Python code to read in a comma separated string of names from the user console…
A: s = input("Enter names: ")names = s.split(",") Sum = 0for name in names: if "t" not in…
Q: event that |a|>0 (the length of the string an is more prominent than nothing), erase the principal…
A: Here have to determine about the program for the string an is more prominent problem statement.
Q: 3. Write down a program that will take a string as input and will check whether this is a palindrome…
A: a. Using Library functions The programming methodology is given by: including header files main…
Q: A truth table shows, for the various true or false values of boolean variables, what the result of a…
A: I have solved all the 8 parts of the truth table and have provided explanation along with it. We…
Q: (3) Convert the DFA below into a regular expression that generates the same langu using the…
A: We need to remove all the cycles in the given DFA. Here since initial state is also the final…
Q: In certain programming languages, comments appear between delimiters such as (# and #). • A comment…
A: Regular expression: #(a+b+(+))*#
Q: Rewrite the following program after removing all the syntactical error(s), if any. Underline each…
A: One=10,Two=20; The variables are not declared Callme(One;Two); Here pass 2 values to the function…
Q: Given the following program fill in the blanks resulting from the cout statements: int c1 = 3; int…
A: I have given C code to find the value of c1,c2,c3 and *p1,*p2,*p3.
Q: section grouping is a string containing just characters "(" and ")". A standard section succession…
A: Here have to determine about the section grouping programming problem statement.
Q: Do Programming Exercise 4 from Chapter 5 using a function acronym(phrase)that returns an acronym for…
A: Let's see the solution.
Q: Consider the following expression using Racket: (= (string-length "hello world") (/ (+ 10 10) 5) )…
A: It is a : Programming language : a dialect of Lisp and a descendant of Scheme Family of language:…
Q: Exercise 7. Let E={a,b,c}. Write a regular expression which can generate the language that has odd…
A: Introduction
Q: Write a C++ program that read in students Test Grades, print the corresponding Letter Grades and…
A: #include <iostream> using namespace std; int main() { int grade; cout<<"enter the…
Q: Which of the following statements is/are correct? I. The language L accepts all the strings of a's…
A: The given expression in first statement is: (a+b)2b(a+b)*= (a+b)(a+b)b(a+b)(a+b)...... Hence we can…
Q: Code C Can this be done as a flowchart please? Detailed and clear This week’s exercise is to…
A: // C Program #include <stdio.h> void encoder(char *str, int key){ char encoded[26];…
Q: Output the information as a formatted histogram. Each name is right justified with a setw() value of…
A: Program:#include <iostream>#include <string>#include <iomanip> using namespace…
Q: Write a program that prompts the user to input a string (a string can be a word, a phrase and/or a…
A: Below is the code
Q: Question 1: Given the following strings: x = well, y = in and z = formed Evaluate the following…
A: The question is to write the result after the given string evaluation.
Q: Convert any given statement or word to the Pig-latin equivalent. The rule for Pig- latin can be…
A: Code: function pigLatin(str) { // Convert string to lowercase str = str.toLowerCase() //…
Q: 2. Write a java program which accepts a string from user and Apply translation operation and show it…
A: Given:
Q: Design FA to accept strings with a^ prime s and b's such that the number of a's are divisible by…
A: The Answer is
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
- Implement in C Programming 9.5.1: LAB: Parsing dates Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the substring() function to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3-1-1990. Ex: If the input is: March 1, 1990 April 2 1995 7/15/20 December 13, 2003 -1 then the output is: 3-1-1990 12-13-2003 Use the provided GetMonthAsInt() function to convert a month string to an integer. If the month string is valid, an integer in the range 1 to 12 inclusive is returned, otherwise 0 is returned. Ex: GetMonthAsInt("February") returns 2 and GetMonthAsInt("7/15/20") returns 0. #include <stdio.h> #include <string.h> int GetMonthAsInt(char *monthString) { int monthInt; if (strcmp(monthString, "January") == 0) { monthInt = 1; } else if (strcmp(monthString, "February") == 0) {…(C Language) The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sum of the previous two, for example: 0, 1, 1, 2, 3, 5, 8, 13. Complete the Fibonacci() function, which takes in an index, n, and returns the nth value in the sequence. Any negative index values should return -1.Please use easy logic with proper indentations and comments for understanding!. Coding should be in C++. 2. Write a recursive function that reads words from the standard input stream and displays them in reverse order on the standard output stream. For example, if the input was: here comes the sun, the output would be: sun the comes here. Hint: Read individual words until the end of a sentence is reached. You can determine the end of the sentence any way you like. Some suggestions include (a) checking the last character of a word for a sentence terminator (. ? ! ) (b) Using a keyword such as 'quit' to indicate the end of input. (c) Using the eof method of the cin object. (ctrl Z for windows or ctrl D for others can be used to force an end of file from the keyboard.)
- Using comments in c explaining how each code works line by line. The whole program is given below. Don't delete anything. For example // #include calls upon the c library #include #define N 16 typedef int fix_matrix[N][N]; /* Set all diagonal elements to a[i] + val */ void fix_set_diag(fix_matrix A, int val) { for( int i=0;iHelp me please... Create a C program that would accept 10 strings from the user (each string has a maximum of 10 characters, letters only, no spaces). Your goal now is to sort them in lexicographical order (dictionary order) regardless of the case. You need to implement the functions toLowerCase and toUpperCase. You are free to use any sorting algorithm discussed. Example: Give me word number 1: banana Give me word number 2: apple Give me word number 3: asdfer Give me word number 4: zerosx Give me word number 5: banerZ Give me word number 6: ApPle Give me word number 7: ChoP Give me word number 8: chop Give me word number 9: ZerosX Give me word number 10: zErosxRacket code only please Using the logical operators, and, or, implies, not, and iff, and atoms representing truth values, we can make a list that would represent proposition: For instance: '(A and (not A)), or '((B iff (A or C)) implies (not (C implies A))) would represent the formal statements (A∧¬A) and ((B ≡(A∨C)→¬(C → A))). We use the following convention when we represent propositions in this way: for every operator – unary or binary – there corresponds at least one pair of parentheses defining its scope (and perhaps more). Thus, the lists ‘(A and not A) and (B iff A or C) are not permitted but ‘((A and ((not A))) and ‘(B iff (((A or C)))) are acceptable. 1. Define collect-prop-variables, which will take as input a list representing a proposition, and return a list, representing a set, of all the variables used in the expression. Example: (collect-prop-variables '(A and (not A))) should return '(A) and (collect-prop-variables '((B iff (A or C)) implies (not (C implies A))) )…
- ** **** Exercise: 3 stars, standard (swap_exercise) Write an Imp program [c] that swaps the values of [X] and [Y] and show that it satisfies the following specification: {{X <= Y}} c {{Y <= X}} Your proof should not need to use [unfold valid_hoare_triple]. Hints: - Remember that Imp commands need to be enclosed in <{...}> brackets. - Remember that the assignment rule works best when it's applied "back to front," from the postcondition to the precondition. So your proof will want to start at the end and work back to the beginning of your program. - Remember that [eapply] is your friend.) *) Definition swap_program : com (* REPLACE THIS LINE WITH ":= _your_definition_ ." *). Admitted. Theorem swap_exercise : {{X <= Y}} swap_program {{Y <= X}}.Proof. (* FILL IN HERE *) Admitted.(** [] *)From the book software Foundations Volume 2 coq proofWrite a C++ program: A palindrome is a word that reads the same forwards and backwards for example "A Toyota" or "radar". Write a C++ program (we suggest pointers), that will ignore spaces but read in strings of characters and determines if they are palindromes. test: A Toyota(C Language) Write a recursive function called PrintNumPattern() to output the following number pattern. Given a positive integer as input (Ex: 12), subtract another positive integer (Ex: 3) continually until a negative value is reached, and then continually add the second integer until the first integer is again reached. For this lab, do not end output with a newline.
- fill in the comments for this peice of code c++ typedef struct LangData { string ch; // stores a single char int i; // index of char from the original string int start; // start index of substr int endInd; // end index of substr LangData(const string &ch, int i, int s, int e) : ch(ch), i(i), start(s), endInd(e) {} } LangData; // This function generates all strings of length at most k the language generated by the characters in the input string // Input: string in_str, int k // Output: list of all strings of length at most k, consisting of characters in input_str // List language(string input_str, int k) { List langList; langList.insert(""); for (int i = 1; i <= k; i++) { stack<LangData> recurData; // Generate a blank strig of the required length string blankStr = ""; for (int j = 0; j < i; j++) blankStr += " "; // Push onto the stack recurData.push(LangData(blankStr, 0, 0,…#Solve it with C programing Suppose, you are working as a Data Entry Operator in a company. You have created a dataset that contains the names of N employees. Then your supervisor wants you to look for a particular employee by name. (Consider, every name in the data set is unique).Now your task is to write a program which will help you to find out the name which your supervisor is looking for.If found then print a message "Matched" otherwise print "Not Matched". (N.B: Without quotation) The first line of input will take an integer (N) which indicates the number of names in the dataset. Then the second line will take N space-separated strings. The third line of input will take another string as search value. Sample input:5rabbe sharif shazzad polash tutulsharif Sample output:Matched Sample input:4jahid nishat rasel shakibmunna Sample output:Not MatchedPlease read all parts and answer in C++. Do not provide an answer that was already used by other chegg experts. 1. The approach should be completely Object Oriented. I don't want to see STL map, parallel arrays, a long if/else if/else or switch statement.2. Prompt the user to enter a sentence. This means you must support whitespace in the string input. The sentence can have a maximum of 50 characters.3. Output the sentence character by character by translating the character into its Morse Code equivalent. You can print each on an individual line or on one line separated by a space.4. Use the Morse Code table as shown on Wikipedia. Represent with periods and hyphens. For example the character 'B' would be output as string "-..." 5. Morse Code is case insensitive meaning Morse Code treats 'a' and 'A' as the same character. You will need to handle this in your code.6. You can ignore any character in the sentence that is not a letter or number.7. Will not only be grading program…