Finish the function below that takes in the length of the two parallel sides of a trapezoid a and b, which are separated by a distance h, and returns its area. In [ ]: defarea_of_trapezoid(a,b,h):# YOUR CODE HEREraiseNotImplementedError() In [ ]: """Check that area_of_triangle returns the correct output for several inputs""" assert abs(area_of_trapezoid(3,3, 5) - 15) <=.1 assert abs(area_of_trapezoid(3,4, 5) - 17.5)
Q: 4->2->10->30 After adding 50 into the list. 4->2-10->30->50 Searching 30 in the list? 30 is prestnt…
A: Here is the java program of linked list. See below steps for code.
Q: Compressed Post Office Protocol (also known as CPOS) is used by computers.
A: Introduction: A user client application may connect to a mailbox (maildrop) stored on a mail server…
Q: Manager of Information Systems (IS) at Agate Construction Company Ltd. Your company's Board of…
A: Below I have provided Answer with Example.
Q: What exactly is npm? Give a short explanation in your own words.
A: Given: What does nap stand for? Put it briefly in your own words. NPM is an acronym for the Node…
Q: What are the conditions that result in a system being in a deadlock?
A: Firstly what is deadlock? Deadlock is a situation where one process is holding at least a resource…
Q: This python file requires a main function and two custom functions about circles. Both functions…
A: Algorithm to print area and circumference of circle - First import math module. Define two function…
Q: In Microsoft Excel, the following choices are available. Describe the features and workings of: 1.…
A: 1. Sort/filter: Excel's sorting and filtering tools help in data collection. The filter tool lets…
Q: Which protocol does PPP utilise to identify the Network layer protocol?
A: Introduction: At layer 3, the most important protocol is the Internet Protocol, or IP (also known as…
Q: If coding is difficult, what makes it so?
A: Coding, the language of computers, is often viewed as a complex and difficult skill. The common…
Q: What function do matrices play in information technology and computer science?
A: computer science: The study of computers and other types of computational systems is known as…
Q: It is possible to build a system in which shared structures are stored in the local memory of each…
A: This is very simple. Yes, it is possible to build a system in which shared structures are stored in…
Q: How can I modify my spreadsheet in Excel so that every time BB showed up, it was eliminated? I need…
A: In order to modify spreadsheet in excel one should try to 1.Select the column you want to limit or…
Q: What is the difference between password-based authentication and authentication based on…
A: Digital Certificates vs Password Authentic Businesses understand the importance of passwords for…
Q: Describe artificial neural networks (ANN), their definitions, and the many topologies of ANN.
A: Introduction: An artificial neural network is an effort to imitate the network of neurons that…
Q: Explain in three pages the distinctions between variables and attributes
A: Answer to the given question: A few information are subjective information with a quality trademark…
Q: Discuss three reasons why it is essential to design an application's user interface prior to…
A: it is essential to design an application's user interface prior to beginning programming because :-…
Q: b. Suppose dprop is greater than dtrans. At time t=dtrans, where is the first bit of the packet?
A: The answer is
Q: Because the ports are connected to a variety of devices, a mechanism must be created so that the…
A: Introduction: Daisy Chaining System is one potential option when taking this one into account. All…
Q: What function do matrices play in information technology and computer science
A: Matrices are use to store data in form of rows and columns.
Q: Describe the convergence of digital technologies and its impact on mobile devices
A: Convergence of digital technologies Technological convergence is a term that portrays uniting…
Q: What difficulties exist in grasping the concept of text mining?
A: introduction: Text Mining is the technique of extracting interesting patterns from extremely large…
Q: Clearly distinguish assembly code from source code.
A: The problem is based on the basics of low level and high level languages.
Q: 17. ~[(pvq) ~q]
A: The answer of this question is as follows.
Q: Provide examples of the three distinct types of Internet addresses
A: IP address An IP address is an interesting location that distinguishes a gadget on the web or a…
Q: Outline Prior to storing data in a data warehouse, a company might take certain steps to ensure the…
A: Introduction: Steps a Company Must Take to Perform Data CleaningBefore uploading this data to a data…
Q: Q4/ A: How to use MATLAB to verify that the identity is correct for the trigonometric identity given…
A: Below I have provided an matlab program for the given question. Also, I have attached a screenshot…
Q: culator or a computer, but check your answers with a calculator or a com- 006 J:C
A: The answer is
Q: Describe the convergence of digital technologies and its impact on mobile devices.
A: Introduction: The capacity to watch the same multimedia information from different devices is…
Q: Explain Lean Development and its advantages in five sentences, and suggest two circumstances from…
A: According to the information given:- We have to define Lean Development and its advantages in five…
Q: What network commands would you use to analyze your straightforward network? What instructions would…
A: Introduction: When two or more computers are linked together to share resources and information, the…
Q: Differences between C++'s malloc() and new
A: Introduction: malloc()new()There is a purpose to it.It is a controlling element. It is necessary for…
Q: What are the issues for implementing IT governance in IT security
A: IT governance is a process that is used to monitor and control the key information technology…
Q: All technicians require the proper tools and knowledge to investigate and resolve troubleshooting…
A: Introduction: instruments for identifying issues with an operating systemBefore the operating system…
Q: Given the circuit below, design a purely NOR gate equivalent circuit.
A: From the given circuit, A = XY+(X'+Y').(X+Y)
Q: Which of these devices is responsible for preserving the integrity of data transferred across a…
A: these devices is responsible for preserving the integrity of data transferred across a network…
Q: 1. What are the latest trends in networking? 2. What is the architecture of the Internet? 3. Explain…
A: Answer to the previous conundrum: 1)prevailing patterns in networking: IOT - By using IOT, telecom…
Q: Perform the necessary configuration steps to allow PC1 to communicate with PC2 across the router.
A: BELOW ? STEP BY STEP COMPLETE SOLUTION REGARDING YOUR PROBLEM WITH EXPLANATIONS :
Q: Briefly define these terms below before attempting the lab: Address Resolution Protocol (ARP)…
A: Answer the above question are as follows
Q: What is the function and purpose of data grouping when it comes to file organization?
A: Introduction: A variable's individual observations are combined into groups to produce grouped data,…
Q: What difficulties exist in grasping the concept of text mining?
A: First, let's know about the concept of text mining a little bit. Text mining is about exploring and…
Q: This chapter examines the techniques for mimicking a statistical distribution using…
A: generator of random numbers A computer's random number generator: The random numbers are generated…
Q: 3. Derive a complexity funciton T(n) for the following pseduo code using the summations. Show your…
A: According to the information give:- We have to follow the mentioned pseduo code and perform…
Q: Compressed Post Office Protocol (also known as CPOS) is used by computers.
A: Introduction: The Post Office Protocol is a network protocol that allows a user client program to…
Q: Make a few notations on how to categorize the following: Microcontrollers a small computer a…
A: According to the information given:- We have to give few notation and categorize the following.
Q: Describe how caches are used to take advantage of "spatial locality" and "temporal locality" to…
A: introduction: The application often uses previously utilised information and commands again. Based…
Q: Let X be a continuous random variable with the density function 1 1.
A: A continuous random variable is one which takes a boundless number of potential qualities.…
Q: t are the conditions that result in a system being
A: Introduction Four conditions are necessary conditions for a system to be deadlocked:- Mutual…
Q: need at least 3 pros and cons between Manchester encoding against Nonreturn to zero (NRZ) signaling
A: We need to list 3 pros and cons of Manchester encoding and Nonreturn to zero (NRZ) signaling.
Q: What are the disadvantages of consecutive files?
A: Introduction: The following is the name of the file that is sorted in consecutive fashion:When…
Q: a) What is Big Data and what is its significance?
A: Introduction: Big Data means "a lot of data." Big Data is a big, growing collection of organised or…
Finish the function below that takes in the length of the two parallel sides of a trapezoid a and b, which are separated by a distance h, and returns its area.
Step by step
Solved in 2 steps
- (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.Write the following function to draw a regular polygon:def drawPolygon(x = 0, y = 0, radius = 50, numberOfSides = 3):The polygon is centered at (x, y) with a specified radius for the bounding circle for the polygon and the number of sides. Write a test program that displays a triangle, square, pentagon, hexagon, heptagon, and octagon, as shown in Figure 6.12a.Complete the function below that takes in three integers (a,b,c) and returns the number of integers between a and b (inclusive of the endpoints) that are divisible by c. Make sure it tests a and b for divisibility by c! In [ ]: defhow_many_divisible(a,b,c):counter=0# YOUR CODE HEREraiseNotImplementedError()returncounter In [ ]: assert how_many_divisible(10,20,5) == 3 assert how_many_divisible(30,77,7) == 7 PYTHON jYPYTER
- Write a function which solves a projectile problem. As input, the function will take the initial height (y0) from which the projectile is launched, the initial velocity, and the angle in degrees which the initial velocity makes with the horizontal (positive if above the horizontal, negative if below the horizontal). The function should calculate the time T the projectile stays in air, generate a time array (0, T/100, 2T/100, 3T/100, …, T), and return the values of x and y (the components of the position vector of the projectile) at the times in the array. Plot the projectile trajectory using matplotlib. Use phyton language pls put output screenshot import mathimport numpy as npimport matplotlib.pyplot as plt%matplotlib inlineWrite a function which solves a projectile problem. As input, the function will take the initial height (y0) from which the projectile is launched, the initial velocity, and the angle in degrees which the initial velocity makes with the horizontal (positive if above the horizontal, negative if below the horizontal). The function should calculate the time T the projectile stays in air, generate a time array (0, T/100, 2T/100, 3T/100, …, T), and return the values of x and y (the components of the position vector of the projectile) at the times in the array. Plot the projectile trajectory using matplotlib. Use phyton languageDisplay the first N magic numbers, where N is a positive number that the user provides as input. Here, a magic number is a number whose sum of its digits eventually leads to 1. For example, 1234 is a magic number because 1 + 2 + 3 + 4 = 10 and 1 + 0 = 1, while 1235 is not (1 + 2 + 3 + 5 = 11 and 1 + 1 = 2). Write a program that prints out the first N magic numbers, seven on each line. You are required to use the following function prototype: bool isMagic(int value); // Returns true if value is a magic number The outline of this function will be as follows: Step 1: Calculate the sum of digits of the value Step 2: Repeat Step 1 until we get a single-digit Step 3: If the resulting sum is equal to 1 then it is a magic number, otherwise not Here is the sample output:
- “Days Into Year (C++)” By using my code (photo is attached), implement a Days Into Year function. It MUST BE of this form: int daysIntoYear ( int year, int month, int day ) ; In terms of "Days Into Year," how many days are we into the year based on a given date? For example, January 1 is 1 day into the year. Please have the code display 12 test cases with the result from the function, and the number of days into the year from some other source. So you can hand calculate the days into the year or use an internet web page. The typical output might look like this: (Please make the format better but be sure to automatically calculate agree/disagree column) You must include a leap year function that returns a bool and takes as a parameter the year. This function must be used in your code. Year Month day Days Into Year Value expected Agree/Disagree 2020 1 1 1 1 agree 2020 1…Using, HTML,CSS , and javascript Write a program that takes as input the speed of a car e.g 80. If the speed is less than 70, it should print “Ok”. Otherwise, for every 5 km/s above the speed limit (70), it should give the driver one demerit point and print the total number of demerit points. For example, if the speed is 80, it should print: “Points: 2”. If the driver gets more than 12 points, the function should print: “License suspended”.The Function will be able to calculate the area of the following polygons: Right triangles, Rectangles, and regular polygons. It will do so by taking the following inputs: - numSides – a double of the number of sides the polygon has - sideLengths – a double of the length or lengths of sides of the polygon The program should determine if the inputs are formatted properly. The rules are: - numSides must be a positive integer number with values greater than or equal to 3. - When numSides is 3 or 4, sideLengths can either be a scalar or an array with two values. - When numSides is greater than 4, sideLengths must be a scalar. To determine if a number is an integer, you can use the rem function. rem returns the remainder of whole number division. It has the following syntax: remainder = rem(numerator, denominator); Where remainder is the remainder of numerator/denominator. To use this to find whether a number is an integer, use rem in the following way: remainder = rem(number, 1); When…
- I JUST WANT TO MAKE SURE IF MY HOMEWORK ANSWERS ARE CORRECT C++ HOMEWORKS Write the program Write a function to output a pyramid like this * *****. ********* Answer: #include <iostream> using namespace std; void printPyramid(int n) { for (int i = 0; i < n; i++) { for (int j = 0; j < n - i - 1; j++) { cout << " "; } for (int j = 0; j <= i; j++) { cout << "*"; } for (int j = 0; j < i; j++) { cout << "*"; } cout << endl; } } int main() { printPyramid(4); return 0; } Write a function to count how many numbers in one string.. Answer: #include <iostream> #include <string> using namespace std; int countNumbers(string str) { int count = 0; for (char c : str) { if (isdigit(c)) { count++; } } return count; } int main() { string str = "Hello, World,…doing this activity on zylabs. 8.18 LAB: Miles to track laps One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a number of miles as an argument and returns the number of laps. Complete the program to output the number of laps. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('{:.2f}'.format(your_value)) Ex: If the input is: 1.5 the output is: 6.00 Ex: If the input is: 2.2 the output is: 8.80 Your program must define and call the following function:def miles_to_laps(user_miles) I get the two points for executing the code correctly, then it asks for unit tests. I don't know how to get the remaining 8 pointsWrite a function NumberOfPennies() that returns the total number of pennies given a number of dollars and (optionally) a number of pennies. Ex: 5 dollars and 6 pennies returns 506. #include <iostream>using namespace std; void NumberOfPennies(int NumberOfDollars, int NumberOfPennies){if (NumberOfDollars == 1) {NumberOfDollars = NumberOfPennies * 100;}}/* Your solution goes here */ int main() {cout << NumberOfPennies(5, 6) << endl; // Should print 506cout << NumberOfPennies(4) << endl; // Should print 400return 0;} Please help me with this problem using c++.