4. Use this provided scheme code to answer the following questions. Listing 3: counter.scm 1 (let loop ((n 1)) (if (> n 10) '() (cons n (loop (- n 1))))) 2 3 4
Q: (define (doit n) (if (= n 0) 0 (+ n (doit (- n 1))) )) (print (doit 11)) Write…
A: According to the Question below the Solution: Output:
Q: 4) Structure student that contains arrays firstName[ 15 ] and lastName[ 15] and variable homeAddress…
A: Actually, array is a collection of elements.
Q: Evaluate the following Scheme form: (let ((a 3) (b 4)) (+ (* a a) (* 2 a b) (* b b))
A: Evaluating scheme expressions: (let((a 3)(b 4)) (+(* aa)(*2 ab)(* bb)))
Q: Write a Scheme function (count e Ist) that counts the number of times the eleme Occurs in the list…
A: The complete below is solved using scheme programming language:.
Q: Write the standard quicksort algorithm in Scheme, without using any imperative language features. Be…
A: Write the standard quicksort algorithm in Scheme, without using any imperative language features. Be…
Q: I want program take 5 numbers of list from users then add them , in scheme language (define (sum…
A: In this program we have to program a scheme language task in which We have take user input 5 list…
Q: KDF Example Write the following statements in Turtle Syntax with meaningful properties and then draw…
A: Here is the turtle language and RDF graph for the given data :
Q: 4-Write a Scheme procedure that takes a list and returns the sum of the number that are greater than…
A: Check the scheme procedure below.
Q: Write a Scheme function (count e Ist) that counts the number of times the element e occurs in the…
A: Schema procedures are first-class objects in the language; you refer to a procedure the same way you…
Q: In Scheme please. Please do not copy and paste the wrong answer that is out there. Dislike will be…
A: Solution: (define (clean-list lst) (cond ((null? lst) '()) ((not (number? (car lst))) (clean-list…
Q: Consider the following Scheme function: (define (mystery input-list) (cond ((null? input-list) 0)…
A: The function has a conditional expression using input list and null. The cdr function will take a…
Q: Computer Science Multiple choice (a) Vending machine is accepting a regular set as input. (b)…
A: B, C are correct options
Q: Write a Scheme procedure that takes a list and returns the list created by switching successive…
A: (define (newlist inputList) (cond ; Conditional statement ( (null? inputList)…
Q: Explain structures with an example
A: Given: Explain structures with an example
Q: Data Structures help If A = 75, B = 36, C = -2, and D = 9, then what is the results of the post fix…
A:
Q: 6-Write a Scheme procedure that takes a list and returns the list created by switching successive…
A: Please check the step 2 for code with comment for better understanding and step 3 for screenshot of…
Q: It is important for a compiler to take into consideration a variety of elements in order to generate…
A: Definition: The High Level Language software is compiled into Assembly code using a compiler. First,…
Q: Write a Racket/Scheme function that given a number x, the function returns a list of numbers from n…
A: The coding implementation is implemented below: Here in this code I am providing detailed…
Q: Discuss the steps in structured design
A: Asked: Discuss the steps in structured design
Q: 5-Write a Scheme procedure that takes a list and returns a list identical to the parameter except…
A: Logic is to get the 1st elem from the list, then the 2nd one and then the rest of the list starting…
Q: 14. How many different ways can a structure var be declared: 1 2 3 O 4
A:
Q: Write a C program to print today’s date as mm/dd/yy. Declare structure “date” with elements month,…
A: C Program: #include <stdio.h>#include <time.h> int main(void){ int day, month, year;…
Q: 33. Write syntax tree,DAG, quadruples, triples and indirect triples for the expression: a: = w…
A: Below is the complete solution with explanation in detail for the given question.
Q: 13. Sometimes it is desirable to remove the rules that are subset of larger rules. To do so, use the…
A: The answer is
Q: Accuracy of numerical scheme Choices is essential to achieve high-fidelity solution refers to how…
A: accuracy of the numerical scheme is essential to achieve high-fidelity solution. also, it refers to…
Q: Select the lines of code in the right order to create a Scheme function that generates a list of X…
A: Answer is ( Y X) (lambda (Y X) (lambda Y X)
Q: Write a program in c language to store the information of any biological entity in a structure…
A: #include <stdio.h> struct students // Define the student structure { char name[100]; //…
Q: a C++ code for implementing a general tree of data structures. The output of the programme should be…
A: C++ code: #include <iostream>using namespace std; //define a node of a treestruct node { int…
Q: 1. Draw the top levels of a structure chart for a program having the following main function (you…
A: Draw the top level of a structure chart for the given program: insert->drawing def main():…
Q: Write a Scheme function which returns a list without the last element: (rdc '((1 2 3) 4 (5 6))) ((1…
A: Scheme is a computer language with several paradigms. It's a Lisp dialect that allows for both…
Q: Evaluate the following Scheme form: (let ((a 3) (b 4) (+ (* a a) (* 2 a b) (* b b))
A: Given: Evaluating scheme expressions: (let((a 3)(b 4)) (+(* aa)(*2 ab)(* bb)))
Q: 3) Write a C program to find sum of two complex numbers by using structure. Complex numbers will be…
A: code #include<stdio.h> /* Declaring Structure */typedef struct{ float real; float…
Q: Explain briefly the two ways nested structures can be used.
A: Nested Structure can be accessed in two ways: Structure inside a structure in C using the pointer…
Q: Write a Scheme function which returns a new list which an element e is added at the end of the list:…
A: In this program we have to Implement the scheme program function which will take a new element and a…
Q: def optimize_tail_calls(original_scheme_eval): """Return a properly tail recursive version of an…
A: Tail Recursion # A tail call is a call expression in a tail context:# The last body sub-expression…
Q: еxp > еxp addop term | term addop → + | - term → term mulop factor | factor mulop → * factor → ( exp…
A: Provided the leftmost derivations, parse trees and abstract syntax trees for the given expressions…
Q: Write a Scheme program that returns the maximum of a list of numbers formed from the union of the…
A: According to the information given:- We have to join two list and return total number of element in…
Q: Write a C program to assign the following values by using the node and malloc function. (Use strcpy…
A: While doing programming in any programming language, you need to use various variables to store…
Q: the given logical expression
A:
Q: Write a Scheme procedure that sums all the elements in a given list of numbers.
A: Scheme program: Scheme was designed by Guy L.Steele and Gerald Jay Sussman in 1970. Scheme is a high…
Q: The structure or format of data is called O a) Semantics O b) Struct c) Formatting d)no of the above
A: I answered the first part of question. repost the another question as separate one. The structure…
Q: 3) Write a C program to find sum of two complex numbers by using structure. Complex numbers will be…
A: Sample output of the program:
Q: 9-Define a scheme procedure that takes a list and returns the depth of the most nested parentheses…
A: The answer is given below:
Q: 2. Write a Scheme function numofatoms that determines the number of elements in a list. For…
A: So in racket to find the number of elements in a list we have the length method. Here we are…
Q: The structure or format of data is called a) Semantics оо O b) Struct O c) Formatting O d)no of the…
A: Answer is given below:
Q: 4-Write a Scheme procedure that takes a list and returns the sum of the odd- numbers that are less…
A: To Do: To write the code.
Q: Write a Scheme program using Dr. Racket to perform a binary search. Sample Data Pattern:
A: You have to use code like this (define emptyTree '()) (define (addToTree Tree k v) (match Tree ['()…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Python only* Use recursive function*. Define concentricCircles with 4 parameters Use def to define concentricCircles with 4 parameters here is the specification for concentricCircles function: It draws a series of concentric circles, where the first parameter specifies the radius of the outermost circle, and the second parameter specifies the number of circles to draw. When viewed as nested rings, all rings should have the same thickness. The third and fourth parameters specify an outer color and an other color, respectively. The outer color is used for the outermost circle, and then every other circle in to the center alternates between that color and the other color. We will test both how many circles are drawn as well as whether the correct circles are drawn in the correct order. Hint: Each function call frame only needs to draw a single circle. Note that you must use the turtleBeads drawDot function to draw each circle Do not use any kind of loop Within the definition of…Python only* Use recursive function*. Define concentricCircles with 4 parameters Use def to define concentricCircles with 4 parameters here is the specification for concentricCircles function: It draws a series of concentric circles, where the first parameter specifies the radius of the outermost circle, and the second parameter specifies the number of circles to draw. When viewed as nested rings, all rings should have the same thickness. The third and fourth parameters specify an outer color and an other color, respectively. The outer color is used for the outermost circle, and then every other circle in to the center alternates between that color and the other color. We will test both how many circles are drawn as well as whether the correct circles are drawn in the correct order. Hint: Each function call frame only needs to draw a single circle. Note that you must use the turtleBeads drawDot function to draw each circle Do not use any kind of loop Within the definition of…Help with a lisp function (please post photos) A lisp function that generates a random day of the week, then displays a message saying that "Today is ... and tomorrow will be ...". For this purpose, create a global variable before the function containing the days of the week as a list. Then use the built-in function random first to generate a number between 0 and 6 (including). The expression (random) by itself generates a random integer. You can call it with one parameter to return a value within the range from 0 to the value of the parameter-1. For example, (random 10) will return a value between 0 and 9. Next, use the number generated at the previous step to retrieve the symbol for the day of the week from the list. Use the built-in elt function. We want the name of the day to appear capitalized. For this, extract the symbol-name of the day first, then apply the built-in function capitalize to it. Use the result in the princ function call, and do the same thing for the next day.…
- In c++ write a program using structures that first inputs the data for 3 employees including their names, emp-ids and salary. Apply bubble sort on the data entered and sort the employees on basis of highly paid salary. Also apply linear search on this data to search the employee with his name and display its further record on-screen. ( Drop coding in words with screenshot of output as well )Q1. [Lecture 5: Dynamic Programming] Draw the final Dynamic Programming table for computing the LCS of the two strings: ABCDE, BCBADE. Show all arrows. From this table find the LCS length, all possible LCSS, and show their reverse paths. (Similar to Slide 34 of Lecture 5).def optimize_tail_calls(original_scheme_eval): """Return a properly tail recursive version of an eval function.""" def optimized_eval(expr, env, tail=False): """Evaluate Scheme expression EXPR in Frame ENV. If TAIL, return an Unevaluated containing an expression for further evaluation. """ if tail and not scheme_symbolp(expr) and not self_evaluating(expr): return Unevaluated(expr, env) result = Unevaluated(expr, env) # fill in code code here while isinstance(result, Unevaluated): #code here return optimized_eval scheme_eval = optimize_tail_calls(scheme_eval)
- Q # 1. Note: write in c programming. Implement a Result Compilation System for CP Course. Program will take Marks of 3 Quizzes, 2 assignments, one midterm and one final term from the user as input. Marks of each quiz will be out of 15, marks of each assignment will be out of 40. Marks of Midterm will be out of 60 and Final term out of 80. Program will compute total marks in the subject according to the following grading scheme and display on the screen. 图 Category Weightage 1 Quizzes 25% 2 Assignments 15% 3 Mid-term 20% 4 Final-term 40% Total Marks 100Task using C language One common way of verifying if the data integrity of a file was preserved during a copy or transmission is to verify if the checksum matches. The checksum is a small piece of data computed from the original data. Your task is to compute a recursive function that maps an integer into a single digit to be used as checksum. Given an input integer in the range from 0 to 1012, the checksum is the sum of the digits of the input number. While the resulting sum has multiple digits, the checksum will be the sum of its digits instead. For instance: if the input is 34, the checksum is 7 (3+4); if the input is 99, the sum of its digits is 18 (9+9), so the checksum is 9 (1+8); if the input is 99999999999, the sum of its digits is 99 (9+9+9+9+9+9+9+9+9+9+9), whose sum of digits is 18 (9+9), so the checksum is 9 (1+8). Requirements Follow the format of the examples below. Make sure your variables and parameters have the correct data types. You must implement a recursive…Q # 1. Note: write in c programming. Implement a Result Compilation System for CP Course. Program will take Marks of 3 Quizzes, 2 assignments, one midterm and one final term from the user as input. Marks of each quiz will be out of 15, marks of each assignment will be out of 40. Marks of Midterm will be out of 60 and Final term out of 80. Program will compute total marks in the subject according to the following grading scheme and display on the screen. Category Weightage 1 Quizzes 25% 2 Assignments 15% 3 Mid-term 20% 4 Final-term 40% Total Marks 100
- Program output of a triangle of stars is shown. Choose the entries needed to complete the code that would produce this output. Note: Declare/initialize the variables in the order in which each is first used in the structures. Output ** *** **** ***** ****** ******* ******** ********* ********** Complete the code entries below: + //outer while loop + //nested while loop + //increment counter + //output a line break character + //increment counter#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 Matched1. Assume the following recursive function: (M-4) int sequence(int num) //Line 1{ //Line 2if (num == 0) //Line 3return num; //Line 4else //Line 5return(num + sequence num - 1)); //Line 6} //Line 7a. Identify the base case.b. Identify the general case.c. What valid values can be passed as parameters to the function sequence?d. If sequence (-3) is a valid call, what is its value? If not, explain why.