Write a program that reads two lists of integers from input into two arrays and outputs the sum of multiplying the corresponding list items. The program first reads an integer representing the length of each list, followed by two lists of integers. Ex: If the input is: 3 1 2 3 3 2 1 the program calculates (1 * 3) + (2*2)+(3 * 1) and outputs 10 Ex: If the input is: 4 2 3 4 5 1 1 1 1 the program calculates (2* 1) + (3 * 1) + (4 * 1) + (5 * 1) and outputs 14
Q: What are the two main approaches to hardware multithreading?
A: Introduction: A programme or operating system that supports multiple users simultaneously without…
Q: What is meant by delayed branch?
A: In the given question the delayed branch means that the instruction following the branch is always…
Q: Which of the following is NOT true about sentinel loop? O It requires sentinel to be distinguishable…
A: Sentinel loop in python: It is the another way to use a while loop. A Sentinel loop continues to…
Q: • Write a recursive method named searchList with the following header: • boolean searchList (int[]…
A: We need to write a Java code for recursive search on a list in Java. ***As per the guidelines, only…
Q: You have several users who have local administrative access to their computers. Some of these users…
A: Initially provide access to only authorized users as there are several users having local…
Q: Algorithm : Testing Membership Input : a group G acting on f~ = { 1,2 ..... n }; a permutation g of…
A: Algorithm : Testing MembershipInput : a group G acting on f~ = { 1,2 ..... n };a permutation g of…
Q: What is meant by ILP?
A:
Q: BIOS Settings: Display storage device information, configures and tests the storage devices and…
A: According to the information given:- WE have to match the correct option in order to satisfy the…
Q: Algorithm for Testing Membership Input : a group G acting on [2 = { 1,2 ..... n }; a permutation g…
A: function is_in_group(p : permutation; i : l..k+l ) : boolean;(* return true if the permutation p is…
Q: What is the worst-case performance of the remove method in a full binary search tree with linked…
A: Solution given as : worst-case performance of the remove method in a full binary search tree with…
Q: 7. Fill in the blank cells based on the information provided. Network Class *CIDR Subnet Mask…
A: The number of bits available for the IP address is denoted by the CIDR notation, which is…
Q: Define - Static Multiple Issue.
A: Definition: The collection of instructions that are executed all at once during one clock cycle is…
Q: Help me complete this task. Add the following style rules for the form elements. Create a style…
A: Solution: I have modified according to the given instructions.
Q: Write the formula for CPU execution time for a program
A: The above question that is write the formula for CPU execution time for a program is answered below…
Q: Draw a deterministic FSM that recognizes strings of 1’s and 0’s specified by each of the following…
A: In (a) String of three characters ,101 (b) All strings of arbitrary length that end in 101 .(Example…
Q: Explain what is cloud storage? How does cloud storage work? What are the benefits of cloud storage.…
A: Cloud Storage: A service paradigm known as "cloud storage" involves sending and storing data across…
Q: How can we insert data in SQL?
A: In order to insert data into an SQL database, we use the INSERT command of SQL, which takes the…
Q: Problem 17.6. There were n Immortal Warriors born into our world, but in the end there can be only…
A:
Q: What are the basic components of performance?
A: Answer the above question are as follows
Q: Define – Superscalar Processor
A:
Q: reate a C PROGRAM for reversing a string by using pointers. Test Data : Input a string : Sharmaigne…
A: The answer is given below.
Q: 14. Indicate when the TOVx flag is raised for each of the following cases: (a) Timer0 and Normal…
A: a) Timer0 and Normal mode When the time reaches the value $FF and rolls over, the TOV0 flag is…
Q: I have written a program that requires entering 3 first and last names and generates a file…
A: The algorithm of the code:- i. Open the "ACL.txt" file.ii. Read the names from the file into…
Q: hboard 9 urses oups endar Eb box story udio ? Help Announcements Syllabus Modules Files Discussions…
A: QUESTION 15:- What is it called when a variable is initialized before a loop to guarantee the loop…
Q: Write the formula for CPU execution time for a program
A: Theory: Computer performance is its work output. The term performance in computer performance…
Q: Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the…
A: As language is not given, doing it in Python Programming.
Q: Give a brief summary of the benefits and drawbacks of using each of the three main types of…
A: Introduction In a computer network, two or more computers are linked together and share resources,…
Q: Problem (Cylinder.java) a. Implement a class called Cylinder. A cylinder has a circle and one…
A: import java.io.*;class Circle{ private int x,y; private double r; public Circle(int…
Q: write a Program to implent Binary search on the given
A: The binary searching algorithm can be denoted as a searching algorithm used for a sorted array in…
Q: Consider if another JK Flip Flop was attached to another JK Flip Flop, JK3, is attached, with Q2…
A: Given: We need to explain about JK Flip Flop was attached to another JK Flip Flop, JK3, is…
Q: with the line that starts with ###TODO def load_csv_data(filename): """ load the data from…
A: We will write code for loading data from CSV and reading from it using csv.reader as asked.
Q: Compare the use and the methodology of TEM with SEM? Provide at least one example where each would…
A: SEM Both scanning electron microscopy and scanning electron microscope are abbreviated as SEM. An…
Q: Program - Python Make a dictionary, the student's name is the key (a string) and the student's test…
A: Python has dictionary data structure that can store the key ,value pairs. The key is used to get…
Q: Find out how many nodes the optimal linkedlist has. Among these, which one takes the longest to…
A: The answer to the question is given below:
Q: Match the following BIOS master menu settings and its definition. ✓ Display system information, sets…
A: According to the information given:- We have to match the correct option to correct statement /…
Q: How to Evaluating a string containing a Python literal with ast.literal_eval
A: We need to discuss the evaluation of a string containing a Python literal with ast.literal_eval.
Q: Write a Java program that reads each line of an input file called data.txt that consists of a…
A: The JAVA program is given below with output screenshot
Q: Define - Static Multiple Issue.
A: Multiple Static Issues/VLIW The group of instructions that run simultaneously during one clock cycle…
Q: What is pipeline stall?
A: The answer to the question is given below:
Q: Computers use various function keys to access built in system features during system startup (Splash…
A: According to the information given:- We have to match the correct option with respect to its terms.
Q: private void button1_Click(object sender, EventArgs e) { if (RedCheckbox.Checked == true) {…
A: The given uses the if-else conditional block to perform a functionality.
Q: int): Call print_stack(). Define a local string containing "ABCD". Call f2() passing the string…
A: The answer is given below.
Q: To better understand HTTPS, it is helpful to understand the wide variety of threats it protects…
A: The HTTPS protocol is used by websites to prevent unauthorised users from performing illegal actions…
Q: What is meant by anti-dependence? How is it removed?
A: INTRODUCTION: As a result of ant dependencies (read-after-write dependencies), the effectiveness of…
Q: Define - Response Time.
A: Response Time The amount of time that passes between a query to a system and the response to that…
Q: 7) Given x = 1:10 and y = [3 1 5 6 8 2 9 4 7 0], find the results of the Following commands: a) (x >…
A: We need to find output of given statements in Matlab. x(y<0)
Q: Define - Static Multiple Issue.
A: Given To know about the Static multiple Issue.
Q: Please fill in the blanks for C /* This task will do some basic programming using pointers. All…
A: Introduction C Pointer: With C, a pointer refers to a variable which includes the address of another…
Q: C programming: Write a function printCourse() which receives a course pointer and prints all its…
A: Please find the answer below :
Q: When it comes down to it, what does a firewall do best? My current project is a piece of software to…
A: It provides security for Network packets. Additionally, it examines received data packets. It was…
In Java please.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- Exercise 5: Write a Python program that reads from an input from user n student test scores in the range 0 – 100 and store these scores in a list (Hint: use sentinel value score < 0). Your program should determine the number of students having scores in each of the following ranges: 0-59, 60-79, 80-89, and 90- 100. Display the score ranges and the number of students. If you run your program with the following data: 76, 89, 100, 95, 90, 100, 76, 100, 50, 67, 78, 89, 77, 89, 98. Your output should be as follows:In c program Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow, Assume that the list will always contain fewer than 20 words. Ex If the input is: 5 hey hi Mark hi mark the output is hey- 1 hi - 2 Mark- 1 hi - 2 mark - 1 Hint: Use two arrays, one array for the strings and one array for the frequencies. 1 #include 2 #include 3 4 int main(void) { /* Type your code here. */ 7 8 return 0; 9 } 10Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative number is not a part of the sorted list). Assume the number of integers is always odd. Ex: If the input is: 2 3 4 8 11 -1
- Write a program that calculates the equivalent resistance of a circuit. n electrical resistors with resistance values R1, R2,.., Rn are said to be connected in parallel if the same voltage is applied across each. Their equivalent resistance Reg is related to the values R1, R2, ..., Rn by: 1 1 1 1 + +...+ R R R, R. "eq Write a program that prompts the user to enter the resistance of n resistors. The user should be prompted continuously by using a while loop until a zero or negative value is entered (the program should count the number of resistors n entered by the user and store the values in an array). Use another separate loop to print the resistance values entered by the user and the equivalent resistance Reg. Test your program with R1= 1 kn, R2= 2 kn, R3= 4 kQ and R4= 8 kQ.Given a square matrix with the elements 0 or 1, write a program tofind a maximum square submatrix whose elements are all 1s. Your programshouldprompt the user to enter the number of rows in the matrix. The program then displaysthe location of the first element in the maximum square submatrix and thenumber of rows in the submatrix. Here is a sample run: Enter the number of rows in the matrix: 5 ↵EnterEnter the matrix row by row:1 0 1 0 1 ↵Enter1 1 1 0 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵EnterThe maximum square submatrix is at (2, 2) with size 3 Your program should implement and use the following method to find the maximumsquare submatrix:public static int[] findLargestBlock(int[][] m)The return value is an array that consists of three values. The first two values arethe row and column indices for the first element in the submatrix, and the thirdvalue is the number of the rows in the submatrix.Write a program that reads a list of integers from input into an array and outputs "yes" if the list is sorted in ascending order between two provided positions. Otherwise, output "no". The first input specifies the number of items in the list. The next set of inputs is the list. The last two inputs are the start and end positions (inclusive). Assume the list contains less than 20 integers and position 1 is the first element. Ex: If the input is: 8 5 6 7 4 3 2 1 0 1 3 the output is: yes Ex: If the input is: 6 1 2 3 4 5 2 4 6 the output is: no
- A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Ex: If the input is: 3 Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309 Your program must define and call the following function. The return value of GetPhoneNumber is the phone number associated with the specific contact name.string GetPhoneNumber(vector<string> nameVec, vector<string> phoneNumberVec, string contactName) #include <iostream>#include <vector>using namespace std; string GetPhoneNumber(vector<string> nameVec, vector<string> phoneNumberVec, string contactName) {} int main()…A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Ex: If the input is: 3 Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309 Your program must define and call the following function. The return value of GetPhoneNumber is the phone number associated with the specific contact name. string GetPhoneNumber (vector nameVec, vector phoneNumberVec, string contactName) Hint: Use two vectors: One for the string names, and the other for the string phone numbers.When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This adjustment can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by dividing all values by the largest value. The input begins with an integer indicating the number of floating-point values that follow. Assume that the list will always contain positive floating-point values. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'{your_value:.2f}')
- When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This adjustment can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by dividing all values by the largest value. The input begins with an integer indicating the number of floating-point values that follow. Assume that the list will always contain fewer than 20 floating-point values. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:System.out.printf("%.2f", yourValue); Ex: If the input is: 5 30.0 50.0 10.0 100.0 65.0 the output is: 0.30 0.50 0.10 1.00 0.65 The 5 indicates that there are five floating-point values in the list, namely 30.0, 50.0, 10.0, 100.0, and 65.0. 100.0 is the largest value in the list, so each value is divided by 100.0. For coding simplicity, follow every output value by a space, including the last one. import…Exercise 4: Write a Python program that reads in 3 digits and prints "in order" if they are sorted in ascending or descending order. Otherwise, prints "not in order". For example: Please enter 3 digits: 13 6 136 **in order** Please enter 3 digits: 9 4 1 941**in order** Please enter 3 digits: 8 5 7 857 **not in order** Please enter 3 digits: 4 4 2 442**in order**IN PYTHON: Using a function, create a list of 20 numbers randomly between 1-99. With recursive function, you are going to take the numbers from the list, one at a time starting at position 0 and add them together. If the numbers added together equals a user specified sum, stop the program and show the two digits that sum together. If not, remove the first number from the list and add the next two. Continue running the program until you have reached the end of the list. sample output: randomly selected numbers: [61, 6, 78, 3, 64, 22, 11, 9, 34, 99, 31, 56, 43, 8, 77, 27, 93, 47, 58, 20] User input : 86 61 + 6 = 67 FALSE [6, 78, 3, 64, 22, 11, 9, 34, 99, 31, 56, 43, 8, 77, 27, 93, 47, 58, 20] 6 + 78 = 84 FALSE [78, 3, 64, 22, 11, 9, 34, 99, 31, 56, 43, 8, 77, 27, 93, 47, 58, 20] 78 + 3 = 81 FALSE [3, 64, 22, 11, 9, 34, 99, 31, 56, 43, 8, 77, 27, 93, 47, 58, 20] 3 + 64 = 67 FALSE [64, 22, 11, 9, 34, 99, 31, 56, 43, 8, 77, 27, 93, 47, 58, 20] 64 + 22 = 86 TRUE!