Write a C++ function with the following signature: int sumArray(int arr[], int n) that returns the sum of passed array arr where n is the length of the array. You can assume that n is always greater than 0 and less than 20. Submit a file named Q2-1.cpp that contains only your function (don't include a main function). Make sure to test your program before submission.
Q: Does it make a difference if a Master File has information that will be maintained for an extended…
A: The term "master file" refers to any file containing information designed to be preserved for an…
Q: What is the difference between a computer's architecture and structure?
A: Introduction: Computer architecture and organisational structure: Architecture of computers: It…
Q: Use JFLAP to draw the state diagram of a Turing Machine that recognizes the language { ?n?2??3? |…
A: Design Principle: Given the language as L = {anb2nc3n | n>=0} First check for 1 a ( n times) For…
Q: It is essential to define and explain the SQL Environment's structure and components.
A: The solution to the given question is: COMPONENTS OF SQL ENVIRONMENT Data Definition Language A…
Q: 8.Which component is located within the data tier of a multi-tier web application? Select one:…
A: Below I have provided the solution of the given question
Q: d to create this JS along html
A: Hypertext Markup language (HTML). For answering this question I am using table tags to make this…
Q: What capabilities does a desktop operating system possess?
A: Desktop Operating System: The environment through which a user manages a personal computer is called…
Q: In terms of descriptions, what is the difference between a file's logical and physical descriptions
A: Introduction Physical: According to experts, physical fitness is "the ability to carry out daily…
Q: What distinguishes computer architecture from computer management?
A: Here below i write about both one then write what is distinguishes computer architecture .…
Q: Why did you choose Microsoft Excel above other alternatives?
A: The Answer is;- Programming accounting pages in Microsoft Excel has become a standard component of…
Q: The following items are classified: Microcontrollers a small computer Miniature computer Computer…
A: Given: Micro controllers are little computers that enable users to store data and carry out…
Q: What distinguishes finite from nondeterministic automata?
A: NFA is also known as non deterministic finite automata.
Q: Explain the relevance of computer science concepts such as data security, networking, and databases…
A: The answer of this question is as follows:
Q: vDefine distributed systems and their constituent parts. Provide an illustration of the significant…
A: illustration Definition: 1: An example that provides as a starting point. a: a drawing or diagram…
Q: What are the advantages of employing a MySQL database in comparison to other database management…
A: Introduction: Relational databases are generally stored, handled, and managed using MySQL, an…
Q: host addresses possible in the network and possible range of he
A: The answer is
Q: What are the benefits distributed systems can offer?
A: Answer is
Q: What is the relationship between the MAR and the MDR? Are the Little Man Computer and other gadgets…
A: TWO TYPES OF REGISTRATION EXIST: MEMORY IS LINKED TO MAR AND MDR BECAUSE A SPECIFIC MEMORY BLOCK'S…
Q: Write a program in C++ that finds the count of a number in a list of integers from a text file named…
A: Here is the c++ code: See below step for code.
Q: Have you already written about the Internet? Which Internet infrastructure components are the most…
A: These are the four major components of an Internet infrastructure are:- Hardware: Hardware is one…
Q: Create a program using recursion.The java program prompts the user to input string minimum of 4…
A: The JAVA Code is given below with the code and output screenshot. It is done using recursion Happy…
Q: Why, despite its simplicity and beauty, is a file so powerful?
A: A file is an object on a computer that stores data, information, settings or commands used with a…
Q: This inquiry focuses on the impact of natural catastrophes on national security.
A: Introduction Natural disasters include events that happen everywhere on Earth, frequently without…
Q: 1. Which of the following does not form part of a multi-tier web application Select one: a.Client…
A: Below I have provided the solution of the given question
Q: What is the genesis of avalanches? How can one generate the avalanche effect in the current block…
A: Start:Below is a full description of the avalanche effect.Assault:The significance of avalanche in…
Q: What is the purpose of a Master file, which is primarily a data repository?
A: The answer is given in the below step
Q: The following items are classified: Microcontrollers a small computer Miniature computer Computer…
A: Microcontrollers a small computer A microcontroller (MCU for microcontroller unit) is a small…
Q: In other words, what does "Internet 2" really imply and how does it function?
A: An enormous number of linked networks make up the global computer network known as the Internet. As…
Q: 3. Which statement is true concerning Dynamic Application Security Testing (DAST)? Select one:…
A: A web application will be crawled by DAST tools, looking for vulnerabilities such as SQL injection…
Q: Static members sound as they appear. Examine distinct traits. C++ is a programming language.
A: Describe static members If a user declares a class member as static, just one instance of that…
Q: In other words, what does "Internet 2" really imply and how does it function?
A: In this question we need to explain what is Internet 2 and how does it actually work.
Q: Data security recommendations for financial firms.
A: Financial firms can do the lot of financial transactions with the different platforms and different…
Q: Discuss tomorrow in terms of an algorithm. It can be the same step-by-step method outlined here. Try…
A: CODE : x = input('Will you like to come to the party with us tomorrow ? (yes or no) :')if x=='yes':…
Q: discuss hiw an application handles requests in classic mode in II7. Give an example to support your…
A: IIS 7 is the latest version of Microsoft's Internet Information Services (IIS) server.
Q: Explain the differences between system software and application software. Among other things,…
A: Windows Mac and Linux: First up is Windows, the most popular operating system, especially in the…
Q: def ALGORITHM (text): processor := list containing '0' i = 1 while i 1 t2 = processor.pop() c =…
A: In this question, it is asked to calculate the time complexity of the given code segment Given: All…
Q: For short messages, assaults against ciphers are more difficult since they are more difficult to…
A: A cypher is a series of steps for encoding and decoding information in the field of cryptology,…
Q: What is the specific distinction between computer architecture and computer organization?
A: Specific distinction between computer architecture and computer organization - Computer architecture…
Q: Is it feasible to examine how various businesses use information systems?
A: Introduction: To function effectively and raise the company's overall performance, they must plan…
Q: Explain the differences between system software and application software. Among other things,…
A: The difference between system software and application software is 1) The application software is…
Q: Does expressing a weighted graph using adjacency lists have any drawbacks?
A:
Q: What makes the notion of a file so captivating, despite the fact that it is simple and aesthetically…
A: Introduction: You need a file format in order to store data on your computer. It explains the use of…
Q: are of? Describe each of the three given circumstances. What are some unique Excel applications?
A: Microsoft Excel is the earliest spreadsheet programmed that is still widely used today, which can be…
Q: Write a Java program that asks the user to enter 2 integer numbers. Your program using the…
A: Operators In Java: Any programming language's building blocks are its operators, and Java is no…
Q: Should system users be involved in system development activities, or should systems professionals…
A: System Development: System development is the process by which IT professionals design, program,…
Q: Describe briefly the increasingly prevalent nonvolatile solid-state memory technology.
A: The memory in question is solid-state and non-volatile. memory that is impervious to tampering.…
Q: Using specific examples, explain the primary differences between a two-tier and a three-tier…
A: a two-tier vs a three-tier application architecture differentiation. Database Architecture with Two…
Q: Which of the following statements on Turing machine models can be correct: (1). A Turing machine can…
A: A Turing machine is a theoretical computational model that performs calculations by perusing and…
Q: What is the specific distinction between computer architecture and computer organization?
A: Computer Architecture: Computer architecture refers to how a computer system's parts are organised…
Q: What is the distinction between architect and organization in computer terms?
A: A computer is a machine or device that performs processes calculations and operations based on…
Step by step
Solved in 4 steps with 2 images
- Write a C++ program that does the following: Read and input file xycoordinates.txt containing the following: PersonName X Y where the coordinates of PersonName is provided as X, Y in a 100 by 100 room Use square root function in cmath sqrt() to calculate the shortest distance between two coordinates (Remember the Pythagorean Theorem?) Write a program tracing.cpp that should load the xycoordinates.txt file into an 3 parallel arrays consisting of person[ ], x[ ], y[ ]. You can use either subscript notation or pointer arithmetic to access the data in the arrays. Optionally, you can use an struct array if you want to read-ahead about the next module. (10 points bonus). The program should use the arrays to calculate the distance between every pair in the room. The program should use a function call that returns the distance. If the distance is less than 6 feet, report the case giving the names and the calculated distance in a cout statement: Example: Apple and Barry is 4 feet apart…Write a C++ program that does the following: Read and input file xycoordinates.txt containing the following: PersonName X Y where the coordinates of PersonName is provided as X, Y in a 100 by 100 room Use square root function in cmath sqrt() to calculate the shortest distance between two coordinates (Remember the Pythagorean Theorem?) Write a program tracing.cpp that should load the xycoordinates.txt file into an 3 parallel arrays consisting of person[ ], x[ ], y[ ]. You can use either subscript notation or pointer arithmetic to access the data in the arrays. Optionally, you can use an struct array if you want to read-ahead about the next module. (10 points bonus). The program should use the arrays to calculate the distance between every pair in the room. The program should use a function call that returns the distance. If the distance is less than 6 feet, report the case giving the names and the calculated distance in a cout statement: Example: Apple and Barry is 4 feet apart…Write a C program that reads an unspecified number of integers from a file called nums.txt ( up to a maximum of 100 numbers ) and stores those numbers in an array. Your program should then print to the screen the number with the maximum sum of divisors as well as its position in the array in main. Your program should include and use the following two functions: 1. function sum_of_divs which takes any integer and returns the sum of its divisors ( e.g. for the number 20 the function should return the value 42 which is 1+2+4+5+10+20). 2. function max_sum_and_pos which takes the array of integers as input and returns both the number (not the sum) with the maximum sum of divisors as well as its position in the array. Example of a Sample Run : Assume that the file nums.txt has the following 6 numbers ( nums.txt can have up to a 100 numbers which means your array size should be defined as 100): 53 61 40 83 49 44 your program should print the following to the screen: The number with max sum of…
- Write a program in C++ that reads a list of 10 names from a file and stores them in an array. Next, allow the user to search for the number of instances of a name. The program should prompt a user for a name and output the total number of instances of that name entered to the screen and to a file (see example input and output below). It should continue to prompt for names until the word done is typed in. For this lab, use the string data type as opposed to char to store the names (i.e. don’t use c-strings). INPUT FILEJoe Sally Joe Sue Sally Adam Joe Adam Adam Joe OUTPUT FILE (There should be 10 spaces between the columns) 8. NAME INSTANCES 9. ---- --------- 10. Joe 4 11. Sally 2 12. Adam 3 13. Sue 1 14. John - Expected outputWrite a program in C++ that reads a list of 10 names from a file and stores them in an array. Next, allow the user to search for the number of instances of a name. The program should prompt a user for a name and output the total number of instances of that name entered to the screen and to a file (see example input and output below). It should continue to prompt for names until the word done is typed in. For this lab, use the string data type as opposed to char to store the names (i.e. don’t use c-strings). Input FileJoeSallyJoeSueSallyAdamJoeAdamAdamJoe Output File (be sure to output the class heading to the output file) (There should be 10 spaces between the columns) 8. NAME INSTANCES9. ---- --------- 10. Joe 411. Sally 212. Adam 313. Sue 114. John - Expected output in image belowWrite a C function arrDivN() that takes one array of integers and three integer numbers (say ar, n1, n2, n3) as parameters, it stores into the array the numbers divisible by n3 between n1 and n2 (both inclusive) and returns the count of the numbers stored in the array. Prototype: int arrDivN(int ar[], int n1, int n2, int n3);
- Given a file of unsorted words with mixed case: read the entries in the file and sort those words lexicographically. The program (in c++) should then prompt the user for an index, and display the word at that index. Since you must store the entire list in an array, you will need to know the length. The "List of 1000 Mixed Case Words" contains 1000 words. You are guaranteed that the words in the array are unique, so you don't have to worry about the order of, say, "bat" and "Bat."Write a c++ function reportDuplicates() that takes a two dimensional integer array as a parameter and identifies the duplicate valuesin the array. The function then reports these to user. Sample input and corresponding output:How many rows? 5How many columns? 2Let’s populate the array:1 86 97 312 522 4Thank you, there are no duplicate elements!How many rows? 3How many columns? 4Let’s populate the array:3 7 5 76 9 7 38 5 12 6Thank you, 3 appears 2 times, 7 appears 3 times, 5 appears 2 times,and 6 appears 2 times.Write a c++ code that swaps two input integers using pointers. a. In the main function. b. By creating a new function called swap. Write a c++ code that takes from the user the number of integers that they want to input, then takes the integers as input into a dynamic array and outputs the average of the numbers in the array. Write a c++ program that takes from the user an integer and creates a dynamic array with the size of that integer, then calls a function called setVal that sets each element as 2 to the power of index (the powers of 2), then a function called disp that displays the elements comma separated. For example, if the user enters 5, the out should be: 1,2,4,8,16
- Given the code segment below, what should be the data type of a in the function prototype of func(), given the call from main()? Do NOT use array indexing notation. If it is an invalid access, write INVALID (in all capital letters) as your answer. void func( ______ a);int main(){ double aData[15];func(*aData + 15);return 0;}Write a C program that creates and array of 1000 random integers with values ranging from 0 to 99. It reads aninteger from the command line arguments, searches for this integer in the array, and prints either “Numberfound!” or “Number not found…”The code to create an array of random numbers:int data[1000];int i;for(i = 0; i < 1000; i++)data[i] = rand() % 100; You will also need to use the atoi function to get the integer value of the string read from the command line.In order to speed up the search, the program creates a child process with which it will communicate using apipe. The two processes proceed as follows:The parent:1. Searches for num in the first half of the array [0, 500[2. If it is found, it prints "Number found!" and terminates.3. Otherwise, it reads the result of the child from the pipe, if it is a negative number, it prints "Number notfound...". Otherwise, it prints "Number found!".The child:1. Searches for…Write a function that takes two inputs: - An array of doubles named data. - A scalar double (single number) named threshold. Your function should have one output: - A double named below. The value of below should be the number of elements in data that have a value less than threshold. Please use MATLAB