Q6 / Print a matrix of cells whose size is (32) and its components are as follows 1- The fırst line: two cells each of them is a random matrix of correct numbers (between 6 and 12) and its size (2 * 2) 2- The second line: Two cells the first contains your full name and the seconc the name of the scientific department Which you study 3- The third line: two cells each of them is a complex number with a random integer value e 2:25
Q: Declare an array of ints named scores and assign it the values 90, 80, 70 using static…
A: You did not mentioned any language hence according to BartleBy policy I can write this in any…
Q: May, March, February, June, May, January, May, March}, {John, Mary, Peter, Bob,
A: Enum for first six months. enum month { January, Febraury, March, April, May, June ;…
Q: two dimensional 3 × 7 array, where each row represents a different monkey and each column represents…
A: # define row, column for 3 monkey and 7 daysR = 3C = 7 # init matrixmatrix = [] print("") #…
Q: Consider the following game: Each of two players rolls a dice and whoever rolls the highest number…
A: % Рlаyer diсe rоllрlаyer1=[3, 2, 5, 6, 2, 5, 1, 6, 4, 5];рlаyer2=[4, 2, 4, 3, 6, 5,…
Q: Write a function to determine the resultant force vector R of the two forces F and F2 applied to the…
A: CODE:- import numpy as np from math import* def force_vec(F1,F2,theta1,theta2): #here x component is…
Q: In C++ Monkey Business A local zoo wants to keep track of how many pounds of food each of its three…
A: Declare a 3x5 array to store the pounds of food eaten by each monkey during each day of the…
Q: Question 6: Read in 20 numbers, each of which is between 100 and 200. As each number is read,…
A: 1 )The C++ program will read 20 numbers between 100 and 200. It will store this in array by…
Q: c) .Use loops to create a matrix in which the value of each element is two times its row number…
A: Since no programming language is mentioned, I am using c++ Algorithm: Start Read row size i.e no.of…
Q: For the array ADT, the operations associated with the type array are: insert a value in the array,…
A: For any array ADT the operations associated with it are : Insert Delete Search(Test whether a…
Q: Part1 (Numpy) : Write a Python program as Jupyter Notebook to accomplish the following tasks:…
A: Part1 (Numpy) Program Approach: Step 1: Import required libraries. Step 2: Create a random Matrix…
Q: cre 3 is the 4th clement in the array and 0 is value of that element. Now assign ach element. You…
A: The code is below:
Q: What is the difference between the OSI levels if routers occupy many layers?
A: In response to your query, The Open Systems Interconnection Model (OSI Model) is a conceptual…
Q: Multi-Dimensional Arrays Create a multi-dimensional array of size 20 by 20. Create the following…
A: Algorithm: Create a GameBoard object by initializing the board with all zeros. Call the…
Q: Constant Integer SIZE = 10 Declare Integer values [SIZE] a. How many elements does the array…
A: In this code, the constant integer SIZE is declared and initialized to the value 10. Then, an…
Q: The following parallel arrays store information about 1000 apartments in Jordan. string city[1000];…
A: 3rd option is correct. Because in the question they want no.of apartments not price.
Q: sing C# in Microsoft Visual Studio Create an application that simulates a game of tic-tac-toe. The…
A: Using C# in Microsoft Visual Studio Create an application that simulates a game of tic-tac-toe.
Q: Create your own magic square( 3x3 ) The requirements are below: MATH 413: Every cell in the magic…
A: Polynomial Algebra - Polynomial algebra is a branch of algebra that deals with polynomials. A…
Q: Using the concept of parallel arrays, create an application that stores information for 5 people.…
A: Parallel arrays: Parallel array is a form of implicit data structure that uses multiple arrays to…
Q: a class with 10 students that will take 3 exams use 3 arrays to hold the scores for each student and…
A: The code is given below.
Q: GetMonth - This method prompts for and returns the month GetNumMurals - This method prompts for and…
A: It defines a class MuralScheduler.It sets up a CultureInfo object for formatting currency in US…
Q: Looking for this in Python, please. Shopping list assignment (Parallel Array) Create three global…
A: Code in step 2
Q: Match each data operator with its function: OFFSET Returns the number of the elements in an array.…
A: In the realm of computer programming, operators are fundamental symbols or keywords used to perform…
Q: Array cells are referenced by the same name. True O False
A: Array is a data structure which is a collection of similar data elements ,and are referenced under…
Q: te a program that will read several abbreviations given as std:string values until the value of…
A:
Q: AHPA #4: The C ATM Machine • Two people, "a" and "b", have checking and savings accounts. • Create a…
A: Initialize Account Balances:Begin by establishing a 2x2 array to represent checking and savings…
Q: Implement a program to achieve the rotation of an n x n image clockwise OR counter-clockwise by 90…
A: Read the image resolution (n) from the user. Read the elements of the image matrix (nxn) from the…
Q: Create the Matrix: Create a 19x19 matrix with values starting from 1 to 361. Modify the Middle:…
A: In the first step, the code created a matrix with the specified range.Then in the second step, it…
Q: Each of two players rolls a dice and whoever rolls the highest number (between 1 and 6 inclusive)…
A: Actually, program is a executable software that runs on a computer. The given information Each of…
Q: # Declare a named constant for array size here. MAX_AVERAGES = 8 # Declare array here. # Write a…
A: The Python code is given below with output screenshot
Q: 1) Write a maxConsecutiveDiff function which returns the maximum difference between any two…
A: I give the code in Python as per your requirement along with code ,output screenshot
Q: # Create Custom Transformer Create a custom transformer, just as we did in the lecture video…
A: Import the necessary libraries: numpy for numerical computations and sklearn.base.BaseEstimator and…
Q: For this lab, you will work with two-dimensional lists in Python. Do the following:
A: #Two Dimensional list python program #function returns the sum of all elements in specified column…
Q: Write a program that asks the user to enter 15 integers into an array. Then ask the user to enter a…
A: Here since programming language not mentioned, using C++
Q: Complete the scoring matrix. Scoring matrix with PAM250 scores:
A:
Q: python: numpy def purchases(transactions): """ QUESTION 7 - A high-end store is trying…
A: Define a function "purchases" that takes in a numpy array "transactions" as input. Use np.where() to…
Q: Create the variables to represent the following matrices: A = [12 7 3 4|| [5 8 3] B = 1 2 3 %3D 2 46…
A: We use colon operator if we want to got till end of the row or column
Q: 1. Given A[10], α=2000, esize=4 bytes: a) Find the number of elements. b) Find the address of the…
A: The number of elements is specified while array declaration and thus array A has 10 elements Given…
Q: The city of Istanbul, Turkey is located at a latitude of 41.0082 degrees north and longitude of…
A: the program is an given below :
Q: 7:Give an example to show how to convert Numpy.array type to DataFrame? 8: Give examples to show at…
A: Example of to convert Numpy.array type to dataframe: import numpy as npimport pandas as pd array =…
Q: Create an array called sales to monitor one week's worth of sales over the course of two months.…
A: an array called sales to monitor one week's worth of sales over the course of two months. Assign…
Q: AVA CODE PLEASE Functions with 2D Arrays Quiz by CodeChum Admin Write a program that asks the user…
A: Start Take input from user for number of rows and columns declare a 2D array with size of rows and…
Q: TicTacToeCreate the board display the board Set token to ‘x’Loop //at most 9 times, but end loop…
A: PROGRAMMING APPROACH: // defining header file. // inside the board array of size 17*17. // using the…
Q: Find primes This program creates and displays a 5x10 matrix(5 rows and 10 columns) of random…
A: Answer of the given question: The solution of the above program in python is as below: OUTPUT OF…
Step by step
Solved in 2 steps
- Please fix this code, so the answer is proper, not only 0's: .datax: .double 0:16 # initialize x to all zerosy: .double 0:16 # initialize y to all zerosz: .double 0:16 # initialize z to all zerosmsg1: .asciiz "Enter 16 values for y and z matrices: \n"msg2: .asciiz "Resulting x matrix: \n".text.globl mainmain: # Prompt user to enter values for y and z matrices la $a0, msg1 li $v0, 4 syscall # Input values for y la $t0, y li $t1, 16 li $v0, 7 yloop: beq $t1, $zero, zloop syscall sdc1 $f0, ($t0) addi $t0, $t0, 8 addi $t1, $t1, -1 j yloop # Input values for zzloop: la $t0, z li $t1, 16 li $v0, 7 zinner: beq $t1, $zero, multiply syscall sdc1 $f0, ($t0) addi $t0, $t0, 8 addi $t1, $t1, -1 j zinner # Multiply y and z matrices and store the result in xmultiply: la $t0, y la $t1, z la $t2, x # Loop over rows of x li $t3, 0rows: beq $t3, 4, print # Loop…Lottery Winners Directions A lottery ticket buyer purchases 10 tickets a week, always playing the same 10 5-digit “lucky” combinations. Write a program that initializes an array or a vector with these numbers and then lets the player enter this week’s winning 5-digit number. The program should perform a linear search through the list of the player’s numbers and report whether or not one of the tickets is a winner this week. Here are the numbers: 13579, 26791, 26792, 33445, 55555, 62483, 77777, 79422, 85647, 93121 Validate the input for the week's winning number. Ensure the input does not crash when entering a character or string value. Make sure to accept only positive numbers. Ask the user for the correct value each time they enter an incorrect one.Alphabet Random Walk• Write a program to generate a random walk that spans a 10*10 character array (The initial values of the elements are all.). The program must randomly walk from one element to another, moving one element position up, down, left or right each time. The elements that have been visited are labeled with the letters A through Z in the order in which they were visited
- Payroll Write a program that uses the following arrays: empId: an array of seven long integers to hold employee identification numbers. The array should be initialized with the following numbers: 5658845 4520125 7895122 8777541 8451277 1302850 7580489 hours: an array of seven integers to hold the number of hours worked by each employee payRate: an array of seven doubles to hold each employee's hourly pay rate wages: an array of seven doubles to hold each employee's gross wages The program should relate the data in each array through the subscripts. For example, the number in element 0 of the hours array should be the number of hours worked by the employee whose identification number is stored in element 0 of the empId array. That same employee's pay rate should be stored in element 0 of the payRate array. The program should display each employee number and ask the user to enter that employee's hours and pay rate. It should then calculate the gross wages for that employee (hours times…• C=numpy.add(A, B): Combine two matrices A and B and save the result in C.• C=numpy.subtract(A, B): Subtract matrices A and B and store the result in C.• C=numpy.divide(A, B): Divide matrices A and B and save the result in C.• C stands for numeric.multiply(A, B): Multiply matrices A and B and store the result in C.• C=numpy.sum(A): Add the elements of matrix A and store the result in c R.• C=numpy.sum(A, axis = 0): Perform a column-wise sum of matrix A and store the result in vector C.• C=numpy.sum(A, axis = 1): Perform a row-by-row summation of matrix A and store the result in vector C. Write Python code to demonstrate the use of these methods in a sample matrix. give accurate code with output otherwise you will get downvotepart a- 2point) for 3 students find the average of a student by asking him how many grades do you have. The answer to this question, determine the size of the array(list of grades) and then ask the user to enter grades(the number of the grades is equal to the size of the array) then calculate the average for each student. Hence, you will calculate 3 averages. to calculate the average, use the array accumulator. Also when you get each grade validate it. validation for grade means that you check whether a grade is between 0 and 100. if the grade is negative or a grade is more than 100 then it is not valid and you have to ask the user to enter a grade again. Part b- 1 point) Find the maximum and minimum grades for each student. Part c- 1 point) Print the sorted list of the grades for each student. example: if grades user entered are: 60 78 98 23 45 then sorted list is:23 45 60 78 98 (Array not vector)
- Question 3 Used cars showrooms are places where used cars are displayed and sold. Write a method generateReport0 that takes as a parameter a two-dimensional array named prices of size 7 x 5 that contains used car prices in which each row represents a day and each column represents a showroom. The method displays the average used car price for each showroom. In addition, it should display the showroom with the highest average car price. For example, if the main method for this program has prices array values as given below: public static void main(String[] args) { double [] [] prices = { (3.0, 1.0, 1.0,7.0,5.0}, {1.5, 1.0,3.0, 1.0, 4.7}, (2.5,2.2, 1.0,1.9,1.7}, (1.0, 1.0, 8.0,2.2, 4.1}, {4.5,9.0, 8.0, 4.2,2.7}, {1.5,1.0, 4.0, 4.2,2.3}, {6.5,4.5,9.7,2.9,3.7} } }; generateReport (prices); Your generateReport() method should display the following output: Showroom 0 average used car price is 2.9285714285714284 Showroom 1 average used car price is 2.814285714285714 Showroom 2 average used…2DArray method:It will allocate a block of memory which represents a two-dimension arraybased on the input values supplied by the user. Ask the user to enter the number of rows andcolumn for 2D array that the user want to manipulate. The number of rows and columns that theuser enters may or may not define a square matrix (when the number of rows equals the numberof columns). The array will have exactly rows time columns (m * n) elements. It will notcontain any extra or empty cells. Initialize the “matrix” by rows with random number between 1to 100. Pass two arguments by out reference so that you can assign the number of row andcolumns of data to the first and second arguments. This is return 2D array method afterallocating new memory for 2D array and initialize it with random value. Generate randomnumber code in C# as following: Random randnum = new Random( );int number = randnum.Next (1, 101);SwapRow method: it will rotate the data in the matrix in an up/down method such that the…Programming Language: C++ You have been hired by Google to work on their YouTube videos search team. Every YouTube video has a unique ID and those IDs are in unsorted order. As a software engineer, you are required to make a YouTube search engine which works for very user. Create a test engine that only holds seven YouTube IDs. Prompt for and get from the user the seven IDs and store them in an integer array. Then sort and print the array using the insertion sort algorithm. Finally, use a sentinel loop to prompt for and get from the user a series of IDs. For each ID, perform a binary search on the array and tell the user if it was found or not. If found, print the index where the ID is stored. Continue to prompt the user for an ID until entering the sentinel value of -999. In addition to function main, define the following two functions: void insertion_sort(int arr[], int arr_size) int binary_search(int sort_arr[], int size_array, int search_value) binary_seacrh returns…
- JAVA PROGRAM: Monkey Business A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3 × 5 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey, or use constant values rather than asking user for input. Then it should create a report that includes the following information: Display 3X5 array first. Average amount of food eaten per day by the whole family of The least amount of food eaten during the week by any one The greatest amount of food eaten during the week by any one Input Validation: Do not accept negative numbers for pounds of food eaten.Programming: Multi-Array Assignment Instructions Overview Using a two-dimensional array, you will create the game battleship using a text file that contains the board. The user will enter coordinates to try and find ships and sink them. Instructions Imagine you are using a two-dimensional array as the basis for creating the game battleship. In the game of battleship, a `~' character entry in the array represents ocean (i.e., not a ship), a `#' character represents a place in the ocean where part of a ship is present, and a `H' character represents a place in the ocean where part of a ship is present and has been hit by a torpedo. Thus, a ship with all `H' characters means the ship has been sunk. Declare a two-dimensional array that is 25 x 25 that represents the entire ocean and an If statement that prints "HIT" if a torpedo hits a ship given the coordinates X and Y. Create a text file of 25 line. Each line has 25 characters. ~ represents water and # represents part of…AHPA #4: The C ATM Machine• Two people, "a" and "b", have checking and savings accounts.• Create a 2x2 array to hold their amounts: a – checking: $500, savings:$1,000; b – checking: $750, savings: $325.• Have the ATM machine ask the user their name.• Ask the user if they want to withdraw from their checking or their savingsaccount.• Use a switch statement to process different types of accounts.• Create software that will provide an ATM user with theproper change for any dollar amount up to $200.• Example: Run the code for $19, $55, and $200. Is the amount > $100, then provide a $100 bill & subtract $100• Is the amount >= $100, then provide a $100 bill & subtract $100• Is the amount > $20, then provide a $20 bill & subtract $20 [repeat 4times]• Is the amount > $10, then provide a $10 bill and subtract $10• Is the amount > $5, then provide a $5 bill and subtract $5• Provide the remaining amount in single $1 bills so the output should be like shown in…