In a file named Exercise2.c write the function double sum(double (*f)(double), int start, int end); The call sum(g,i,j) should return g(i)+…+g(j). Add a main function to illustrate the use of your implementation of sum applied to sqrt from 1 to 10.
Q: Task 4: Show the token type and word generated by the lexical analyser corresponding to this Java so...
A: Here,try to Show the token type and word generated by the lexical analyzer corresponding to this jav...
Q: 1. Explain with examples linked lists and arrays with their advantages and disadvantages. When do yo...
A: A linked list is a linear data structure, in which the elements are not stored at contiguous memory ...
Q: 1a) A high-end 4K digital camera is capable of taking pictures with a resolution of 3840 x 2160 pixe...
A: In questions with many questions we must answer the first one.
Q: How do you determine if a condition should be tested at the beginning or end of a loop?
A: Introduction: A loop is a set of instructions in computer programming that is repeatedly repeated un...
Q: With explanation please 1) Find the largest positive number that can be represented in n-bit 2’s co...
A: Concept of the range integers that can be represented by n-bit 2's complement: In 2's complement for...
Q: ggplot(data = filter(starwars, species != "Hutt")) + geom_point(aes(height, mass, facet_wrap(~ gende...
A: what is missing from the blank in the following
Q: What are the functions of the & and * operators in C when it comes to pointers? Explain in depth wit...
A: Use of & operator with respect to pointers & operator - It is used to return the address of...
Q: Explain the ethical difficulties that a business manager must handle or that a firm may encounter, a...
A: Business leaders face ethical issues in accounting, inequality and discrimination, social media and ...
Q: Justify the significance of computers in scientific research.
A: In science and technology or in scientific research , computers play a critical and vital role.The c...
Q: Explain how the spiral model of the software development process can accommodate both the Waterfall ...
A: Introduction: The Spiral Model is a risk management system development life-cycle (SDLC) approach, t...
Q: Identify the major components of a computer, and briefly explain the function or the role of each co...
A: Introduction: The motherboard, often known as the system board, is the most important printed circui...
Q: Discuss one of the reasons why we need to manage our files and folders correctly on a computer.
A: Introduction: Effective file management enhances productivity and makes it easier to access importan...
Q: that processes sensitive emails from important people. What kind of things should be put into the se...
A: NOTE: ACCORDING TO COMPANY POLICY WE CAN SOLVE ONLY 1 QUESTION. YOU CAN RESUBMIT THE QUESTION AGAIN ...
Q: So, what exactly is artificial intelligence? Give at least one example & a) What are the various br...
A: Introduction: Artificial intelligence:- Artificial intelligence (AI) is the replication of human int...
Q: Refer to the snippet, what gets printed?
A: In this question, we have to answer what is the output of given code or what will it print.
Q: lem #1: Write a program that reads from the user the name of a student, the grades of two midterms a...
A: According to the Question below the solution: Output:
Q: Consider the many data access scenarios that can arise in a distributed database system.
A: Distributed databases are used for horizontal scaling, and they are designed to meet the workload re...
Q: The DNS Start of Authority record contains information about the zone, such as the administrator's c...
A: Introduction: The DNS Start of Authority record contains information about the zone, such as the adm...
Q: ( A'BC + AB' ) (BC+B'D) is a Sum of Product. ( ) True ( ) False Identity is usually used to con...
A: Solution :: Let's discuss above question first in direct then will see some basic part of it.. 1) T...
Q: Edit the class diagram to include a Teaching group- add the attributes name, room number and subject...
A:
Q: Explain what SRAM is and how it is often used.
A: INTRODUCTION: RANDOM ACCESS MEMORY: Random Access Memory (RAM) is a kind of computer data storage th...
Q: ers, w
A: given - In the case of showing a string of characters, what is the amount of separation between the...
Q: What are the drawbacks of Apple devices? What can be done to address these issues?
A: Introduction: Apple devices are very famous and quality devices that are expanding at a great rate. ...
Q: How to search horizontally a words in any matrix nxn, using "for" loops. For example, I want a metho...
A: // C++ program to check if the word// exists in the grid or not#include <bits/stdc++.h>using n...
Q: What is it about the concept of a file that is so powerful, despite its simplicity and beauty?
A: Introduction: A file format is required if you wish to save information on your computer. It covers ...
Q: What are your thoughts on data hiding, encapsulation, and binding? Elaborate.
A: Introduction: Data Hiding hides internal object details i.e data members from the outside world. It...
Q: urs, minutes, and seconds, might require you to store the time zone. Derive the class extClockType f...
A: code : #include "clockType.h" class extClockType : public clockType{ public: extCl...
Q: In CORAL LANGUAGE please and thank you:
A: Coral Programming language is an ultra-simple programming language for learning programming. The p...
Q: The physical layer is in charge of coordinating the functions required to send a bit stream via a ph...
A: Introduction: The physical layer is in charge of moving individual bits from one hop (node) to the n...
Q: estion 12 out of 12 Consider the language L {ww |weE*) over (0, 1}. Which one of the following Conte...
A: Lets see the solution in the next steps
Q: Suppose we want an “m out of n” secret sharing scheme. Mathematically what would you need to do to c...
A: Suppose we want an “m out of n” secret sharing scheme. Mathematically what would you need to do to c...
Q: Come up with an example of your own, which would be caused by missing security policies?
A: Answer below:
Q: Professor Mikka Singh of Harvard University has proposed a new atomic instruction named “Gurru”. The...
A: A semaphore is a variable that represents the number of resources available in a system at a given p...
Q: What is the function of the WORD type?
A: Below is the complete explanation about WORD and it's functions in detail.
Q: In the case of showing a string of characters, what is the amount of separation between the operatin...
A: Introduction: A character string is a collection of characters that can be handled together. A chara...
Q: Question 3: Consider the following function void testDefaultParam(int a, int b= 7, char z ="*); prot...
A: Lets see the solution in the next steps
Q: Explain network topologies.
A: Answer: Network topologies define the physical and logical arrangements of links in a network. Two o...
Q: at many prime numbers. Iterator() returns an Iterator object that will iterate through the primes, a...
A: Validate all validations with 2 first and last numbers i.e. nbr1 and nbr2. Update nbr1 again and aga...
Q: Which of the data types below does not allow duplicates? A Set B List C Vector D Stack ...
A: A list is used to store a collection of similar data items. A list allows duplicate values. So optio...
Q: Why could the time it takes to access a memory location in a shared-memory architecture vary dependi...
A: In a shared-memory architecture, all processors share the whole memory, including main memory and dr...
Q: Create a protocol based on timestamps to prevent the phantom effect.
A: In the article, two approaches for dealing with the phantom phenomenon's bemeans of locking are disc...
Q: Explain the ring topology with advantages and disadvantages
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful. Tha...
Q: Power supply and dissipation restrictions have become key design constraints for microprocessors and...
A: Introduction: The microprocessor is a type of computer processor that consists of a single integrate...
Q: What is the output of the following C++ code? nt num = 2; for (int i=0; i<5; i++){ num = num + i; co...
A: Task :- Write the output for given C++ code snippet.
Q: Explain what IP fragmentation is and why it occurs.
A: IP fragmentation is a term that is often used to describe the fragmentation of the internet, or the ...
Q: 1) Which of the following best explains why machine instruction is written in binary code? a. Mac...
A: Solution: Que 1) The correct answer is 'a' Explanation: The machine instruction are machine code pr...
Q: Discuss various operating system design methodologies and how they have been applied.
A: Introduction Discuss various operating system design methodologies and how they have been applie...
Q: A camera is filming a live video of an event. Describe which storage device in the camera is more ef...
A: Hi Dear!! Please like the answer!!
Q: 1. What is the running time of the following algorithm. for i = 1 ton for j = n to i j = j - 2 for j...
A: Given:
Q: A cell in GSM network is given 5 channels per sector. The cell is 180 degrees sectorized. calculate ...
A: Answer: 5*3*5 = 75 (i) The cell is the region given radio inclusion by one base handset station. (ii...
Computer Science
In a file named Exercise2.c write the function double sum(double (*f)(double), int start, int end); The call sum(g,i,j) should return g(i)+…+g(j). Add a main function to illustrate the use of your implementation of sum applied to sqrt from 1 to 10.
Step by step
Solved in 4 steps with 2 images
- Write in C++ When you're processing data, it’s useful to break up a text string into pieces using a delimiter. Write a function split() that takes a string, splits it at every occurrence of a delimiter, and then populates an array of strings with the split pieces, up to the provided maximum number of pieces. Function specifications: Name: split() Parameters (Your function should accept these parameters IN THIS ORDER): input_string string: The text string containing data separated by a delimiter separator char: The delimiter marking the location where the string should be split up arr string array: The array that will be used to store the input text string's individual string pieces arr_size int: The number of elements that can be stored in the array Return Value: int: The number of pieces the input text string was split into Note: No input will have delimiters in the beginning or the end of the string. (Eg: ",apple, orange" OR "apple, orange,") No input will have multiple…please code in python Assume you own a small cafeteria with very limited menu and you want to automate the orders. You have a list of menu items, a list with the price of these items. The number of elements in both lists should be the same. The program then asks the customer how many elements he wants from each item, then it should summarize the order of the customer and announce the price to pay. You can use the function from the previous exercise to check that the user enters a non-negative quantity each time.Assuming that we have:MENU_ITEMS=['karak','tea','coffee']PRICE_LIST=[2,1,5]You should get a sample run similar to that:How many karak do you want? 3How many tea do you want? 2.5Please enter valid quantity.How many tea do you want? -2Please enter valid quantity.How many tea do you want? 0How many coffee do you want? 1Your order is: - 3 karak - 0 tea - 1 coffeeYour total bill is 11 QAR.Complete the following function using pass-by-reference: void findMax(int &max, int a) which assigns value ‘a’ to ‘max’ if a > max. Write a pseudo-code then implement a program in C language to find the maximum in a sequence of numbers using this function.
- Write C++ Program to determine the max numbers between 2 arrays. For example: 6 3 1 34 7 2 11 20 Result 11 34 To resolve this problem, you should write 3 void functions: inputNumbers, testArrays and displayMaxArray. • inputNumbers: the aim of this function to read 10 numbers from the user and insert them in 2 different arrays (length of the array is 5). • testArrays: determine the max numbers between 2 arrays. displayMaxArray: print the array containing the max numbers.CS 220: Programming in C and Unix Lab#03 2. Write a function that has the following prototype: int Equalcols (int *A, int rows, int cols); The function should return the value 1 if the sums of the values in each column are the same and 0 otherwise. For example: For the matrix: 1 2 0 3 2 3 2 1 3 1 4 2 The value 1 is returned since the sums of the values in each column are the same (each column sum is equal to 6), while for the matrix: 2 4 3 2 2 3 4 1 1 35 2 The value 0 is returned since the sums of the values in each column are not equal. Write a function that takes a pointer to a two dimensional array, number of rows and number of columns as arguments. The function should read the elements of the matrix from the user and store them in the two dimensional array using pointer offset notation. Write a main program that makes use of the functions above to: Read a matrix from the user, where the number of rows and number of columns should be input from the user. The maximum dimensions of…Write C++ Program to determine the max numbers between 2 arrays. For example: 6. 1 34 7 2 0 11 20 Result 7 3 1 11 34 To resolve this problem, you should write 3 void functions: inputNumbers, testArrays and displayMaxArray. • inputNumbers: the aim of this function to read 10 numbers from the user and insert them in 2 different arrays (length of the array is 5). • testArrays: determine the max numbers between 2 arrays. • displayMaxArray: print the array containing the max numbers. Write C++ Program to check whether the Given String is a Palindrome. To resolve this problem, you should write 3 void functions: inputStrings, testPalindrome and displayNumbers. • inputStrings : the aim of this function to read 7 strings from the user and insert them in array of 7 elements. • testPalindrome: to check whether the given strings in the array are palindrome. displayPalindrome: print the palindrome strings.
- using C++ In this exercise you would be using a text input file to store a number of students first and last names, and each students scores in test1, test2, midterm, final and homeworks. Now, you get all the stored in relevant arrays. Write a function that will accept all the scores and compute the average score for each student. You can pass only one student’s information at a time while calling the function. Write another function for the grade computation. Display your results with last name, first name, average score and grade for each student. Display should be on screen as well as in an output file.2. Test Scores File: test_scores.py Write pseudocode for the main() part of a program that asks the user to enter 4 test scores between 0 and 100, then displays a JCU grade for each score and also the average test score. When you have written the pseudocode for main, implement your solution in Python code and test it with a range of meaningful data. Remember that we've done the JCU grades question before, so copy your function from that practical code file. Sample Output Score: 3 Score: 50.5 Score: 66 Score: 100 Score 3.0, which is N Score 50.5, which is P Score 66.0, which is C Score 100.0, which is HD The average score was 54.875 Enhancements When you have that working... We asked for 4 scores. Have a look at your code... did you use 4 as a numeric literal or a constant?Change 4 to 3... Did you have to change the program in more than one place?If so, then you've missed one of the things we've taught...As a strong guideline: if you need to use the same literal more than once, you…Write a program in C++ to calculate the students’ average test scores and their grades. You may assume the following input data: Johnson 85 83 77 91 76 Cooper 78 81 11 90 73 Kennedy 77 31 52 74 83 Use three parallel arrays; one array to store the students’ names, one array to store the students’ average test scores, and one array to store the students’ grades. Your program should have at least the following functions: • a function to open the file. • a function to read the data. • a function to compute the grades. • a function to sort the students’ by average test scores.
- In c++, please! Thank you! Write a void function SelectionSortDescendTrace() that takes an integer array and sorts the array into descending order. The function should use nested loops and output the array after each iteration of the outer loop, thus outputting the array N-1 times (where N is the size). Complete main() to read in a list of up to 10 positive integers (ending in -1) and then call the SelectionSortDescendTrace() function. If the input is: 20 10 30 40 -1 then the output is: 40 10 30 20 40 30 10 20 40 30 20 10 The following code is given: #include <iostream> using namespace std; // TODO: Write a void function SelectionSortDescendTrace() that takes// an integer array and the number of elements in the array as arguments,// and sorts the array into descending order.void SelectionSortDescendTrace(int numbers [], int numElements) { } int main() { int input, i = 0; int numElements = 0; int numbers [10]; // TODO: Read in a list of up to 10 positive…Write a C++ program that simulates online shopping. Declare a variable cart to be an empty Array. The program should have a loop that continues as long as the user wants to shop. Each time through the loop read in the name, price, and quantity of the item the user wants to add to the cart. After adding an item to the cart, the cart contents should be printed. After the loop print a "Please pay ...” message with the total price of the items in the cart.In C++ language For number 2 through 4 create an integer array with 100 randomly generated values between 0 and 99; pass this array into all subsequent functions. Place code in your main to call all the methods and demonstrate they work correctly. Using just the at, length, and substr string methods and the + (concatenate) operator, write a function that accepts a string s, a start position p, and a length l, and returns a subset of s with the characters starting at position p for a length of l removed. Don’t forget that strings start at position 0. Thus (“abcdefghijk”, 2, 4) returns “abghijk” Create a function that accepts the integer array described above returns the standard deviation of the values in a. The standard deviation is a statistical measure of the average distance each value in an array is from the mean. To calculate the standard deviation, you first call a second mean function that you need to write (do not use a built in gadget. Then sum the square of the difference…