Please write Lisp code for the following problem. Write a function that computes the surface area of a cylinder. In other words use surface area = 2(pi xr2)+(2 xpi xr) xh, where r = radius and h = height. Test your function on at least: (r h) = (2 1); (r h) = (8 2); (r h) = (3 7).
Q: Solution in Java Create a function that takes an array of increasing letters and return the missing…
A: Input - Array of String Output - missing letter logic - for(int i = 1; i < arr.length; i++){…
Q: Implement a Java method with the identifier "SquareRoot" that takes parameter of type integer and…
A: It is defined as an object-oriented programming, platform-independent, and secure programming…
Q: Please write Lisp code for the following problem. Write a function that computes the surface area of…
A: taking the formula for surface area of a cylinder - 2pir2 +2pirh Lisp program in next step
Q: The language we are using here is in Racket. Please try tying each of the following (car '(11 12…
A: What do car and cdr do? That last line of the above should cause an error. Explain why the single…
Q: Lambda calculus. Please do a reduction (Ab.Xx.^y.b y x)(x.Ay.y)
A: About lambda calculus:…
Q: This is for a Java Progrsm problem but If you could fully explain it to me then I should be okay to…
A: In this question, we are given only the width of the two pipes. The angle is not given to us. The…
Q: i need help calculating the state with the fewest number of disease cases on java code that runs…
A: import java.util.*; public class CovidAnalyzer{ public static void main(String[] args) {…
Q: Write a program that has a class triangle with an overloaded function Area(). If two sides are…
A: Function Overloading: It is also know as method overloading. The function is said to be…
Q: This is a matlab coding problem Implement a recursive function, called isPalindrome, that takes a…
A: function isPalindrome = palindrome(x) x = upper(char(varargin{1})); n = length(x); iseven =…
Q: Implement a function (Java or pseudocode) that will accept a mathematical expression which contains…
A: import java.util.Scanner;import java.util.Stack;public class StringCheck { public static void…
Q: solve the problem in java: Consider the are n=2 subjects and needed =[4,5] answered questions, to…
A: imports used import java.util.*;
Q: Implement a C function, named triangle, that outputs Pascal’s triangle. In general, the Pascal’s…
A: Implement a C function, named triangle, that outputs Pascal’s triangle.
Q: You are to create a well-formed Python recursive function (i.e, there must be a stopping/base case…
A: 2)trace function call: 1) factorial(5) 2) 5*factorial (5-1) 3) 5*4*factorial (4-1) 4)…
Q: After representing two three-dimensional vector fields as input and vectors as bundles, Write a…
A: Here I have taken space-separated values from ser and then stored them into 2 different lists. Next,…
Q: + Write that takes a parameter of se²-2>x+2. m (H I as imput parametor and GRven > I<I< 5o Hetwrns…
A: In the required function having x as input parameter return x*x - 2*x + 2. In main function take…
Q: Please do this in JAVA PROGRAMMING. Given: List L of pairs of characters String S…
A: The code is below : Considering the length of each string .
Q: A standard quadratic equation looks like this: ax? + bx + c = 0. To solve for roots , we use the…
A: #include <stdio.h>#include <math.h> void findRoot(int a, int b, int c){ float…
Q: Write a function that multiplies two polynomials in HASKELL multPoly :: (Num a, Eq a) => Poly a ->…
A: Output 1st Number: 5x^2 + 4x^1 + 2x^0 2nd Number: -5x^1 - 5x^0 Added polynomial: 5x^2 - 20x^2 -…
Q: Write a Program in Java to find the value of universal gas constant at STP.
A: Your Java program is here with an output. Algorithm: 1. Start 2. Read the value of Volume,…
Q: You would like to do some experiments in natural language processing. Natural language processing…
A: We need to write a Python program for the given problem. Input : A number n that determines number…
Q: Write the code in Java and C++ .... Given arrival and departure times of all trains that reach a…
A: The C++ and the java code with the screenshots is given below as:
Q: implement the following tasks using recursive functions in C programming: Summation of the…
A: Using recursive function in c programing Summation of the integers 1,2,3,4....n Factorial function…
Q: Write your own Python program where a non-intrinsic function solves for all the roots of a cubic…
A: Cardano's formula: It is used to solve the values of the cubic polynomial. It is the most widely…
Q: Write a program that solves quadratic equation of the form ax2 + bx + c where a, b and c are…
A: #include <iostream>#include <cmath>using namespace std; int main() { float a, b, c,…
Q: A/ Write a C++ program to find the area and the volume of a cylinder for the following heights(h):…
A: Use r=5, pi=3.14 Use one for loop to find area and volume for heights (2,4,6,8) and (1,3,5,7)
Q: Problem In this assignment, you are required to implement the fractional knapsack problem. In a…
A: Program:- class ItemValue: def __init__(self, wt, val, ind): self.wt = wt…
Q: Ax + Bx = C for all constants (A, B, C and a) >0 -- a Find all possible roots.
A: Code: /****************************************************************************** Welcome to GDB…
Q: Write a LISP function that returns the smaller of two numbers. If x is less than or equal to y,…
A: According to the given question, the proper solution is given below:
Q: Write a MATLAB function computeCylinderVolume which should call computeCircleArea.…
A: The code is given in step 2.
Q: Can someone help Write a program that finds all the ways in which the mouse can move to the cheese,…
A: Answer:
Q: Write a program c++ that receives from the user a point on the X level - y, then prints whether the…
A: Code: // CPP program to check quadrant#include <bits/stdc++.h>using namespace std; // Function…
Q: Chemical reaction rates are proportional to a rate constant, k, which changes with temperature…
A:
Q: Write a program that has a class triangle with an overloaded function Area(). If two sides are…
A: GIVEN: Create a Java program to find the area of the triangle. If two sides are entered, then…
Q: Solution in Java Create a function that takes an array of increasing letters and return the missing…
A: In this problem, we need to design the code in the JAava programming language. Input - Array of…
Q: Implement the following functions without using the library: a. int power (int n, int m) [Returns:…
A: Implement the function in C language: int power(int n,int m) The function takes input two integer…
Q: To complete this lab, you will need to have Java and Eclipse installed a Procedure The monthly…
A: code: import java.lang.Math;import java.util.*;public class Main{ public static void main(String[]…
Q: Write a program in C ++ slanguage to find the traffic light And write a suitable massages in * .each…
A: In the c++ program, Include the necessary header files and then create the main() method to perform…
Q: 7 13 37 The magic square is solved as: 31 73 7 13 37 61 1 43 LI
A: Write a code for MatLab that is capable of solving 3x3 magic squares. Magic squares are those in…
Q: Solution in Java Create a function that takes an array of increasing letters and return the missing…
A: Input - Array of String Output - missing letter logic - for(int i = 1; i < arr.length; i++){…
Q: You are to create a well-formed Python recursive function (i.e, there must be a stopping/base case…
A: Recursive Function: A recursive function is considered to invoke itself and the function call is…
Q: Implement a Java method with the identifier “CubeRoot” that takes 1 parameter of type integer and…
A: Program Explanation:- Method taking one parameter as int. Converting radicand to positive if it is…
Q: Please answer the following in Python programming language Assuming that my_tuple is a correctly…
A: Tuples in python are immutable which means we can't modify them i.e. they cannot be changed only few…
Q: Write a program that has a class triangle with an overloaded function Area(). If two sides are…
A: #include <iostream>#include <math.h>using namespace std; int main() { float…
Q: WAP IN JAVA TO Find the radius of gyration of solid sphere about its diametric axis which passes…
A: GIVEN:
Q: Write a program that draws a perfect centered star using functional programming. Must use the Affine…
A: The following are the most notable features of functional programming: Functional programming…
Q: Implement a C function, named triangle, that outputs Pascal’s triangle. In general, the Pascal’s…
A: Pascal Triangle is a triangle of numbers where each number is the two numbers directly above it…
Q: Write a program that has a class triangle with an overloaded function Area(). If two sides are…
A: Program Approach: Create variables area of double type and perimeter s of int type. Create two…
Q: Define a function in JAVA that takes three integers x, y, andt as the input parameters and the…
A: Define a function in JAVA that takes three integers x, y, and t as the input parameters and the…
Please write Lisp code for the following problem.
Write a function that computes the surface area of a cylinder. In other words use surface area = 2(pi xr2)+(2 xpi xr) xh, where r = radius and h = height. Test your function on at least:
(r h) = (2 1);
(r h) = (8 2);
(r h) = (3 7).
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write a simple Common Lisp function that converts temperature in Celsius to Fahrenheit and show how to correctly output it! Use temp-change as function name and c as the parameter!Can someone please help me with this Lisp question? Write a function in Lisp, Nove Scotia License plate that when handed a list will check if the first three are single letters and last three are numbers. If this is so, return 'T'. If there are any other mixtures, like numbers where there should be letters, if the first three are not single letters only, if the numbers are greater than 9, if the numbers are in the wrong place, if you get more or less than 6 things in the license number, or if the first character is greater than 'G (that's about where they are now), then you should return a NIL. No need to consider vanity or motorcycle plates. * (NSLicense '(S M R T I E)) NIL * (NSLicense '(W O T 1 2 3)) NIL * (NSLicense '(WHAT IS THIS 1 12 123)) NIL * (NSLicense '(A A A 0 0 0)) T(Program) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters, such as zerocount, onecount, twocount, and so forth, to 0. Then generate a large number of pseudorandom integers between 0 and 9. Each time 0 occurs, increment zerocount; when 1 occurs, increment onecount; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of time they occurred.
- Write a program function (in any programming language) that will find and add every alternative prime numbers which are in the range from 1 to first four digits of your student ID and then subtract the summation of all the prime number digits in your student ID. Find the Cyclomatic Complexity of the code segment and show the different basic paths for test cases.Implement a recursive C++ function which takes two integers num and den as arguments and returns theinteger quotient that will result when num is divided by den. The prototype of your function should be:int quotient (int num, int den)Hint: Think about repeated subtractionWrite a MATLAB function computeCylinderVolume which should call computeCircleArea. computeCylinderVolume should take as parameters the height and the radius of a cylinder (in that order), and should return the cylinder’s volume. (If you do not recall the formula for a cylinder’s volume, find it on the Internet.)
- Apply Python Programming to this problem:With a rotated conic as such: Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0, write a function classifyconic(x) which has a purpose to classify if the given parameter of a conic is elliptic, hyperbolic or parabolic. The given parameter is x = [A, B, C, D, E, F].Note: A parabolic rotated conic has a discriminant D = B^2 - 4AC that is equal to zero. An elliptical rotated conic has a discriminant less than zero. A hyperbolic rotated conic has a discriminant greater than zero.Consider these questions:What type of rotated conics are these equations?1. x^2 - 3xy - 2y^2 + 8x + 6y + F1 = 02. x^2 + 2xy + y^2 + 2x + 4y + F2 = 03. x^2 + 3xy + 4y^2 + 3x + 5y + F3 = 0IN PYTHON A tridiagonal matrix is one where the only nonzero elements are the ones on the main diagonal and the ones immediately above and below it.Write a function that solves a linear system whose coefficient matrix is tridiag- onal. In this case, Gauss elimination can be made much more efficient because most elements are already zero and don't need to be modified or added. As an example, consider a linear system Ax = b with 100,000 unknowns and the same number of equations. The coefficient matrix A is tridiagonal, with all elements on the main diagonal equal to 3 and all elements on the diagonals above and below it equal to 1. The vector of constant terms b contains all ones, except that the first and last elements are zero. You can use td to find that x1= −0.10557. The following code format should help: def td(l, m, u, b): '''Solve a linear system Ax = b where A is tridiagonal Inputs: l, lower diagonal of A, n-1 vector m, main diagonal of A, n vector u,…The language must be in python. Just do numbers 5-7 Neural Network Units Implement a single sigmoid neural network unit with weights of [-1.2, -1.1, 3.3, -2.1] Calculate the outputs for two training examples:Example 1: [0.9, 10.0, 3.1, 1]Example 2: [0.9, 2.1, 3.7, 1] Note that you don't have to explicitly include a threshold or bias since the examples include a last element of 1 which means that the last weight effectively operates as a threshold. Assuming that a sigmoid unit response >0.5 denotes a positive class and <0.5 is negative class, is example 1 positive or negative? is example 2 positive or negative? Create a single ReLU unit and provide the outputs for those examples. Calculate the derivative of the sigmoid with respect to net input for both examples Calculate the derivative of the ReLU with respect to net input for both examples
- Write the code in Java and C++ ....Given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept waiting.Consider that all the trains arrive on the same day and leave on the same day. Arrival and departure time can never be the same for a train but we can have arrival time of one train equal to departure time of the other. At any given instance of time, same platform can not be used for both departure of a train and arrival of another train. In such cases, we need different platforms. Example 1: Input: n = 6 arr[] = {0900, 0940, 0950, 1100, 1500, 1800}dep[] = {0910, 1200, 1120, 1130, 1900, 2000}Output: 3Explanation: Minimum 3 platforms are required to safely arrive and depart all trains.Example 2: Input: n = 3arr[] = {0900, 1100, 1235}dep[] = {1000, 1200, 1240}Output: 1Explanation: Only 1 platform is required to safely manage the arrival and departure of all trains.for C++ write a progam for the greatest common divisor of integers x and y is the largest integer that evenly divides both x and y. Write a recursive function gcd that returns the greatest common divisor of x and y. The gcd of x and y is defined recursively as follows. If y is 0 the answer is x; otherwise gcd(x, y) is gcd(y, x%y).This is for a Java Progrsm problem but If you could fully explain it to me then I should be okay to try to create this program based off your explaination. Thank you! Trigonometry is needed A pipe is to be carried around a right-angled corner of two intersecting corridors. Suppose that the widths of the two intersecting corridors are 5 feet and 8 feet. Your objective is to find the length of the lingest pipe, rounded to the nearest foot, that can be carried level around the right-angled corner. What I have to do is the following: Write a program that prompts the user to input the widths of both the hallways/ The program then outputs the length of the longest pipe, rounded to the nearest foot, that can be carried level around the right-angled cprner. Note that the length of the pipe os goven by l = AB + BC = 8 /SIN 0 (Omega) + 5 / cos 0(Omega), where 0 < > Omega < pi/ 2