Problem Description a) Create a new code cell or a new python file. b) Write a python code that creates numpy arrays A, B, and C. print the result of A(B+C) _and AB + AC. (2 -1) 2 4 B = 23 and C=| 03, c) A business makes two types of products: A and B. The following table is used in calculating the cost of manufacturing each product: Labour (Hours) Wood (Blocks) Paint (Tin A. 4 Labour costs $8 per hour, wood costs $1 per block and paint costs $2 per tin. Find the cost for each product. Note: in your code, you have to use matmul function.
Q: Write a C program that will accept 10 input values and will store the values in array. The program…
A: Code and sample output 1 is provided in step2.
Q: Q3. Write a C++ program which will perform the following operations: • Declare and initialize an…
A: I have given the code for the question and attached the output screenshots.
Q: following values 5.5, 6.8, 7.2, 8.5, 9.5, 10.1, 11.2, 12.3, 13.4 Write a single python program and…
A: Given: A list of elements/values is given. Goal: A. To make student array with given values in…
Q: Short answer questions. 1. Write C++ statements to accomplish each of the following: (a) Output…
A: a) printf("%c",f[6]); Since the f array may be a character array, to show a part among this array…
Q: 8. Write statements to accomplish each of the following a. Display the value of the seventh element…
A: a) printf("%c", f[6]); here %c is for the character data type and 6 is the 7th index of array f…
Q: Create the following variables • a = 2.3; b = -87.3; • A = [1,2; 4,5]; Create a matrix 2 × 2 B using…
A: #include<iostream>#include<stdlib.h>using namespace std;int printRandoms(int lower, int…
Q: can you add some event in this program like 14 aug ,eid,christmas etc, Step 1 Program Plan:-…
A: Given question has asked to add event to a calendar like 14 aug , eid, christmas etc,
Q: 8. Write statements to accomplish each of the following a. Display the value of the seventh element…
A: Some statements are given and asked to write the coding statements for them. To display the value…
Q: Write C++ statements to do the following: i. Declare an empty aray DATA to hold 7 double floating…
A: Given: Required part 5,6,7
Q: Instructions NOTE: For this practical you may not use the standard array notation to access elements…
A: In this program, first, you need to take user input for number of elements of array means for size…
Q: Define the following arrays: a) empNum, a 100 -element array of ints b) pay Rate, a 25-element…
A: As per our guidelines we are supposed to answer only one question kindly repost other question as a…
Q: . Using one dimensional array create a java program that will compute SUM and AVERAGE of the given…
A: Here, for loop is used to compute the sum of array elements and then divide the sum by a number of…
Q: design and write one python code (this is one question one code » please don't say they are…
A: Here I have created arrays A and B, stored values using arange() method, and printed the content…
Q: 12.3 LAB: Array of squares - Iw/sw Given an array of four integers, write a program that populates a…
A: public static void main(String[] args) { int[] temp = {1,2,3,4}; for (int value : temp) {…
Q: Do question 14 and attach screenshot for output. Q11. Provide the output for the given C++ code…
A: NOTE: As requested we did the question 14. Given, The code is given in C++ programming language.…
Q: 2. An integer variable takes 4 Bytes of memory whereas a char variable takes 1 Byte of memory. You…
A: Write a C++ program to convert the given array of integers into a string in which the first…
Q: 1) Write, compile, and run a C++ program that specifies three one-dimensional arrays named price,…
A: 1. declare price, amount, total using a single dimensional array 2. Using for loop get values of…
Q: NOTE: For this practical you may not use the standard array notation to access elements within the…
A: The Selection Sort Algorithm sorts an array by repeatedly picking up the minimum element from the…
Q: Create a C # program that lets you keyboard 10 values into an array, but none of them should be…
A: code: using System;namespace Demo { class MyArray { static void Main(string[] args) {…
Q: Complete the following main program to calculate and print the sum of elements in the last three…
A: As no programming language is mentioned, the problem is solved using basic C++
Q: Instructions: Using an array, enhance the program that you have performed in the previous exercise.…
A: As the programming language is not mentioned here, we are using PYTHON here The code and output…
Q: Create two arrays of size 5 and then pass Those arrays to a function name merge that will merge/…
A: #include <iostream> using namespace std;//merge function defintionint merge(int a[],int b[]){…
Q: Problem #1 - Initializing and summing an array using for loops Write a program which creates a one…
A: As per our company guidelines we are supposed to answer only one question. Kindly repost other…
Q: Q4) Assume you have two arrays A and B where array A has 10 integer numbers and array B has five…
A: C++ Program for above : #include <iostream> using namespace std; int main() { //get…
Q: User-entered 20 element in float array the largest, smallest number and calculate the average and…
A: Program #include <stdio.h>int main() { int n, i; float num[100], sum = 0.0,…
Q: Please note global variables are not allowed to use in this assignment except of global constants.…
A: #include<bits/stdc++.h>using namespace std;void sortArray(int arr[],int n){…
Q: 1- Define an array of 10 components. 2- Initialize all components to zero. 3- Use suitable…
A: There are many languages which are used in today's wold. Computer language can be described as a…
Q: 1 function Write a program that will determine the discount of an item depending on its price and…
A: Write a program that will determine the discount of an item depending on its price and quantity.…
Q: 1. Declare an array alpha of 10 rows and 20 columns of type int. 2. Initialize the array alpha to 0.…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Create a function that computes the forward derivative: name: forward diff inputs: 3x double arrays…
A: Het there, I am writing the required solution for the above stated question.
Q: Problem #2 - Initialize an array and compute the average Write a program which creates a one…
A: Please refer below for your reference: Language used is C We cannot attach the file here so…
Q: Use C++ In part 1 you will be creating a quiz grading program. You will compare the student's…
A: Note : Before running the program you should paste the input file in the specific location.Then only…
Q: 12.3 LAB: Array of squares - Iw/sw Given an array of four integers, write a program that populates a…
A: According to the information given:- We have to create array of square with the help of Store Word…
Q: This is a C Program NOT C++ <3<3 This program will calculate the average of quiz marks for…
A: double get_marks(){ double sum = 0; for (int i = 0; i < 3; i++) { double num;…
Q: 4. Which one of these statements is False? a. None b. Array can be initialized using comma separated…
A: To do: which statement is false from the given
Q: In main, declare an array of size 20 and name it "randomArray." Use the function in step 2 to fill…
A: // C++ Program to shuffle a given array #include<bits/stdc++.h> #include <stdlib.h>…
Q: Given the declaration: int matrix[7][5]; a) How many elements does matrix have?…
A: "Since you have posted a question with multiple sub-parts, we will solve the first three sub-parts…
Q: Create a blank 10x10 integer array using constants for the row and column Create a function…
A: Programming instructions: Include required header files. Declare the function prototype. In the…
Q: Using the C++ programming language, you are required to solve the given problem. • Compile and run…
A: #include <iostream>#define MAX 100 int main(){int arr[MAX], n, i;int num, count;…
Q: Write C# statements to accomplish each of the following tasks: a. Display the value of the element…
A: Given: Write C# statements to accomplish each of the following tasks: a. Display the value of the…
Q: Write a program to help them analyze their data. Your program must contain parallel arrays: an array…
A: Introduction of the Program: The C++ program takes miles for every person for every day as input…
Q: Create a c++ program that will allow the user to input grades and check its average and rating.…
A: Find the required code in C++ and output:
Q: Pass Array to function. Write a C++ Program: Create two arrays of size 5 and then pass those…
A: Since you have not mentioned your id i am taking it as 10 Code: #include <iostream>using…
Q: Programming Language: C++ I really need help with this question and I keep getting repost answers.…
A: Files are read and written using streams in C++. The fstream library is required to work with files.…
Step by step
Solved in 3 steps with 3 images
- 02: Write C++ main program to perform the following: 1- Call a Function to read array A of two dimensional (3, 3) of type float. 2- Call a Function to display the content of two dimensional array A. 3- Call a Function to Find sum of secondary diagonal elements of the square matrix A and display the result.c++ Given the following array and output:int a[] = { 10, 5, -98, 3, 36}; Example Output -98 36 1. Write a few lines of code to calculate and print the minimum and maximum values of the array as displayed in the example output.Write C# statements to accomplish each of the following tasks: a. Display the value of the element of character array f with index 6. b. Initialize each of the five elements of one-dimensional integer array g to 8. c. Total the 100 elements of floating-point array c. d. Copy 11-element array a into the first portion of array b, which contains 34 elements. e. Determine and display the smallest and largest values contained in 99-element floating-point array w.
- 2. Task 1: Using Single-Dimensional Array Write a C program that will accept 10 input values and will store the values in array. The program will also identify and print the minimum, maximum and average of input values. NOTE:Your source code must display any of the given sample output below.It means your source code should be flexible enough to meet any of the given sample output.Your source code output must be identical to any of the given sample output.It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output. OUTPUT 1: Input Value 1: 50 Input Value 2: 20 Input Value 3: 35 Input Value 4: 100 Input Value 5: 75 Input Value 6: 89 Input Value 7: 5 Input Value 8: 11 Input Value 9: 85 Input Value 10: 60 MIN Value: 5 MAX Value: 100 AVG Value: 53 OUTPUT 2: Input Value 1: 10 Input Value 2: 9 Input Value 3: 8 Input Value 4: 7 Input Value 5: 6 Input Value 6: 5 Input Value 7: 4 Input…6. using c++, Write a function that counts the number of times an integer t occurs in an array of integers.2) For each of the following, write C++ statements that perform the specified task.a) Declare a built-in array of type unsigned int called values with five elements, andinitialize the elements to the even integers from 2 to 10.b) Declare a pointer vPtr that points to a variable of type unsigned int.c) Write two separate statements that assign the starting address of array values to pointervariable vPtr.d) Use a for statement to print the elements of array values using pointer/offset notation.e) Refer to the fifth element of values using pointer subscript notation.f) Assume that unsigned integers are stored in two bytes and that the starting address of thearray is at location 1002500 in memory.• If vPtr points to the first element of array values, then what address is referenced byvPtr + 3? (manually calculate)• What value is stored at that location?
- C++ and the focus is on Pass by Reference: The following steps are essentially under the same problem but in order to complete a step, the previous must be completed first. For example, Step #3 cannot be completed unless Step #1 has been conducted. Step #1: Create a function to output the values of an integer array. You will have two parameters: the array and the number of elements to display. Step #2: Create an array of integers of 100 elements. File the array with the values 1 to 100 Step #3: Call the function in step 1 to print 6 elements starting at element 0 Step #4) Call the function in step 1 to print 6 elements starting at element 12. Step #5) Write a swap function that will swap two integer parameters that are passed in by reference. Step #6) Use the swap function to swap the elements in the 100 element array at element 0 and 5. Display the first 8 elements in the array (using the function in step 1)Do question 15 Q11. Provide the output for the given C++ code about pointers. #include <iostream>using namespace std;int main(){char *ptr;char Str[] = "abcdefg";ptr = Str;ptr += 5;cout << ptr;return 0;} Q12. Provide the output for the given C++ code about arrays. #include <stdio.h>#include<iostream>using namespace std;int array1[] = {1200, 200, 2300, 1230, 1543};int array2[] = {12, 14, 16, 18, 20};int temp, result = 0;int main(){for (temp = 0; temp < 5; temp++){result += array1[temp];}for (temp = 0; temp < 4; temp++){result += array2[temp];}cout << result;return 0;} Q13. Provide the output for the given C++ code about arrays. #include <stdio.h>#include<iostream>using namespace std;int main (){int array[] = {0, 2, 4, 6, 7, 5, 3};int n, result = 0;for (n = 0; n < 8; n++){result += array[n];}cout << result;return 0;} Q14. Provide the output for the given C++ code about arrays. #include <stdio.h>#include <iostream>using…Pass Array to function. Write a C++ Program: Create two arrays of size 5 and then pass those arrays to a function named merge that willmerge/combine both values of array into one single array (third array). Now, Write a description/Explanation Of this Program that, how it's working.
- 2. Examine the following code segment. What will be printed?If there are any errors, indicate the nature of each error.float x[4] = {6.1, 7.5, 1.5, 0.23};float *y;y = & x[1];cout << x[1] << x[0] << *y << *(y+2) << endl;3. Write C++ statements to define and initialize the following arrays. a. Array heights of 10 components of type double. Initialize this array to the following values: 5.2, 6.3, 5.8, 4.9, 5.2, 5.7, 6.7, 7.1, 5.10, 6.0. b. Array weights of 7 components of type int. Initialize this array to the following values: 120, 125, 137, 140, 150, 180, 210. c. Array specialSymbols of type char. Initialize this array to the following values: '$', '#', '%', '@', '&', '!', '^'. d. Array seasons of 4 components of type string. Initialize this array to the following values: "fall", "winter", "spring", "summer".USE C++ The Malaysian Ministry of Health published data on the number of deaths by disease type. There are two types of diseases: dengue and malaria. Write a complete C++ program to accomplish the following tasks: Task 1: Declare parallel arrays in the main function to store the following types of information: a) The year. b) The mumber of deaths caused by each disease type (dengue and malaria). Task 2: Write a function named "readInput". a) This is a non-retuming function. b) It receives parallel arrays defined in Task 1. c) The function should assign the required values to each element of the parallel arrays by reading the data from the text file named "input.txt". The file includes the year as well as the mumber of deaths caused by dengue and malaria. Figure lis the content of the "input. txt" file. Please ensure that the program only contimues reading the file if it is successfully opened; otherwise, print the error message and exit the program. Figure 1: 2007 82 18 2008 112 30…