27. Implement the following RECURSIVE function named starString: // Returns a string containing 2^n stars (*) string starstring (int n); Examples: starstring (1) would return the string "**" starstring (2) would return the string starstring (3) would return the string starString(4) would return the string ***** ****
Q: Make a C program to input n numbers and will output (a) the sum of all positive odd integers, (b) th...
A: Here is the approach:- First take input from the user for the number of integers and then create th...
Q: 4. Create an array of 20 fives In [4]: # Code Here 5. Create an array of the integers from 10 to 70 ...
A: To write code to create an array of 20 fives an array of the integers from 10 to 70 an array of all...
Q: A user, mistakenly deleted files on the DNS zones and contents how you will recover.
A: The below are the steps to recover a deleted zone and all of its records. In this example the delete...
Q: Why is it important to establish a relation between a UI prototype (or even UI sketches) and use-cas...
A: use case is a formal or simple way to represent how an information system interact with the environm...
Q: 1 import java.util.Scanner; 2 3 public class DeclaringVariables { public static void main(String[] a...
A: import java.util.Scanner; public class DeclaringVariables { public static void main (String[] args) ...
Q: Write a C Program that ask the user to choose from 2 categories, then ask the user to enter two numb...
A: ANSWER:-
Q: C Language Explain what is the difference between a doubly linked list and singly linked list? Give...
A: The solution to the given problem is below.
Q: Question 6 [New] according to the next procedure: Read a word Write an assembly code to update a lis...
A: Some instructions in this program The mov instruction copies the data item referred to by its second...
Q: Using Java language to Design a game to find the difference between images in Android Studio
A: import java.awt.Color;import java.awt.image.BufferedImage;import javax.imageio.ImageIO;import java.i...
Q: Discuss what may have happened and whether the applicant is a good credit risk.
A: An artificial neural network (ANN) is a network of highly interconnected processing elements (neuron...
Q: Write an assembly program to set R0=1 if there's a 5 in one of ten memory locations, starting at x31...
A:
Q: Suppose that you are hired by a police department to write a program that matches arrest records wit...
A: the answer is an given below :
Q: 2. Assembly Language MOV BH,38H ADD BH, 3FH Solve for the following operations. CF=?, AF=...
A: In this question we have to determine how the different flags gets affected by the above operation.
Q: Write a function myfunction that requests user input i the form of an integer value, 1, 2 or 3. The ...
A: For the given function, we will be using an if control statement inside an infinite while loop on us...
Q: What are the notions of functions in Swift again? What are some of Swift's functionalities that dist...
A: Intro A function is a block of statements that performs a particular task. It is given a name that d...
Q: Computers manipulate information and carry out binary instructions. What exactly is binary's purpose...
A: Binary is the most efficient way to control logic circuits.
Q: Use the following expression to create an expression tree: 6 - 5 * 4 + 3 / 2 + 1 - 0
A: Given: We Have to create a Expression Tree in the Following Expression: 6 - 5 * 4 + 3 / 2 + 1 - 0...
Q: How do you keep an office with shared resources like a printer secure?
A: Introduction: Shared resources are equipment that may be accessed by several remote computers that a...
Q: Computer Science Exercise 4. Prove the following properties of regular expressions a) ∗= Λ b) R∗|R2...
A: properties of regular expressionsa) ∗= Λ b) R∗|R2= R∗
Q: ^^111^11111^^^ = ^^^11^1^^^ What wo
A: Sum : user will add three numbers bu using sum operator'+' subtract : user will subtract by using '-...
Q: To answer this question, you may need to write a small program. Consider the following case: current...
A: Introduction To answer this question, you may need to write a small program. Consider the following ...
Q: I want all TCP traffic originating from my internal network to be allowed back through the firewall ...
A: ICMP
Q: what is emerging technology?
A: This question comes from Computer and Technology Evolution which is a paper of computer science. Let...
Q: Most retail establishments use barcode scanners to get product names and pricing in order to expedit...
A: Introduction: Although barcode technology has grown so common that many consumers take it for grante...
Q: Determine whether each of these functions is a bijection from R to R a. ?(?) = −3? + 4 b. ?(?) = −3?...
A:
Q: Write in C++ frogram will loop that from a while take in string aray input and user check that progr...
A: C++ Program: #include <iostream>using namespace std; void printString(string& str){ // f...
Q: Write a console application that uses at least five(5) different methods of Math class. Provide a me...
A: In C#, Math class It is used present mathematics operation which contains static methods and constan...
Q: What exactly is a WebAppcomponent?
A: Introduction: You may create reusable custom objects with their behaviour separated from the rest of...
Q: What does it mean to have a gaming laptop computer?
A: Introduction: A gaming laptop is a small and portable computer that has a monitor.
Q: Let B be a structuring element containing a single point, valued 1, and let A be a set of foreground...
A: (a) In the field of mathematical morphology, erosion is one of two basic operators, the other being ...
Q: What influence does the blockchain have on "Systems Analysis and Design
A: Introduction: System Analysis and Design is assessing a company issue to improve it via the use of m...
Q: Look for an example of a cost overrun in an information systems development project by browsing the ...
A: He supplied information on an example of an information systems development project with cost overru...
Q: Write a program that will sequentially list numbers from 0 to 50, changing its color depending on th...
A: Step 1 : Start Step 2 : Define a function delay() to print the numbers in an interval of 1 second. S...
Q: Explain the output of this program
A: In the given program, the Scanner class is initialized to read user input. Using Scanner's object, t...
Q: What are the main advantages of virtual memory? And Describe three advantages of virtual memory and ...
A: Virtual memory is a memory space in the operating system which is acts as a main memory to the secon...
Q: Convert the following NFA to an equivalent DFA
A:
Q: Controls and Methods What controls are possible as parameters for fade, hide, and toggle?
A: The above methods which are in the question are from jQuery(which is basically a javascript library)...
Q: prototype inction Rever a reverse produce the reverse of the input integer array using the positions...
A: We need to define the Reverse() function as per the given description.
Q: Write the sequence of nodes produced by the inorder traversal of tree in figure. Write the name of t...
A: The question is to find the ignorer traversal for the given ternary tree.
Q: 2.16 LAB: Convert to seconds Write a program that reads in hours, minutes and seconds as input, and ...
A: For completing this program, we will follow the subsequent steps: Initializing the Scanner class As...
Q: in java create a lexical parse tree that displays ( 0 + 1 ) * 10 from an text input file
A: Let's see the solution in the next steps
Q: 4. Find an example of sets A and B such that ACB and AeB.
A: Finding examples of sets with the given relation.
Q: Write the code to check if y is between 100 and 150 (including 150 only
A: The given code is in the C programming language Code Screenshot:
Q: Write a C program that mimics the "popd" and "pushd" command. Using strings; output should look lik...
A: Let's see the solution in the next steps
Q: System A has two processors, and Program X takes 10 seconds to run on one of them. Program Y execute...
A: Introduction the question is about System A having two processors, and Program X takes 10 seconds t...
Q: A = 1 1 1 1 1 1 1 1 1
A: Code: K=zeros(5,5);for i=1:5for j=1:5if(i==j || i+j==6)K(i,j)=1;endendenddisp("K = ")disp(K)
Q: Explain briefly the activities covered by software project management.
A: The following are the activities covered by software project management.
Q: Write a program that creates an array of 10 names. Display the names in reverse order. Reverse order...
A: As there is no programming language is mention in the question so I will solve this problem using ja...
Q: HW (3): Design a combinational circuit using PROM. The circuit accepts a 3-bit number and generates ...
A: Input - 3bit input ranging from 0 to 7 output , square of input PROM is a programmable logic device ...
Q: Kaggie data se ice date Use the above data set Describe the data set • Use descriptive statistic Dra...
A: Introduction
Please, answer and give an explanation of the answer.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images
- (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.1. Write a recursive function that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative integer is 4, then the pattern generated is:********************Also, write a program that prompts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern. For example, specifying 4 as the number of lines generates the above pattern. 2. A palindrome is a string that reads the same both forward and backward. For example, the string "madam" is a palindrome. Write a program that uses a recursive function to check whether a string is a palindrome. Your program must contain a value-returning recursive function that returns true if the string is a palindrome and false otherwise. Do not use any global variables; use the appropriate parameter.1. Write a recursive function that takes a string as an input and returns the reverse of the string. 2.Write a recursive function rec_string that produces the output shown below for the corresponding function calls. Write a main function to test the function. Method call rec_string(‘abcde’), will produce the following output: *ede cde bcde abcde Method call rec_string(‘abc’), will produce the following output: *cbc abc 3. Write a recursive function for Euclid's algorithm to find the greatest common divisor (gcd) of two positive integers. gcd is the largest integer that divides evenly into both of them. For example, the gcd(102, 68) = 34. You may recall learning about the greatest common divisor when you learned to reduce fractions. For example, we can simplify 68/102 to 2/3 by dividing both numerator and denominator by 34, their gcd. Finding the gcd of huge numbers is an important problem that arises in many commercial applications. We can efficiently compute the gcd using the…
- 4.10 LAB: All permutations of names Write a program that lists all ways people can line up for a photo (all permutations of a list of strings). The program will read a list of one word names, then use a recursive function to create and output all possible orderings of those names separated by a comma, one ordering per line. When the input is: Julia Lucas Mia then the output is (must match the below ordering): Julia, Lucas, Mia Julia, Mia, Lucas Lucas, Julia, Mia Lucas, Mia, Julia Mia, Julia, Lucas Mia, Lucas, Julia def print_all_permutations(permList, nameList): # TODO: Implement method to create and output all permutations of the list of names. if __name__ == "__main__": nameList = input().split(' ') permList = [] print_all_permutations(permList, nameList)2. Sum: a recursive function that computes the sum of integers 1, 2, 3, …., n for a given number n. So Sum(6) should return 1 + 2 + 3 + 4 + 5 + 6 , i.e. 21.sum(n) = n + sum(n-1)1. Implement a recursive function called firstTwo that returns the sum of the firsttwo digits in a positive number. If there is only one digit, that digit is returned.Note this function is returning an integer, not printing. There should be no use ofcout within your function.Title line: int firstTwo(int n)ex. firstTwo(8325) returns 11ex. cout << firstTwo(428); // prints 62. Implement a function called findMinGap that will return the smallest gap betweenadjacent entries of an integer array. A gap between two numbers is the absolutevalue of their difference. For example, if an array contains the elements {10, 14,-5, -3, 0, 5, 7}, the minimum gap is 2 (between -5 and -3).Title line: int findMinGap(int array[], int length)3. Implement a function called findLargestIndex which returns the index of the rowwith the largest sum.ex. int array[3][6] = {{3, 6, 8, 2, 4, 1}, // sum = 24{2, 4, 5, 1, 3, 4}, // sum = 19{1, 0, 9, 0, 1, 0}}; // sum = 11If the findLargestIndex function was called…
- 1. Implement a recursive function called firstTwo that returns the sum of the firsttwo digits in a positive number. If there is only one digit, that digit is returned.Note this function is returning an integer, not printing. There should be no use ofcout within your function.Title line: int firstTwo(int n)ex. firstTwo(8325) returns 11ex. cout << firstTwo(428); // prints 62. Implement a function called findMinGap that will return the smallest gap betweenadjacent entries of an integer array. A gap between two numbers is the absolutevalue of their difference. For example, if an array contains the elements {10, 14,-5, -3, 0, 5, 7}, the minimum gap is 2 (between -5 and -3).Title line: int findMinGap(int array[], int length)3. Implement a function called findLargestIndex which returns the index of the rowwith the largest sum.ex. int array[3][6] = {{3, 6, 8, 2, 4, 1}, // sum = 24{2, 4, 5, 1, 3, 4}, // sum = 19{1, 0, 9, 0, 1, 0}}; // sum = 11If the findLargestIndex function was called…6) Write a recursive function to calculate the summation of numbers from 1 to n. For exampleif the user enters 5, your program would add 1+2+3+4+5 and print out the answer 15.7) Write a recursive program to calculate Fibonacci numbers. Use the definition of a Fibonaccinumber where F(n) = F(n-1) + F(n-2). use java to code3. A palindrome is a sentence that contains the same sequence of letters read-ing it either forwards or backwards. A classic example is "Able was I, ere I saw Elba." Write a recursive function that detects whether a string is a palindrome. The basic idea is to check that the first and last letters of the string are the same letter; if they are, then the entire string is a palindrome if everything between those letters is a palindrome. There are a couple of special cases to check for. If either the first or last character of the string is not a letter, you can check to see if the rest of the string is a palindrome with that character removed. Also, when you compare letters, make sure that you do it in a case-insensitive way. Use your function in a program that prompts a user for a phrase and then tells whether or not it is a palindrome. Here's another classic for testing: "A man, a plan, a canal, Panama!"
- For function decToBinary, write the missing parts of the recursion case. This function should return a string that stores the binary equivalent for int variable num. Example: The binary equivalent of 13 may be found by repeatedly dividing 13 by 2. So, 13 in base 2 is represented by the string "1101". Examples: decToBinary(13) -> "1101" public String decToBinary (int num) { if (num < 2) return Integer.toString(num); else return <<Missing recursive call>> + <<Missing calculation>>;}1. Bibi is challenging you to implement a recursive function to check integer X is a prime number or not. A prime number can be divided only by 1 and itself. You have to implement a recursive function “int isPrime(int x)” in C. Format Input The first line of the input contains an integer T, the number of test case. The next T line consist a positive integer X. Format Output For each test case, print Case #X: Y. X is the number of test case and Y is the result from function “isPrime(x)”. Constraints 1 <= X <= 100 2 <= X <= 1.000In C++ Write a recursive function that displays a string reversely on the console using the following header:void reverseDisplay(const string& s) For example, reverseDisplay("abcd") displays dcba. Write a test programthat prompts the user to enter a string and displays its reversal.