1. Run this m-file. %program for signal convolution t=0:0.1:10; x1=sin (2*pi*t); h1=cos (2*pi*t); y1=conv (x1,h1); figure; subplot(3,1,1); plot(x1); xlabel('t'); ylabel('x(t)'); title('input signal') subplot(3,1,2); plot (h1); xlabel('t'); ylabel('h(t)'); title('impulse response') subplot(3,1,3); plot (yl); xlabel ('n'); ylabel('y(n)'); title('linear convolution'); input signal wwww 20 40 60 80 100 120 impulse response 20 40 60 80 100 120 linear convolution 50 50 100 150 200 250 2. Based on above matlab code, do a convolution for x(t) = e=2tu(t) and h(t) = (2e-3t – e-2t)u(t).
Q: Create a function that takes a string as an argument and returns true if each letter in the string…
A: Algorithm - Design a method with one argument as a string. Now use the below logic to solve the…
Q: Write a C++ program that computes the area A of Cone by reading its parameter from a text file…
A: I have given an answer in step 2.
Q: 3. Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer.…
A: The Answer is in given below steps
Q: Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: Required:
Q: g point parts ingle(float f) that will print the parts of the floating point number as disti like:…
A: #include <iostream> using namespace std; // function to convert decimal to binary void…
Q: #include #include void LineFunc(void); void main() { int a, b; printf("Enter a :"); scanf_s("%d",…
A: The program after compilations gives an error that is So the error in this has occurred due to…
Q: All parts need to be included in the same C file so the new code needs to be added to the existing…
A: Please find the answer below:
Q: F(x) = x + 1 G(x, y) = x + y Please write a program to calculate the value of composite of F and G…
A: note: No programming language is mentioned. I have attempted this in python. if you need it in any…
Q: main (void) void qst (float a, float b, int "y) float a = 3.0, b = 2.0; int y -6; %3D int x - 4, w-…
A: C program used to answer this question
Q: 2. Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: The method of designing and developing a computer program that is executable to achieve a particular…
Q: To write a printf or scanf statement for the given condition Write time of the hh: mm: ss type,…
A: Following is the scanf statement to read the time in form hh:mm:ss -: scanf ( “%d*c%d*c%d”,…
Q: Write a function that takes a string as input and PRINTS the following pattern on the screen based…
A: Here I have first of all created a function stringShift that will print the string by shifting each…
Q: We can assign a value to each character in a word, based on their position in the alphabet (a = 1, b…
A: Answer: Algorithms: Step1: we have create balance function to takes arguments as string Step2: we…
Q: PYTHON without Def function Problem Statement Given a grades.txt file of grades on an exam, output…
A: file1 = open("grades.txt")file2 = open("final_grades.txt", "w+") next(file1) # Skipping the header…
Q: nt st nat des omnile
A: #include <iostream> using namespace std; // function to convert decimal to binary void…
Q: Create a function that takes a string as an argument and returns true if each letter in the string…
A: The JS code is given below with code and output screenshot
Q: to
A: #include <iostream> using namespace std; // function to convert decimal to binary void…
Q: please code in python Write a function that receives a string and a number (n) as parameters and…
A: To implement everyNth(), strings concept in python is used.
Q: Write a program called mystring.cpp. The program should has several functions: 1. string lower…
A: #include <iostream>#include <string>#include <algorithm> using namespace std;…
Q: Assume that a0 and al holds the base address of str and strdst, respectively. int i = 0; While…
A: Here is the solution:-
Q: Given the following function definitions, write matching precondition and postcondition comments.…
A: In C++ programming languge, the comments are written by using the // or /* */. The symbol // is used…
Q: Write a function that determines the type of its input variable and converts it into a character…
A: Input : Input the data Output : Conver the input data to character array.
Q: (Printing with Field Widths) Write a program to test the results of printing the integer value 12345…
A: program : include <stdio.h> int main(){int i=12345;float j=1.2345;// for Integer sized…
Q: Write a program for Histogram Equalization of an image without using the built-in function histeq.
A: Answer
Q: (b) Below is part of a code, consider this program and show where each part of code is saved in the…
A: Given: Below is the part of a code , Consider this program and show where each part of code is…
Q: The problem statement is described in the problem_statement.pdf file. Write the solution into the…
A: Below i have answered:
Q: Exercise 4: Write a program (Lab8_ex4_ld.py) that generates a random even positive integer less than…
A: Here is Your Code import randomh = random.randint(1, 10)print("Genarated Length = ",h)for i in…
Q: 1. Write a program uses a Boolean-valued function to determine whether a set of numbers is in a…
A: import random; #importing random module to generate random numbers def isInRange(x):…
Q: The program below stores 80 bool values into a char arr[10]. Complete setBool and getBool. In both…
A: Actually, array is a collection of elements.
Q: You are given an input file (FinalProgram.txt) with the following format: number of class sections…
A: The C++ program will be designed as follows: Include the required header files- iostream, fstream,…
Q: We can assign a value to each character in a word, based on their position in the alphabet (a = 1, b…
A: Since the programming language is not mentioned, I have done the code using JavaScript.
Q: Exercise 4: Write a program (Lab8_ex4_ld.py) that generates a random even positive integer less than…
A: code :-- # for genrate random module import random# genrate random even number between 0 to 10…
Q: Create a function that takes a string as an argument and returns true if each letter in the string…
A: Program Plan: Since there is no requirement for a programming language, the code is provided in Java…
Q: 1. Write a complete C++ program that lists all numbers that are perfect squares in a range. •…
A: Answer in step2
Q: 1. Write a complete C++ program that lists all numbers that are perfect squares in a range. •…
A: ALGORITHM:- 1. Generate the value of low between 50 & 200. 2. Generate the value of high between…
Q: 2. Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: Given: Write a c program to store the values of 5 courses into file and read the values from file…
Q: Write a function which increments a string to create a new string. • If the string ends with a…
A: const incrementString = str => { const letters = [...str].filter(x => /[a-z]/g.test(x)).join``…
Q: a) Write a python program that reads the data file class-a.csv into a data frame and displays 3 rows…
A: Part A: import pandas as pd data = pd.read_csv("class-a.csv") data.head(3)# first 3 student detail
Q: IN JAVA SCRIPT Create a function that returns the thickness (in meters) of a piece of paper after…
A: Introduction: In this question, we are asked to write a JavaScript code to get the final thickness…
Q: 2. Write a program that automates the table used by a surveyor to transform compass headings in…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: b. A program that continuously accepts sign order data and displays all the relevant information for…
A: The Answer is
Q: C++ - Rolling a single six-sided die produces a random number between 1 and 6 with a uniform…
A: Actually, array is a collection of elements.
Q: Find the output of the following program. Assuming all the desired header files are already…
A: #include <iostream> using namespace std; struct Dimensions { int x_cord, y_cord; }; void…
Q: Create a function that takes a string as an argument and returns true if each letter in the string…
A: Algorithm - Design a method with one argument as a string. Now use the below logic to solve the…
Q: Write the following function that draws a line from point (x1, y1) to (x2, y2) with color (default…
A: Given: Write the following function that draws a line from point (x1, y1) to (x2, y2) with color…
Q: c++ programing Sample Testcase 0: Input: (-2) Output: Negative input Sample Testcase 1: Input: 0…
A: Program: #include <iostream> using namespace std; int main(){ int d1=0,d2=0,s,region;…
Q: 2. Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: Create a function for calculating marks. Using if-else-if to determine the grade as per the marks.…
Q: The text file exanscores.dat contains a list of numbers representing student exam scores. Write a…
A: Following are the required files: examScores.dat Code view:
Q: Create a function that takes a string as an argument and returns true if each letter in the string…
A: In this problem, we need to design a javascript program. Input - one string as an argument output…
Q: Consider the following function: int get_random(int start, int end){) int * rand_int = new int;…
A: We nee to answer: Consider the following function: int get_random(int start, int end){ int *…
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.Can you write a new code in C ++ language with the values I sent you, just like this output? There are two files named group1.txt and group2.txt that contain course information and grades of each student for each class. I will calculate each course average for each group and show in simple bar graph. Use "*" and "#"characters for group1 and group2, respectively. I will see the number -999 at the end of each line in the input files. This value is used for line termination and you can use it to verify that you have arrived at the end of the line. The averages of each group should also be calculated and printed at the end of the file. All of the results will be printed to the file. There will be no screen output. Sample output is shown in Figure 1. Group 1: CSC 80 100 70 80 72 90 89 100 83 70 90 73 85 90 -999ENG 80 90 80 94 90 74 78 63 83 80 90 -999HIS 90 70 80 70 90 50 89 83 90 68 90 60 80 -999MTH 74 80 75 89 90 73 90 82 74 90 84 100 90 79 -999PHY 100 83 93 80 63 78 88…Computer Science Write a program that processes a data sequence according to the following specifications: The sequence has three kinds of positive numbers: red, black and white. Each red number is preceded by the letter r, each black number is preceded by the letter b and each white number is preceded by the letter w. The number 0 indicates the end of data. If a number is preceded by any character other than r, b or w, the number is ignored. For instance, if the input to the program is: r 23 b 15 b 11 w 17 c 13 r 19 b 0, then we have two red numbers, 23 and 19, two black numbers 15 and 11, and one white number, 17. The number 13 is ignored. (The terminating 0 is also a black number but it is not processed.) The program produces the following output: The sum of red numbers is 42The sum of black numbers is 26The sum of white numbers is 17 Assume that input is from the keyboard and is in the prescribed format. (a). In 2-3 sentences, describe your strategy for solving this…
- Description F(x) = x + 1 G(x, y) = x + y Please write a program to calculate the value of composite of F and G Input Input will be the composite of F and G. The parameter of F and G are integer only. Output An integer represent the value of function. Sample Input 1 F(G(1,F(3))) Sample Output 1 6In C language, 3. A text file name.txt - contains this data, Sam Davis Kobe S Bryant Michael K jordan Li Peng Raj Mohan Sharma Can you write a program to read this file and print each name separately in each line ?Q2) Write a program to model a simple calculator. Each data line should consist of the nextoperation to be performed from the list below and the right operand. Assume the left operandis the accumulator value (initial value of 0). You need a function scan_data with two outputparameters that returns the operator and right operand scanned from a data line. You need afunction do_next_op that performs the required operation. do_next_op has two inputparameters (the operator and operand) and one input/output parameter (the accumulator).The valid operators are:+ add- subtract* multiply/ divide^ power (raise left operand to power of right operand)q quitYour calculator should display the accumulator value after each operation. A sample run follows.+ 5.0result so far is 5.0^ 2result so far is 25.0/ 2.0result so far is 12.5q 0final result is 12.5
- In xCode for Mac: A. Write a program that lets the user play the game of Rock, Paper, Scissors against the computer and B. Submit a PDF with a flow chart of the program The program should work as follows: 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number 1, then computer has chosen rock. If the number is 2 then the computer has chosen paper. If the number is 3, then the computer has chosen scissors (Don't display the computer's choice yet). 2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can usa a menu if you prefer) 3. The computer's choice is displayed. 4. A winner is selected according to the followign rules: If one player chooses rock and the other player chooses scissors then rock wins. (The rock smashes the scissors). If one player chooses scissors and the other player chooses paper, then sciossrs wins. (Scissors cuts paper). If one player chooses paper and the other player chooses…Write a C++ program that reads a file consisting of students’ test scores in the range 0 – 200. It should then determine the number of students having scores in each of the following ranges: 0 – 24, 25 – 49, 50 – 74, 75 – 99, 100 – 124, 125 – 149, 150 – 174, and 175 – 200. Output the score ranges and the number of students. Run your program with the following input data from file: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 157, 189. The program should have the following functions: • void readData – to read all input values from file. This function has three parameters: the input file variable, an array, and the size. void print – to determine and display the score ranges and the number of students. int main – to call both readData and print functions. Marks are allocated as follows: main function and prototypes void readData void printData indentationc++ programing Sample Testcase 0: Input: (-2) Output: Negative input Sample Testcase 1: Input: 0 Output: Zero size matrix Sample Testcase 2: Input 3 2 Output: Wrong entry Sample Testcase 3: Input 3 0 1 2 3 4 5 6 7 8 9 Output: 11 Sample Testcase 4: Input 3 1 1 2 3 4 5 6 7 8 9 Output: 19 #include <iostream> #include <cmath> using namespace std; int main() { int s, region; cin>>s>>region; int MAT[s][s]; //Start your code Here return 0; }
- Create a program using C++ that satisfies the following requirements: SAMPLE ATTACHED Develop a function called "randomPairsGenerator" that generates and displays pairs of random numbers, with a maximum of 5 pairs per line. Within this function, use a loop to create 20 pairs of random numbers:1) The first number in each pair should be within the range of 1 to 50, inclusive.2) The second number in each pair should be within the range of 51 to 100, inclusive. For each pair, print the two numbers side by side, separated by a space. Separate each pair with a comma. After every 5 pairs, start a new line. After all 20 pairs have been generated, display the total count of pairs in which the sum of the two numbers is divisible by 7.In C++ Programming, write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Social Security Tax: 5.75% Medicare/Medicaid Tax: 2.75% Pension Plan: 5% Health Insurance: $75.00 Your program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your output to have two decimal places. A sample output follows: Bill Robinson Gross Amount: .......................... $3575.00 Federal Tax: ................................ $ 536.25 State Tax: .....................................$ 125.13 Social Security Tax: ................... $ 205.56 Medicare/Medicaid Tax: ......... $ 98.31 Pension Plan: .............................. $ 178.75 Health Insurance: .......................$ 75.00 Net Pay: ....................................... $2356.00 NOTE: The first column is left-justified, and the right column is…It is necessary to specify the I stream's functionalities.