Write a program named stars.py that has two functions for generating star polygons. One function should be implemented using an iteration (a for loop), and another function should be a recursion. It is optional to fill in your shapes. The functions for generating stars should be named star (size, n, d=2) and star_recursive (size, n, level, d=2), where size is the size of the polygon side (edge), n is the number of sides (or angles), d is a density or winding number that should be set to default value 2, and level is the level of recursion initially equal to n.
Q: in C# i need to Write a program named InputMethodDemo2 that eliminates the repetitive code in the…
A: The Algorithm steps to solve the given Problem: Start Define two integer variables to store user…
Q: When moving data from locally housed servers to a cloud-based data center, what potential governance…
A: Answer: The infrastructure of the charity information is maintained by the charity administration…
Q: What precisely is the SOA, and how does it operate in practice?
A: SOA, or service-oriented architecture, specifies a method for reusing software components through…
Q: The makeSound() method for Pig should return: "name says: oink oink oink!" The makeSound() method…
A: java program using the interface makeSound() method for Pig should return: "name says: oink oink…
Q: How do real-time and non-real-time operating systems compare and contrast? In what ways are…
A: Introduction: Operating systems play a crucial role in determining the behavior and performance of…
Q: Recently, Google established an office in Pakistan. You have just landed a job there. During the…
A: Introduction: The data processing logic and control for a microprocessor are housed on a single…
Q: Vrite a program named stars.py that has two functions for generating star polygons. One function…
A: Here's an implementation of the two functions in Python:- import turtle def star(size, n, d=2):…
Q: If you see a mistake in the following situation, please mark it. The sender includes the number…
A: Odd Parity : It means that if the number of one's present in data transmission is odd then Parity…
Q: In what ways do the SPEC CPU benchmarks improve upon the Whetstone, Dhrystone, and Linpack tests?
A: Introduction: SPEC CPU (Standard Performance Evaluation Corporation's CPU Benchmarks) is a series of…
Q: k to deceiv
A: No, it isn't plausible to deceive somebody utilizing a technology like mechanical Turk. Mechanical…
Q: Will cloud computing solve every IT problem for businesses?
A: Cloud computing is a technology which serves IT resources and services on internet. IT problems…
Q: During the course of the development process, do developers have any concerns about any particular…
A: Introduction Cycles of development are utilized to illustrate all the stages and factors that go…
Q: 1. Let's suppose there is an organization with two departments with each department requiring 120…
A: 1. A computer network refers to interconnected computing devices that can exchange data and share…
Q: Typically, filter tools like sed and awk are used to organise data in pipelines. Could you please…
A: sed and awk are filter tools in Unix-like systems They are used for text transformations and…
Q: Can a company's IT problems really be solved by moving to the cloud?
A: Some of a company's IT issues may be resolved by moving to the cloud, but this is not a guarantee…
Q: I want to know what is the impact when database clean up of old jobs in the queue for a system/app…
A: Here is your solution :-
Q: n Essay On Software Engineering,In 4pages, A
A: We know Software engineering is the process of designing, coding, testing, and maintaining software…
Q: an analytical solution for this In this question, please write out the first 10 terms (from 0 to 9)…
A: The sequence hn can be found by analyzing the function f. For n = 0, h0 = 1, as the function prints…
Q: 1) Compare and contrast the similarities and dissimilarities between an ARP table and MAC table.…
A: Networks: Networks are used to connect computers and other devices such as printers, modems, and…
Q: Explain why the maintenance procedures for the interactive model vary from those of the waterfall…
A: The differences between the waterfall model and the interactive model are described below: The…
Q: To what extent does adding more redundancy to a communication improve its reliability, and what are…
A: There are several benefits to include extra redundancy bits in a message. Advantages The bit error…
Q: difficulties of establishing a data center to house the new service, and consider whether or not…
A: Outline the difficulties of establishing a data center to house the new service, and consider…
Q: What precisely is SETI, and how does it make beneficial use of the notion of distributed computing…
A: SETI (Search for Extraterrestrial Intelligence) is a scientific endeavour that aims to discover…
Q: Python code to calculate the eigenvalues and eigenvectors of a matrix from the numpy linalg library…
A: Introduction Numpy is a Python library that provides support for large, multidimensional array and…
Q: ata cable between two office labs that are 80 meters apart. What is two advantages of using a copper…
A: Twisted pair cable One type of wiring is twisted pair wire, which consists of two conductors from a…
Q: When returning a block from the write buffer to main memory, what should happen if the processor…
A: In a computer system, the cache is a small, fast memory that stores frequently accessed data from…
Q: Could you provide me some specific instances of how virtual servers have been used in schools or…
A: A dedicated capability of a real server may be recreated using a virtual server. By installing a…
Q: Tell me about the difficulties you've encountered when using Business Intelligence.
A: Business Intelligence: BI analyses business data such software, domains, technologies, etc. To…
Q: The system writes to VA page 30 if an instruction is not accepted; what does it mean? A TLB that is…
A: A computer is a digital electronic machine that can be programmed to automatically perform a series…
Q: What is the preferred layer transfer protocol (UDP or TCP) for Multimedia and DNS services? Why?…
A: TCP stands for Transmission Control Protocol and UDP stands for User Datagram Protocol. These two…
Q: Object-Oriented Programming OvalDraw Plus (Java code) Summary: Create a graphical application with…
A: import java.awt.*; import javax.swing.*; public class OvalDrawPlus { public static void…
Q: Please code in JAVA Declare a decimal variable named average. This variable will be the numerical…
A: Algorithm : 1. Start 2. Create a Scanner object to read input from the user. 3. Prompt the user to…
Q: What are some of the most common objections to implementing IoT?
A: In this question we have to understand most common objections for implementing the Internet of…
Q: What would happen if you set reboot.target as the system's default runlevel/target?
A: reboot.target is the system target and the run level for this target is 6. This reboot.target is…
Q: Interns who appear to be violating many security policies are confronted by the CISO, who hears…
A: Security is one of the most crucial components for many businesses. Every business has a certain…
Q: Why is it important to have a set of moral guidelines for software engineers?
A: Software Engineering is a career that requires professionals to go through the process of studying…
Q: The total cost of a group of items at a grocery store is based on the sum of the individual…
A: Here is the code for NecessaryProduct and LuxuryProduct classes: CODE in JAVA: public class…
Q: You are asked to design an automation support unit for telecommunication company. A request that is…
A: Communication:- Communication is the exchange of information, thoughts, or ideas between individuals…
Q: Both abstract classes and interfaces may be used to specify the expected behavior of an object. What…
A: INTRODUCTION: Abstract class : It is a class that has been declared to be abstract, and it may or…
Q: In the process of designing models for software-intensive systems, which views need to be taken into…
A: Software intensive systems are the systems where software influences the design, construction,…
Q: In order to improve speed, your organization has decided to spread its product database over many…
A: The solution to the given question is: Some of the issues that must be overcome when the product…
Q: DCE RPC added these features that ONC RPC (Sun RPC) does not have: a) The use of a stub compiler…
A: All of the options are correct and there are no incorrect options in this list.
Q: Create a function named withLowerCase that accepts a char formal parameter and prints this character…
A: The provided code defines a Java class named "Main" with a withLowerCase method that takes a char…
Q: C# i need to Write a program named SortWords that includes a method named SortAndDisplayWords that…
A: CODE in C#: using System;using static System.Console;public class SortWords{ public static void…
Q: What are some types of operating systems and examples of each?
A: Software that can handle and manage a computer's hardware and software resources is known as the…
Q: Describe an instance in which magnetic stripe cards are inadequate for authentication but smart…
A: Here is your solution -
Q: Question 9 nag .While classifying cybersecurity threats, which threat actors exist outside of…
A: Cybersecurity threats: Cybersecurity threats are malicious activities that target computer systems…
Q: Discuss the merits of all-subsets regression versus stepwise regression in the context of data…
A: All-Subset Regression All potential models or regressions refer to it. Again, the process name…
Q: Write down two external and two internal factors that are interfering with your ability to hear…
A: Introduction Interfering: Interfering refers to something that hinders, obstructs, or impedes…
Q: Consider the following generalization of the maximum matching problem, which we call…
A: Answer: The proof that Strict-Matching is NP-complete is shown through a reduction from the…
pytthon plzzzzz
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Write a program that allows a user to enter non-negative int number. The recursive function is to be named sumSquares that returns the sum of the squares of the numbers from 0 to number.Do not use any global variables.Write a program called Recursive_fibonacci.java that implements a recursive function for computing the nth term of a Fibonacci Sequence. In the main method of your program accept the value of n from the user as a command-line argument and then call your function named Fibonacci with this value. The output should look exactly like what is pictured below.please code in python Write a recursive function to add a positive integer b to another number a, add(a, b), where only the unit 1 can be added, For example add(5, 9) will return 14. The pseudocode is: # Base case: if b is 1, you can just return a + 1 # General case: otherwise, return the sum of 1 and what is returned by adding a and b - 1.
- This is for Java Write a recursive function that takes as a parameter a nonnegative integerand 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 inthe pattern and uses the recursive function to generate the pattern. Forexample, specifying 4 as the number of lines generates the above pattern. Java pleaseWrite a program called Super_Digit.java with a recursive function called superDigit. The function must return the calculated super digit as an integer. If 'x' has only 1 digit, then its super digit is 'x' Otherwise, the super digit of 'x' is equal to the super digit of the sum of the digits of 'x' Hint: use a combination of n%10 and n/10 The output should look like what is given below. Please give an editable code.Write a Recursive Python program named getValue, which will be given (as argument) a student name and a list of student names and their marks (as shown in format given below). The function should return marks of the given student. If the student name does not exist in the list then the function should return None. Sample calls have been given below. >>> getValue('Asif',[('Kashif', 10),('Asif',20),('Fahad',30),('Tariq',15)])20>>> getValue('Fahad',[('Kashif', 10),('Asif',20),('Fahad',30),('Tariq',15)])30>>> getValue('Noman',[('Kashif', 10),('Asif',20),('Fahad',30),('Tariq',15)])None
- A recursive function is a function defined in terms of itself via self-referential expressions. This means that the function will continue to call itself and repeat its behavior until some condition is met to return a result. Write a complete python program that includes a recursive python method, sumThem which accepts an argument, n, sums all the odd, or all the even, positive integers up to n*3, depending on whether n*3 is odd or even. The number should be entered by the user You should include in your answer a screenshot that shows the program and the output for the value n*3 where n must be equal your last ID digit. For example, if your ID is 201314151617, then 7 will be entered, and the calculations should be applied to 21. Expected Output Sample: Enter the number: 0 The sum of even numbers up to 0 will be: 0Write a program that draws a square fractal. Fractals are images that keep repeating their own image in ever-smaller versions. There exists numerous fractals and some fractals rely on computation of advanced mathematics. All fractals have a recursive quality and provide an ideal platform for practicing recursive concepts. You will note that from the four corners of the center rectangle, smaller rectangles are drawn and each rectangle in turn continues to draw three smaller rectangles until the rectangle is the size of one pixel. A CODE TEMPLATE & PICTURE OF OUTPUT IS ALREADY PROVIDED IN THE ATTACHED PICTURES Method drawSquare1 gets the ball rolling and draws a solid rectangle in the center of the screen. The initial rectangle needs to be 1/4 the size of the monitor. This explains why it is important to know the screen resolution and why this information is passed by parameter. Method drawSquare1 needs to make four method calls to draw each one of the four rectangles attached to…Write a program that draws a square fractal. Fractals are images that keep repeating their own image in ever-smaller versions. There exists numerous fractals and some fractals rely on computation of advanced mathematics. All fractals have a recursive quality and provide an ideal platform for practicing recursive concepts. You will note that from the four corners of the center rectangle, smaller rectangles are drawn and each rectangle in turn continues to draw three smaller rectangles until the rectangle is the size of one pixel.
- An arithmetic sequence is a sequence of values where successive values have a common difference. For example, 2,5,8,11,... is an arithmetic sequence starting at 2 with a common difference of 3. We call the starting point s and the difference d. Fill in the missing lines below to write a recursive Python function called arithmetic that takes values for s, d, and n, and returns the nth term of the arithmetic sequence. For example, given the main function: def main(): for i in range(1,6): print(arithmetic(2,3,i)) the output will be: 2 5 8 11 14 Note: No marks will be given for a non-recursive solution. Code with missing lines: # Line 1 # Line 2 # Line 3 # Line 4 # Line 5 Matching each line of code below to its proper line number (Line 1 to Line 5), indicated in the partial code above, to solve the problem. Some lines of code will not be used at all; for these you would select option 6 (i.e., Not Used) from the list of options - do not leave these blank. Question 8 options:…The Polish mathematician Wacław Sierpiński described the pattern in 1915, but it has appeared in Italian art since the 13th century. Though the Sierpinski triangle looks complex, it can be generated with a short recursive function. Your main task is to write a recursive function sierpinski() that plots a Sierpinski triangle of order n to standard drawing. Think recursively: sierpinski() should draw one filled equilateral triangle (pointed downwards) and then call itself recursively three times (with an appropriate stopping condition). It should draw 1 filled triangle for n = 1; 4 filled triangles for n = 2; and 13 filled triangles for n = 3; and so forth. API specification. When writing your program, exercise modular design by organizing it into four functions, as specified in the following API: public class Sierpinski { // Height of an equilateral triangle whose sides are of the specified length. public static double height(double length) // Draws a filled equilateral…Consider a network of streets laid out in a rectangular grid, In a northeast path from one point in the grid to another, one may walk only to the north (up) and to the east (right). Write a program that must use a recursive function to count the number of northeast paths from one point to another in a rectangular grid. Your program should prompt the user to input the numbers of points to the north and to east respectively, and then output the total number of paths. Notes: 1. Here is a file (timer.h download and timer.cpp download) which should be included in your program to measure time in Window or Unix (includes Mac OS and Linux) systems (use start() for the beginning of the algorithm, stop() for the ending, and show() for printing). 2. The computing times of this algorithm is very high, and the number of paths may be overflow, don't try input numbers even over 16. 3. Name your recursive function prototype as calcPath(int north, int east) to ease grading. 4. Paste your output