Example/Write the code to draw the Sig X(t)=3e^0.4t and -2
Q: Write a function that checks whether all elements in the indicated column are the same.
A: We have to check whether all elements in a column have same values or not So, you can check equality…
Q: PROGRAM TO CHECK A GIVEN ARRAY OF INTEGERS AND RETURN TRUE IF THE SPECIFIED NUMBER OF SAME ELEMENTS…
A: We have to return true if given number k appears same number of times at start and end of array in…
Q: below is the code I need help with answering the questions in the image//
A: Here is the explanation about the scope of the variables:
Q: Write a C++ program to declare the array B={1, -11, 0, 20, -1} and pass it to the function max_min…
A: //return statements will not return multiple value but we can overcome this problem by using call by…
Q: Given a vector of integers named vec provided to you below, find the sum of the product of all pairs…
A: C++ HISTORY:- The history of the C++ programming language began with the development of C++ by…
Q: • All braces must be closed. Braces come in pairs of the form (), () and []. The left brace opens…
A: open_bracket = ["[","{","("]closed_bracket = ["]","}",")"]def fun(a): n = [] #declare a stack for x…
Q: Write code so that you take three integers a,b, and c display a^b - c.
A: Pseudocode:- a = get user input b = get user input c = get user input Result = compute a^b - c…
Q: Q1\A) A paint company is trying to recycle unpopular paint colours by mixing them together to create…
A: The solution is given below:
Q: 1- If A=[1,2; 3,4], and B=A*2; then A*B=? O [14, 30; 28,44] O [14, 30,20,44] O [14, 20; 30,44] O…
A: Answer in step 2
Q: Define a function named print_inverted_triangle_pattern (number_of_rows) which takes an integer as a…
A: #first lets understand the pattern#let n=5 //number of rows#1st row has 5 1's followed by 0(0*2)…
Q: Q2) Write a function that calculates and displays the sum of on-diagonal elements and the sum of…
A: C++ function for above : void Diagonal(int A[][3], int &Ondiag, int &lowTri, int size){…
Q: In C++Take the following code but -for the first option, change it so that instead of the middle…
A: Updated code in cpp: the changed code are in bold letters…
Q: 1. Draw a dfa of L/L2 for L1 {a"b" : n 2 1, m 0}U{ba} L2 {b"aa : m 2 0}
A: DFA is also known as deterministic finite automata.
Q: if v=[15,8,-6]; u=[3,-2,6]; then u.*v = 45-16-36 -45 16 -36 O45-16 36 None of the above if A=[3 1;4…
A: Here in this question we have given two questions.in first one we have to find dot of two vector.and…
Q: 3. Solve the following operation: b = 1 a = [1 2] a) 7+a.^a*b' b) *0*6+a<=([a;a].*b)
A: Code: a=[1 2];b=[3 4;5 6]; % a % b' returns transpose of b% a.^a raises each element of a % to the…
Q: What is the value of the variable ss after the following code is executed? int x[ 7 ] =…
A: In the given program, an array of size 7 is defined which contains 6 elements. Then, a variable ss…
Q: Write a function that checks whether the diagonal joining the upper-left and the lower-right corners…
A: Required:
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: we can access global variable if there is a local variable through EXTERN and scope resolution . The…
Q: 6. {w \ w doesn't contain exactly two a's}.
A: DFA stands for Design a Finite Automata. A language L is accepted by a DFA < Q , , q0 , , A >…
Q: If you have a square matrix (N X N) and N is an even number like (N=8), we may divide the matrix…
A: If you have a square matrix (N X N) and N is an even number like (N=8), we may divide the matrixinto…
Q: Suppose you are given an array of integers. You want to insert a number x to the array and rearrange…
A: Basically, an input array is taken and an element has to be inserted into it, in such a way that all…
Q: Q1: How many total calls to malloc are made during createEmployee (including readEmployee and…
A: Hi there, please find your solution below, I hope you would find my solution useful and helpful,…
Q: /below is the code I need help with answering the questions in the image// #include…
A: Q3: Many people put the SSN in a char[9] field (1 kind of encouraged it). Is that big enough to hold…
Q: EXII simplify the f llowing exPression 8- Fs{(,3,5,7,9)+ x C6,12,13) 13=1101
A: The given expression is Sum of Products. We have to simply the given expression.
Q: 10 t = 0:.01:40*pi; 11 12 f = [e.^cos (t) - (2*cos (4*t))- ((sin (t/12)).^5)]; 13 Qfor s=0.1 14 E 15…
A: The problem is based on plotting graphs in matlab.
Q: Given the definition below: float train[10] = {4.4, 6.1, 3.9, 8.6, 5.0}; float *pTrain = train;…
A:
Q: /*Line 1:*/ doublevalues[6] = {10, 20, 30, 40, 50, 60}; /*Line 2:*/ double* yalptr= values; /*Line…
A: NOTE: - There is error on line 1 the way of declaring and initializing an array is wrong.…
Q: 2- Let a = [123; 2 3 4; 12 5], b = [213 ; 50-2; 2 3 -1] prod = a* b. What is the value of prod?
A: This question is answered using Matlab programming language.
Q: KLold T T=T+(K-2)*L T=T-10 T=0 T=T-10 K= 4, 8, 2 L=4, 3, -1 T=T+(K-2)*L
A: Given graph contains lines of codes and the variables present in this are T, K and L. The initial…
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: Here we have given the answer differentiating global and local variables in c. and how they can be…
Q: Q2: If the employee's name is Joe Smith, how much total memory is allocated for the structure and…
A: As per the guidelines we have given answer for the first three question that are Q2, Q3 and Q4. you…
Q: Let A %3D (с, n, b), В%3 (х, у) and C %3 (0, 1). Find a) AXBXC b) СХВХА с) ВХСХ
A: The cartesian product of 3 sets produces another set such that, the new set has tuples of 3 elements…
Q: C++ Code You are given a power sequence of N number k; let us show i-th of this power by kªi. You…
A: Algorithm - In this problem, we are provided with the power sequence of N number k; Logic -…
Q: Jump to level 1 Add each element in origList with the corresponding value in offsetAmount. Print…
A: We can add corresponding value for each origList and offsetAmount and then can print it.
Q: This program will calculate the area of 6 rectangles. Create a structure called Area with values…
A: All values are displayed upto 2 decimal
Q: What are the final values of x and y in this code
A: Q: Output of the given code
Q: [b~ v (bad)]~
A: Please find the truth table in the following steps.
Q: //below is the code I need help with answering the questions in the image// #include…
A: #include <stdio.h> #include <stdlib.h> typedef struct{ char name[30]; int id;…
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: In the current code there is not initialized global employee variable But if there was a global…
Q: array1]-(1, 2, 3, 4, 5); array2]- (3, 5, 2, 10, 16, 1, 10, 15); Write a code to display the…
A: Given :
Step by step
Solved in 2 steps with 2 images
- C++//below is the code I need help with answering the questions in the image// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees *e) { printf("%s",…//below is the code I need help with answering the questions in the image// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees *e) { printf("%s",…
- GIFT MASTER A delivery guy can deliver maximum 10 orders in a day, write a C++ program to find the maximum profit deliver guy can earn in a day if the profit he can earn on the orders is stored in the array given below. {28, 52, 67, 33, 25, 40, 34, 20, 50, 19, 44, 30, 38, 45, 66, 15, 56, 39, 20, 27} A maximum of 10 orders can be delivered in a day.C++ 2D ARRAY, Continue this codes and change the array to seat[6][6]. Include a loop that asks the user if he wants to try again or no. If the user enters the reserved seat again then display "this seat is taken already". Upon trying again, the reserved seat displayed as (X) must be displayed. My Code: #include <iostream> using namespace std; int main() { cout << "Bus Seats:\n"; cout << "* A B C D\n" << "1 * * * *\n" << "2 * * * *\n" << "3 * * * *\n" << "4 * * * *\n"; char seat[5][5]; int row, column; char col; cout << "Enter the row of your selected seat: "; cin >> row; cout << "Enter the column of your selected seat: "; cin >> col; for(int i=0; i<5; i++){ for(int j=0; j<5; j++){ if(i==0){ switch (j) { case 0: seat[i][j]='*'; break; case 1: seat[i][j]='A'; break; case 2: seat[i][j]='B'; break; case 3: seat[i][j]='C'; break; case 4: seat[i][j]='D'; break; } } else if (j==0) { switch(i) { case 1: seat[i][j]='1';…//below is the code I need help with answering the questions in the image// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees *e) { printf("%s",…
- C++ Coding: Arrays Implement a 4x4 two-dimensional array of integers. Use a nested loop to populate the array with values 20 to 35 inclusive. Use a nested loop to output the array as a grid. Use a single loop to output all elements in the second row. Use a single loop to output all elements in the third column. Use a single loop to output all elements in the first diagonal (r==c). Use a single loop to output all elements in the opposing diagonal. Example Output: 20 21 22 2324 25 26 2728 29 30 3132 33 34 35Row 2: 24 25 26 27Col 3: 22 26 30 34Diagonal 1: 20 25 30 35Diagonal 2: 23 26 29 32#include <stdio.h>#include <limits.h> int findMissingUtil(int arr[], int low, int high, int diff){ if (high <= low)return INT_MAX; int mid = low + (high - low)/2; if (arr[mid+1] - arr[mid] != diff)return (arr[mid] + diff); if (mid > 0 && arr[mid] - arr[mid-1] != diff)return (arr[mid-1] + diff); if (arr[mid] == arr[0] + mid*diff)return findMissingUtil(arr, mid+1, high, diff); return findMissingUtil(arr, low, mid-1, diff);} int findMissing(int arr[], int n){int diff = (arr[n-1] - arr[0])/n; return findMissingUtil(arr, 0, n-1,diff);} int main(){int arr[] = {120001, 120013, 120025, 120037, 120049, 120061,120085,120097,120109,120121};int n = sizeof(arr)/sizeof(arr[0]);printf("The missing element is %d", findMissing(arr, n));return 0;} ______________________________________________________________________________ Convert the code above into Pseudocode