Task 1: Modify the function header so it looks like this: int countElement(int inputArray[], int arraySize, int element1, int element2) The function should now be modified to return either 0, 1 or 2, according to the following: ● Return 0 if neitherelement1 nor element2 occur in inputArray. ● Return 1 if exactly one of element1 or element2 occurs at least once in inputArray. ● Return 2 if bothelement1 and element2 occur at least once in inputArray.
Q: Let's take a look at the history and current condition of nonvolatile solid-state memory.
A: Introduction: Non-volatile storage (NVS) is a large group of technologies and devices that can keep…
Q: Do you ever think about all the different ways SSH can be used? Please give me a complete list of…
A: Contamination is a possibility in the field of computer science. SSH is an acronym that stands for…
Q: Write a Elevator Simulator program in C! Without using goto statements! Simulate an…
A: The source code of the program #include <stdio.h>void elevator(int currentFloor, int…
Q: An exhaustive catalog of malware and its features is available.
A: In this question we have to understand the list of malware and the features of malware available in…
Q: The profound personal and social effects of technological advancements Explain the positive and…
A: One way that science has had a long-lasting effect on society is in the way that it affects…
Q: When talking about schools, how crucial is it that students utilize different types of technology to…
A: Introduction: Technology is the application of scientific knowledge to solve problems for people.…
Q: Can you conceive of this? When your password is changed, you will get an email from the corporate…
A: Solution: A virus assault known as phishing includes password hacking. The computer system gives the…
Q: Please provide a definition of "privacy." Below are five strategies for protecting private…
A: Introduction: The capacity of an organisation or person to decide whether data in a computer system…
Q: Although dynamic memory offers several advantages over static memory, it also has some limitations.
A: The advantages and disadvantages of dynamic and static memory are as follows:Advantages of Dynamic…
Q: Give more information about how the CSMA/CD protocol work
A: Introduction CSMA/CD is a method of media access control that was widely utilized in early Ethernet…
Q: Consider how you might use Structured English to describe processes not covered by a systems…
A: Introduction: The act of "studying a method or company to discover its objective and purposes and to…
Q: Which statements are permitted within a try block?
A: Try defines a block of the statements that may throw the exception.
Q: Take a look at Ford from the inside and outside and see what you can learn. Ford's internal…
A: The SWOT analysis of a project evaluates its advantages and disadvantages as well as opportunities…
Q: Think about what goes into your plan B and how you could make it better. What's the difference…
A: The Parts of a Contingency Strategy The Parts of a Back-Up Plan One part of a backup plan is to…
Q: The following line will generate a new instance of the Transcript class.
A: Object creation: A class is a user-defined data structure that consists of a set of fields,…
Q: Try utilizing Structured English to explain non-systems analysis processes in order to comprehend…
A: In this part, you will learn how to describe processes not linked to systems analysis using…
Q: Where do system journals go when they aren't being deleted by hand?
A: INTRODUCTION: A common kind of framework in computer systems is a hierarchical one. That indicates…
Q: Your feedback on the topic of data quality and storage is much appreciated. Studying how to spot and…
A: Given: What are your thoughts on data warehouses and data quality? Provide signs and advantages of…
Q: You may utilize the internet to research the four most popular productivity suites out there, each…
A: Applications for productivity G suite is an all-inclusive Office solution. It is one of the best…
Q: For what reason would one launch an attack aimed at causing a downgrade?
A: Introduction: The term "downgrade attack" refers to a kind of cryptographic assault that may be…
Q: The usage of virtual local area networks (VLANs) is one strategy for attaining this goal and…
A: A virtual local area networ- (VLAN) is a virtualized link that unites various network nodes and…
Q: "Distributed denial of service assaults" may be planned and executed by a single person (DDoS).…
A: A denial of service that is distributed: During a distributed denial-of-service (DDoS) attack,…
Q: When do we need to feel comfortable having a one-on-one conversation? Take a look at these five…
A: One-on-one conversations are quick but efficient for boosting engagement and communication with your…
Q: Let's imagine you're asked to validate a new password you just received from the company's email…
A: Phishing attacks are a sort of malware that compromises user credentials by tricking them into…
Q: Using each of the five primary areas or disciplines concerned with internet governance, describe the…
A: The Answer is in given below steps
Q: What are the best and worst things about cloud storage?
A: Intro A data storage technique that is based on the cloud computing architecture is known as…
Q: No restriction exists on the number of arguments permitted in a catch block.
A: Introduction: A consistent error, especially one that is syntactical in nature, is a typical type of…
Q: You are given a 0-indexed array nums of size n consisting of non-negative integers. You need to…
A: Here is the c++ code of the above problem. Given that input is nums = [1,2,2,1,1,0] output is must =…
Q: a) Explain what is meant by the term object model within the context of the initial analysis /…
A: According to the Bartleby guideline, we are supposed to answer only one question at a time. Kindly…
Q: There is no hard limit on the amount of arguments a catch block may accept.
A: Dealing with exceptions A logical error, which is distinct from a syntactical error, is a normal…
Q: Do you ever think about all the different ways SSH can be used? Please give me a complete list of…
A: Contamination is a possibility in the field of computer science. SSH is an acronym that stands for…
Q: In what ways may the use of technology alter traditional classrooms?
A: Technology refers to the tools, systems, and devices that are used to create, store, exchange, and…
Q: What is the process of a downgrade attack?
A: Downgrade attack A downgrade attack, otherwise called a variant rollback attack, is a kind of…
Q: Write an assembly subroutine program DELAY that loops 2500 times
A: Delay subroutines Delay subroutines are subroutines used in microprocessors to preserve the timings…
Q: Please provide a summary of the many technologies pertaining to nonvolatile solid-state memory that…
A: Nonvolatile memory technologies in Si-based electronics date back to the 1990s. The ferroelectric…
Q: Represent the most widely used server operating systems graphically.
A: Let's check out the answer. Despite the fact that there are many different kinds of servers, I will…
Q: Consider the situation when two students are interested in enrolling in the same class but there is…
A: We need to discuss, why can't both students get the final seat in the car if there's a database…
Q: Is it wise to have a third-party software firm handle all of your business's technology needs? For…
A: A third-party software firm is a company that provides software products or services to customers…
Q: Is it advisable to have third-party software service providers manage all of your IT needs? Surely…
A: A third-party service provider is an external individual or corporation that performs work under…
Q: This kind of virus scan attempts to ascertain the existence of a pattern by looking for known…
A: Dear student, I hope everything is going well for you. I'll do my best to respond to your question.…
Q: The reason for doing a risk analysis is not clear.
A: Risk analysis: Risk analysis is the process of identifying and assessing potential risks that could…
Q: Why is it beneficial to set up the firewall with certain restriction
A: A firewall is a security system that monitors and controls incoming and outgoing network…
Q: Make a complete list of all the parts of a quantum computer and explain in detail how they all work…
A: The act or occurrence of putting something into operation; the process of making something active or…
Q: Malicious traffic could be sent from one VLAN to another as a way to get into a network. The usual…
A: Measures to Prevent: 1. Strengthen Existing Access ControlsControlling who may enter a building is…
Q: Find five academic disciplines with a stake in internet governance and explain how they've had to…
A: 1-One of the typical daily definitions of Internet Governance would suggest that it is the…
Q: How do you think a firewall should be administered most efficiently? Explain.
A: Given: What sorts of management strategies for the firewall do you believe to be the most…
Q: One way that bad traffic could get into a network is if it was moved from one VLAN to another. The…
A: Answer: There is no connection because the desktop is unable to discover the server's hardware…
Q: Expertise in the field of computer science What are disruptive technologies and how do they allow…
A: Introduction: Disruptive technology is a novel strategy for fundamentally changing how consumers,…
Q: Make sure to talk about at least two different kinds of cookies in this talk about cookies and…
A: Explanation: Cookies are small text files placed on a user's computer (or mobile device) and…
Q: What should a reliable plan for a worst-case scenario include? It's different to back up a phone or…
A: This inquiry seeks to answer the following: what aspects of a backup strategy contribute to its…
Task 1:
Modify the function header so it looks like this:
int countElement(int inputArray[], int arraySize, int element1, int
element2)
The function should now be modified to return either 0, 1 or 2, according to the following:
● Return 0 if neitherelement1 nor element2 occur in inputArray.
● Return 1 if exactly one of element1 or element2 occurs at least once in
inputArray.
● Return 2 if bothelement1 and element2 occur at least once in inputArray.
Step by step
Solved in 5 steps with 3 images
- Write a function that displays an n-by-n matrix using the following header: void printMatrix(int n)Each element is 0 or 1, which is generated randomly. Write a test program that prompts the user to enter n and displays an n-by-n matrix.despite that the array parameter is preceded by the const qualifier, the array elements can be modified in the function body. Select one: True Falseuse C++ programming language Write a modular program that analyzes a year’s worth of rainfall data. In addition to main, the program should have a getData function that accepts the total rainfall for each of 12 months from the user and stores it in an array holding double numbers. It should also have four value-returning functions that compute and return to main the totalRainfall, averageRainfall, driestMonth, and wettestMonth. These last two functions return the number of the month with the lowest and highest rainfall amounts, not the amount of rain that fell those months. Notice that this month number can be used to obtain the amount of rain that fell those months. This information should be used either by main or by a displayReport function called by main to print a summary rainfall report similar to the following: 2019 Rain Report for Springdale County Total rainfall: 23.19 inches Average monthly rainfall: 1.93 inches The least rain fell in January with 0.24 inches. The most rain…
- JAVA CODE PLEASE Functions with 2D Arrays Practice I by CodeChum Admin Write a function named displayElements that takes a two-dimensional array, the size of its rows and columns, then prints every element of a two-dimensional array. Separate every row by a new line and every column by a space. In the main function, call the displayElements function and pass in the required parameters. An initial code is provided for you. Just fill in the blanks. Output 1·2·3 4·5·6 7·8·9Write two functions using the following headers:int generate01()void printMatrix(int n)The first function generates and returns a random number either 0 or 1.The second function prints an n-by-n matrix. Each element of the matrix is using the number generated by thefirst function.Write a test program that prompts the user to enter n and uses printMatrix to display an n-by-n matrix. Hereis a sample run:Enter n: 30 1 00 0 10 0 0Q3: write a program to pass a two dimensional array as a parameter to a function which is used to find the summation of the upper triangular elements of the array. Co 0 Co1 Co 2 Col 3 Ro 0 Ro 1 Ro 2 Ro 3
- 3. Implement a function called findLargestIndex which returns the index of the rowwith the largest sum.ex. int array[3][6] = {{3, 6, 8, 2, 4, 1}, // sum = 24{2, 4, 5, 1, 3, 4}, // sum = 19{1, 0, 9, 0, 1, 0}}; // sum = 11If the findLargestIndex function was called using this array, it would return 0, asit is returning the index of the row, not the sum.Note that the number of columns is required when passing a 2d array to a function.Assume that 2D arrays passed to this function will have 6 columns.Title line: int findLargestIndex(int array[][6], int rows, int columns);1- Write a user-defined function that accepts an array of integers. The function should generate the percentage each value in the array is of the total of all array values. Store the % value in another array. That array should also be declared as a formal parameter of the function. 2- In the main function, create a prompt that asks the user for inputs to the array. Ask the user to enter up to 20 values, and type -1 when done. (-1 is the sentinel value). It marks the end of the array. A user can put in any number of variables up to 20 (20 is the size of the array, it could be partially filled). 3- Display a table like the following example, showing each data value and what percentage each value is of the total of all array values. Do this by invoking the function in part 1.In c++ please, The following is specifially where im having trouble 4) Create a function to print out the results for each test.void printExamOverview(int stuGrades[][TOTAL_TESTS], int numStu);This function will call getExamAvgMinMaxGrade() to get the class average, highest/lowest grade for each exam. Then it will save the data in a 2D array defined as
- 4- Using “Def” keyword write a function that returns the mean element of the given array elements (The function name will be MeanofArrayElements)5- Using “Def” keyword write a function that returns the sum of each element for the given array (The function name will be SumofArrayElements)6- Using “Def” keyword write a function that compares two arrays, if both are the same it will return true, else it will return false. (The function name will be AreArraysEqual)3) Create a function named "makeThemOdd". The function should accept a parameter named "numberArray". Use the higher order function map() to create a new array that contains all the numbers from the original parameter array but adds 1 to each even number. The new array should only have odd numbers in it. Return the new array. // Use this array to test your function:const testingArray = [1, 2, 4, 17, 19, 20, 21];Exercise 1: //The max function the max between a and b, it returns a if a == //b public double max(double a, double b); //The mult function returns the result of a * b public double mult(double a, double b); //The exist in array function returns the index of the element //‘a’ if //‘a’ exist in array ‘arr’ otherwise returns ‘-1’ public int existsInArray(int [] arr, int a); //Are array equals method compares two arrays and returns true // if the elements of array ‘a’ are equal to elements of array // ‘b’, element by element. If equals it returns 0, it returns - // 1 if not public int areArrayEquals(int [] a, int [] b); Devise four executable test cases for every method in the JUnit notation. See the attached handout for a refresher on the notation.