102 Jump to level 1 Compute: z 1 include 4 include 5 using namespoce std3; 7 int main() ( double x; double y; double z; 10 11 12 13 cin >> X; cin >> yi 14 15 16 17 18 Z sart/ Your code goes here / cout e fixed « setprecision(2): // This will output only 2 decimol places. cout « z
Q: #include #define FAIL_VAL -99999 #define SUCCESS_VAL 99999 #define MAX_USER 20 #define MAX_LEN 200…
A: Since you were asked only loginUser() function, I have implemented only that function. Algorithm:…
Q: • Please simulate a Best Fit memory block allocation algorithm. • Your program runs without command…
A: Code :-
Q: Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing…
A: Sliding means returning a part of list. Here in option b, list[:-2] means return the entire list…
Q: Course Title : Operating System Question : Paging is a memory management scheme that eliminates the…
A: (1) First error is space between the int and pos. I have corrected it in line 11. (2) Second error…
Q: Create a queue, size of queue will be dependent on the user. Insert the numbers in the queue till…
A: Queue: It is a linear data structure in which operations are carried out in a certain order, First…
Q: prganization is granted a block of classiess addresses with the starting address 199.34.32.0/27 How…
A: The given IP address is 199.34.32.0/27 Here the total # of network+subnet bits is 27.
Q: ng loilowing codeasSume we rave a static stack of Size 57 int main() staticstack int s1; 9 s1.push(…
A: We are given a code and we are going to find its output. Please refer to image for the solution.
Q: Write a Makefile line that will cause a library called libnetwork.so to be linked to every…
A: Find the answers for the questions in Step 2.
Q: Assignment2: Analyse the case study given in chapter 4 stack Answer the following questions from the…
A: Import statements are:-
Q: c++ this code is giving error maked it with the help of youtube video if someone can help on this…
A: The problem, with your code is, you have use keyword not as a variable in this program which is not…
Q: ssume we are writing a tool which needs a word completion feature for English. We have a dictionary…
A: Below is the python code and its approach to read the words from a CSV file and then search for a…
Q: suppose that y=2, a=3 , b=4, c=5. the value of y after execution the following code will be: load a…
A:
Q: mplement the game of tic-tac-toe in Haskell. Your implementation should run entirely from a…
A: Solution:-- 1)The given problem in the question is to implement the game of the tic-tac-toe in…
Q: 1) Write two ROS programs to implement two nodes. The first node should incorporate a subscriber and…
A: HTML program Creating a table with 2 rows and each having 2 columns. The data for each cell is as…
Q: nterruptions are occurrences that cause the usual flow of execution to be interrupted. Give five…
A: Introduction: Although interrupts have precedence over other signals, there are numerous types of…
Q: Problem Statement: Write a program which should create a weighted graph of the values entered by the…
A: DFS code //here we using stack #include<stdio.h> // implementation of dfs to find all the…
Q: I get an error when I run this c++ code. Below I have attached the code, prompt and the error I…
A: The following statement was missing in that else part – cout << "You are " << distance…
Q: lude: 1) Executable file 2) Source code The programming language: C++ 4、Dancing Partner…
A:
Q: A Sudoku puzzle uses a 9 × 9 grid in which each column and row, as well as each of the nine 3 × 3…
A: The program is as follows:
Q: Write the C++ code of queue which is performed multiple task which are given below and performed all…
A: Lets see the solution.
Q: Write a c++ code Shortest Job First (SJF) is a scheduling algorithm where CPU executes the shortest…
A: PROGRAM INTRODUCTION: The CPU is given to the process with the shortest burst duration first, out…
Q: First screenshot is what the assignment wants me to do and the expected output. Second screenshot is…
A: All of the steps mentioned in the question are implemented and coded with explanatory comments in…
Q: Untitled (define...) 1: Untit... 1 #lang racket 2 (define (rem_second lst) 2: boolea... 8 9 Untitled…
A: Answer:
Q: Write a program to help a user automate their to-do list. The program should do the following: Show…
A: Python is a high level object oriented programming language which is simple and easy to learn with…
Q: using java The program has to evaluate arithmetic expressions using a BST for that purpose. The…
A: Lets see the solution in the next steps
Q: public static int[] goodResize(int[] list, int newSize) { assert…
A: Lets see the solution.
Q: Project 2 Use Netbeans, to write a simple java program using the following data structures: 1.…
A: The Java program using stack by Linked List is as follows, File name: “StackUsingLinkedlist.java”…
Q: public static int[] goodResize(int[] list, int newSize) { assert…
A: Software testing checks the software whether meets all the requirements and error-free. It involves…
Q: In the c program, there are two global arrays of String namely emailArr and passArr. Implement the…
A: include<stdio.h> #define FAIL_VAL -99999#define SUCCESS_VAL 99999#define MAX_USER 20#define…
Q: Assume that Sn1 is an object of class type SingleLinkedList of Java, and it has the following code:…
A: SingleLinkedList is a kind of data structure present in java.
Q: Round-Robin (RR): Write a Java program to implement a Round-Robin (RR) scheduling algorithm with…
A: Round-Robin scheduling algorithm using Java program
Q: In the c program, there are two global arrays of String namely emailArr and passArr. Implement the…
A: The code for password and email is as follows:
Q: A singly linked circular list is a linked list where the last node in the list points to the first…
A: Summary: In this question, we need to implement the given scenario using a circular linked list.
Q: dd = 17 uu = 1 ss = 5 def pig(): global ss dd = uu + 4 ss = uu + d ss += uu return ss def ant(): dd…
A: According to the Question below the Solution:
Q: Linux general memory layout includes stack, heap, data, and code. stack memory relations stores…
A: The question is to find possible address of the variables of the code.
Q: Why is line 12 of Figure 8.18 executed by each of the children but not the parent?
A: The reason for execution of loop for each children not for parent in the program code:
Q: Find the contents of AX, BX and CX after execution of the following program MOV AX, 2468h MOV CX, AX…
A: Dear Student, MOV AX, 2468H will load value 2468 to the register AX. MOV CX, AX. will load the…
Q: Serial Number: 500 Name: D: Returns 10 and 30 in that order. E: Returns 30 and 30 in that order.…
A: Note: Answering the first question i.e. 19 as per the guidelines. Task : Given the Perl code. The…
Q: 8. 15 7 18 22 Implement a menu driven program, each menu item performs one of the following tasks:…
A: Approach: Open CSV fire using file prints. Extract the whole file dater into a char buffer array.…
Q: Priority Scheduling-preemptive
A: import java.util.*; /// Data Structure class Process { int at, bt, pri, pno; Process(int…
Q: Write a Node.js program that displays 10 random fortunes using the nostra npm module (the…
A: Install nostra module using npm in order to use it in Node.Js. npm install nostra Open command…
Q: Using Dr-Racket, what is the purpose of the number function?
A: Given function (define (number n)(local [(define (abstract int)(* int 11))] (build-list n…
Q: 5. Answer the following points. Assume the following: start data next data next data next data next…
A: The code segment given: class Test{ Node t;test();{ t = null; } ... } class Node( int data;…
Q: in c++ language please
A: Program #include <iostream> using namespace std; typedef char el_t; class Stack {…
Q: An application programmer can prevent accessing an empty queue by using the isEmpty method in an…
A: Answer is True
Q: 1. Assume you have the following singly linked List of integers and the method printLL(): Head ↓…
A: Given questions are not interlinked. As per our guidelines only one question will be answered. So,…
Q: make an algorithm / code for this part for my java calculator application. (
A: Calculator in Java with Source Code: Develop calculator in java with the help of AWT/Swing with…
Q: 1. Implement the function searchByName() that takes one String input for name. You need to show the…
A: The code for search by name and search by address first required to enter the name and address…
Q: It is desired to build three stacks containing the ff: • – Stack 1: first 10 fibonacci numbers. • –…
A: 1.first 10 fibonacci numbers. // Java program to print// first n Fibonacci Numbers class Test { //…
Q: SCREEN 11 --- 3858888 888sasassssss 8888888 888ss8888s888 8888888 888S888888s8s 20 Example Input…
A: # Pre-requisites: Imports os,sys,logging libraries and inputParser program. # Loosely based on…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Code: #include <bits/stdc++.h> using namespace std; void BUBBLE(int A[],int N){ for(int k=0;k<N-1;++k){ for(int ptr=0;ptr<N-k-1;++ptr){ if(A[ptr]>A[ptr+1]){ int temp = A[ptr]; A[ptr] = A[ptr+1]; A[ptr+1]=temp; } } }} //function to print the arrayvoid printArray(int arr[],int n){ int i; for(i=0;i<n;i++) cout<<arr[i]<<" "; cout<<endl;} //driver function to test the modulesint main(){ int arr[] ={15,17,5,3,25,66,14,7,59,100}; int n=sizeof(arr)/sizeof(arr[0]); cout<<"\nOriginal array: "; printArray(arr,n); cout<<"\n\nOutput of Bubble sort are shown below:\n"; BUBBLE(arr,n); printArray(arr, n); return 0;} Q: Remove the Function from the above codemain.cpp:4:17: error: 'string' has not been declared 4 | void KMPSearch(string pat, string txt) main.cpp:4:29: error: string' has not been declared 4 | void KMPSearch(string pat, string txt) Aununun main.cpp:31:25: error: string' has not been declared 31 | void computelPSArray(string pat, int M, int[] lps) main.cpp:31:50: error: expected or . before lps' 31 | void computeLlPSArray(string pat, int M, int[] lps) main.cpp:55:8: error: expected :' before 'static' 55 | public static void Main() main.cpp:61:2: error: expected ;' after class definition 61 | } | main.cpp: In member function 'void GFG::KMPSearch(int, int)': main.cpp:6:15: error: request for member Length' in 'pat', which is of non-class type 'int' 6 | int M = pat.Length; main.cpp:7:15: error: request for member Length' in txt’, which is of non-class type 'int' int N = txt.Length; main.cpp:8:6: warning: structured bindings only available with -std3c++17' or (-std=gnu++17' 8 | int[] lps new int[M];12.14 Zylab 3 - Single Procedure Call Given an array of at least one integer, write a program to create a new array with elements equal to the power of each element in the original array raised to the index, i.e., P[i] = A[i]^i. For this, write two functions that will be called in main function independently. ● power inputs: element (A[i]) and index (1) • task: returns the value of element raised to index (A[i]^i). } O • newElement inputs: base address of new array P (*P), current size of P (variable k) and the new element (A[i]^i) o task: add the new element at the end. o This function does not return any value (void). O Following is a sample C code to perform the required task. You may modify the code for the functions, but the task performed should not be changed. int main() { // Variable Declaration int *A, *P; int n, k; int pow; // Task of main function P[0] 1; for (int j = k = j; pow // Base addresses of A and P // Lengths of arrays A and B // Return value from power function }…
- Please convert the code in C language #include <bits/stdc++.h>using namespace std; class Node{ public: int data; //value Node *left; //pointer to left child Node *right; //pointer to right child}; // creating new nodeNode* newnode(int data) { Node* node = (Node*)malloc(sizeof(Node)); node->data = data; node->left = NULL; node->right = NULL; return(node); } Node* LCA(Node *root, int n1, int n2){while(true){ if((root->data>=n1 && root->data<=n2)||(root->data<=n1 && root->data>=n2)) return root; if(n1<root->data) root=root->left; else root=root->right; }} int main(){ cout<<"tree is built as per 1st example\n"; Node *root=newnode(8); root->left= newnode(4); root->right= newnode(10); root->right->right=newnode(11); root->right->left=newnode(9); root->left->left=newnode(3);…#include <bits/stdc++.h>using namespace std;#define numVl 3 struct thNde { thNde* parent; int mat[numVl][numVl]; int x, y; int cost; int level;}; int thPrntMtrx(int mat[numVl][numVl]) { for (int q = 0; q < numVl; q++) { for (int j = 0; j < numVl; j++) printf("%d ", mat[q][j]); printf("\n"); }} thNde* newNode(int mat[numVl][numVl], int x, int y, int newX, int newY, int level, thNde* parent) { thNde* node = new thNde; node->parent = parent; memcpy(node->mat, mat, sizeof node->mat); swap(node->mat[x][y], node->mat[newX][newY]); node->cost = INT_MAX; node->level = level; node->x = newX; node->y = newY; return node;} int row[] = { 1, 0, -1, 0 };int col[] = { 0, -1, 0, 1 }; int calculateCost(int starting[numVl][numVl], int resltng[numVl][numVl]) { int count = 0; for (int q = 0; q < numVl; q++) for (int j = 0; j < numVl; j++) if (starting[q][j] && starting[q][j] != resltng[q][j]) count++; return count;} int isSafe(int x, int y) {…#include<bits/stdc++.h>#include<math.h>using namespace std; class TotalResistance{double series_res,parallel_res,sp_res;public:TotalResistance(){series_res=parallel_res=sp_res=0;}void seriesResistance(double resistance[],int n);void parallelResistance(double resistance[],int n);void spResistance(double resistance[],int n);};void TotalResistance::seriesResistance(double resistance[],int n){for(int i=0;i<n;i++)series_res += resistance[i];cout<<"Total Resistance in series is: "<<series_res<<endl;}void TotalResistance::parallelResistance(double resistance[],int n){double temp=0;for(int i=0;i<n;i++)temp += (1/resistance[i]);parallel_res = 1/temp;cout<<"Total Resistance in parallel is: "<<parallel_res<<endl;}void TotalResistance::spResistance(double resistance[],int n){for(int i=0;i<n;i++)series_res += resistance[i];double temp=0;for(int i=0;i<n;i++)temp += (1/resistance[i]);parallel_res = 1/temp;cout<<"Total Resistance in…
- #include<bits/stdc++.h>#include<math.h>using namespace std; class TotalResistance{double series_res,parallel_res,sp_res;public:TotalResistance(){series_res=parallel_res=sp_res=0;}void seriesResistance(double resistance[],int n);void parallelResistance(double resistance[],int n);void spResistance(double resistance[],int n);};void TotalResistance::seriesResistance(double resistance[],int n){for(int i=0;i<n;i++)series_res += resistance[i];cout<<"Total Resistance in series is: "<<series_res<<endl;}void TotalResistance::parallelResistance(double resistance[],int n){double temp=0;for(int i=0;i<n;i++)temp += (1/resistance[i]);parallel_res = 1/temp;cout<<"Total Resistance in parallel is: "<<parallel_res<<endl;}void TotalResistance::spResistance(double resistance[],int n){for(int i=0;i<n;i++)series_res += resistance[i];double temp=0;for(int i=0;i<n;i++)temp += (1/resistance[i]);parallel_res = 1/temp;cout<<"Total Resistance in…Dijkstra's algorithm Weight Class Implementationlanguage : C++ Note : Skelton Files Provided Please check the linksproject Details:https://ece.uwaterloo.ca/~dwharder/aads/Projects/5/Dijkstra/ Files:https://ece.uwaterloo.ca/~dwharder/aads/Projects/5/Dijkstra/src/ Please provide clear and complete solution for thumps up.İN C LANGUAGE Typedef struct Complex { Double a; Double b; } COMP_t, *COMP; write a function which finds and returns the position of the complex number whose absolute value is maximum in a two dimensional array of complex numbers.Absolute value of z=a+bi is |z|=(a^2+b^2)^1/2
- Find error #include<bits/stdc++.h> using namespace std; class Solution{ public: bool isPossible(vector<int>ank,int n,int mid) { int count=0; for(int i=0;i<rank.size()) { int val= (-1 + sqrt(1+(8*mid)/rank[i]))/2; count+=val; } return count>=n; } int findMinTime(int N, vector<int>&A, int L){ int low=*min_element(A.end()),high=1000000; int ans=high; while(low<=high) { int mid=low+(high)/2; if(isPossible(A,mid)) { ans=mid; high=mid; } else low=mid; } return ans; } }; int main() { int t; cin>>t; while(t--) { int l; cin >> l; vector<int>arr(l); for(int i = 0; i < l; i++){ cin >> arr[i]; } Solution ob; int ans = ob.findMin(n, *arr, l); cout…function myCompose(f,g){// TODO: return (f o g);// that is, a function that returns f(g(x)) when invoked on x.}int machineCompare1(struct machine* mac1, struct machine* mac2){ struct mac1; struct mac2; char make1[21], make2[21]; char model1[51], model2[21]; if((lap1 -> make1 == lap2 -> make2) && (lap1 -> model1 == lap2 -> model2)) return 0; else return 1;} have to create function to compare make and model of 2 machines - it's using structures - not sure if this is correct/ on the right track?