Write a program that reads 5 numbers from the user and store them in an array. Then you have to compute the square and cube of each number and store them in different arrays. Having computed the square and cube of the numbers, print each number with its square and cube value. Your program should include a function called get_square_cube, which will compute the square and the cube values of the numbers and store each in a different array.
Q: Q2) Write a program to take 10 integer inputs from user and store them in an array. Then, create a…
A: #include <iostream>using namespace std; int main(){ // declaring variables int…
Q: Write a function count_num_times () that searches for a given number in the input array. The…
A: A function is a collection of program statements into a group and it is called with the name of the…
Q: Write a program to read as many test scores as the user wants from the keyboard (assuming at most 50…
A: The required C++ code for given problem is: #include<iostream>using namespace std;void…
Q: Write a program that lets the user enter the total rainfall for each of 12 months into an array of…
A:
Q: Write another separate function in the same program above that takes the array…
A: Given that write a function that takes the array above {7,3,7,7,7,5,2,7} and loops through the…
Q: Given an integer array of positive single digit values such as: int a[) = {8,4,2,6,9}; 1) Write a…
A: The objective of the given problem is to create a recursive function that concatenates all array…
Q: Write a function that partitions the array into two subarrays: one with all even integers, and the…
A: Python does not have built-in support for Arrays, but Python Lists can be used instead. In Python,…
Q: You are given some array called "ar1" that contains (2 * n) elements in the arrangement of [x,…
A: Required: In python, Required code with comments for explanation and screenshot of both code and…
Q: Is program will make use of two arrays, each of which can contain 6 integers, Write a program that…
A: #include <iostream>using namespace std; void inputData(int array[6]) { for(int i = 0; i <…
Q: Rajesh is new in the program and just now he is familiar with the array in programming and he wants…
A: As per the given problem statement we have to develop a code in C++ to help Rajesh solve the task…
Q: Write a function print3days() that receives an integer X as its argument. X corresponds to the day…
A: Here there is no language is mentioned, so I have given C code to perform the given question.
Q: Write a program that display the position of a given element in an array. You should print the index…
A: Below is the java program with screenshots of output.
Q: Write a program that prompts the user to enter an integer value in an array, and user can also print…
A: I give the code in Java along with output and code screenshot
Q: Write a program that allows the user to enter name and grade until “QUIT" is entered for name. The…
A: Please find the answer below :
Q: Write a function set_zero() that takes a numpy array and a limit number as parameters. Set the items…
A: In step 2, you will the python code.In step 3, you can see the sample output.
Q: create a program of multidimantional array and let user enter the values of arrays and then dispaly…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Write a program that uses a two-dimensional array to store the highest and lowest temperatures for…
A: In the sample output, you have printed the highest and the lowest temperature but in points e and d…
Q: Write a program that will find the largest even number and the average of odd numbers from an array.…
A: Include necessary headers into program. In main(), declare the array and get the input from user. In…
Q: Write a program that creates an integer array of size 10 and fills the array with values set by the…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output int…
Q: Write a program to read an array 7x7 , (choose your own numbers ) and write a function to return the…
A: Lets see the solution.
Q: Write a program that prompts the user to enter integers, finds the largest and smallest integers and…
A: "Since you have not mention any programming language, so will write our program in C language." C…
Q: Write a program to read an array 7x7 , (choose your own numbers ) and write a * .function to return…
A: CODE:- #include<iostream>using namespace std; #define N 7#define M 7 int sumOdd(int…
Q: Rajesh is new in the program and just now he is familiar with the array in programming and he wants…
A: Algorithm: 1. Take input from the user 2. Run a loop to take input array 3. Pass through the…
Q: Write a program which can be used to calculate bonus points to given scores in the range [1..9]…
A: The complete code is given below with code and output screenshots As the programming language is not…
Q: you need to insert only the even index values to an array named intArray[]. Now send that array to a…
A: In this program we have to write a C program where we have to Take user input with number of array…
Q: Write a program that uses a two-dimensional array to store the highest and lowest temperatures for…
A: #include <iostream>#include <fstream>#include <cstdlib>#include…
Q: Write a program which does the following (name-xxx_and_xxx_lab2): 1) Create a 2 dim array containing…
A: Solution: Code: public class TwoDimArrA { public static void main(String[] args) { // two…
Q: Write a program that repeatedly prompts the user to entera capital for a state. Upon receiving the…
A: Program Planning Assume that 10 states and their capitals are stored in a two-dimensional array.…
Q: Write a program in which the main function reads an integer array data_items of size 10 and an…
A: As no programming language is mentioned, writing this program in c++ #include…
Q: Write a program that calculates the multiple body mass index (BMI) where the program read multiple…
A: As per the given question, we have to design a C program for calculating BMI for multiple inputs.…
Q: Rajesh is new in the program and just now he is familiar with the array in programming and he wants…
A: Algorithm: 1. Take input from the user 2. Run a loop to take input array 3. Pass through the…
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: write a program that define 2 arrays of 10 students, one for names and the other for marks (0-20).…
A: Logic: Run a loop for all array elements Calculate sum of student marks consider first…
Q: Write a program which asks user to enter total number of customers who have bought fruits today,…
A: The given problem is to be solved as a program where the user will ask the total number of customers…
Q: Write a program which takes 2 arrays of 10 integers each a and b. c is an array with 20 integers.…
A:
Q: to pass an integer array of 10 elements to a function which returns the same array after sorting it…
A: the code : #include <stdio.h> // Sorting function - Bubble sortvoid Sort(int arr[], int n){…
Q: Write a program which allow user to enter a number that represents repetition. Then, the user will…
A: C++ Program for above : #include <iostream> using namespace std; int main() { cout…
Q: Write a function that takes a one-dimensional array and its size [10], and then fill each location…
A: //note: since programming language is not specified we are providing answer in cpp #include…
Q: Write a program that asks for the user’s first, middle, and last names. The names should be stored in…
A: Note: Below is the required program in the C++ language. Program Approach: Including a necessary…
Q: Write a recursive arrayToN function which returns the concatenation of all array values as an…
A: #include <stdio.h>#define MAX_SIZE 100 /* Function declaration */void arrayToN(int arr[], int…
Q: A text file has been included in the project. Instead of initializing the array (like the problem in…
A: Answer: C++ Source Code: #include<iostream>#include <fstream>using namespace std;int…
Q: Write a program to read as many test scores as the user wants from the keyboard (assuming at most 50…
A: Required: Write a program to read as many test scores as the user wants from the keyboard…
Q: Rajesh is new in the program and just now he is familiar with the array in programming and he wants…
A: Algorithm: 1. Take input from the user 2. Run a loop to take input array 3. Pass through the…
Q: Write a program, which creates an array of N elements of type integers. Create a function int…
A: Below is the JAVA program to find minimum element of an array using function int findmin(int arr[],…
Q: Write a program that take 10 values as input in an array, calculate its average, print that array…
A: THIS IS A MULTIPLE QUESTION BASED PROBLEM. ONLY FIRST PART IS SOLVED. KINDLY SEND THE REMAINING…
Q: Write a program that receives a character array from the user and calculates Total characters,…
A: /*Program: Count characters, spaces, upper_case and lower_case of a string*/ //include standard…
Q: Extend the program belowso that after closing the files, program asks the user to enter a name. The…
A: Programming instructions: Declare the required variables. Take input from the user. Use a loop to…
Q: Write a program that creates array of 10 integers. Ask the user to enter the data in the array. Each…
A: //note: since programming language is not mentioned we are providing answer in cpp #include…
Q: Write a program that uses a two-dimensional array to store the highest and lowest temperatures for…
A: #include <iostream>using namespace std; void getData(string months[12], int temp[12][2]) {…
Q: Please write a program to get an array of names from the user, then input one name from user, and…
A: Given Data to write a Java program, The requirement is to use at least 3 functions including the…
Write a program that reads 5 numbers from the user and store them in an array. Then
you have to compute the square and cube of each number and store them in different
arrays. Having computed the square and cube of the numbers, print each number with
its square and cube value.
Your program should include a function called get_square_cube, which will compute
the square and the cube values of the numbers and store each in a different array.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions: Part a: Function getData: This function reads and stores data in the two- dimensional array. Part b: Function averageHigh: This function calculates and returns the aver- age high temperature for the year. Part c: Function averageLow: This function calculates and returns the average low temperature for the year. Part d: Function indexHighTemp: This function returns the index of the highest high temperature in the array. Part e: Function indexLowTemp: This function returns the index of the lowest low temperature in the array. (These functions must all have the appropriate parameters.) #include <iostream> using namespace std; const int NO_OF_MONTHS = 12; void getData(int twoDim[][2], int…Write a program that uses a two-dimensional array to store the highest andlowest temperatures for each month of the year. The program shouldoutput the average high, average low, and the highest and lowest temperaturesfor the year. Your program must consist of the following functions:a. Function getData: This function reads and stores data in the twodimensionalarray.b. Function averageHigh: This function calculates and returns theaverage high temperature for the year.c. Function averageLow: This function calculates and returns the averagelow temperature for the year.d. Function indexHighTemp: This function returns the index of thehighest high temperature in the array.e. Function indexLowTemp: This function returns the index of thelowest low temperature in the array.In statistics the mode of a set of values is the value that occurs most often. Write a program that determines how many pieces of pie most people eat in a year. Set up an integer array that can hold responses from 30 people. For each person, enter the number of pieces they say they eat in a year. Then write a function that finds the mode of these 30 values. This will be the number of pie slices eaten by the most people. The function that finds and returns the mode should accept two arguments, an array of integers, and a value indicating how many elements are in the array.
- Write a program that will read the monthly salary of 10 employees and then calculates the income tax (i.e, 10% of the salary) and net salary. Hence you have to declare an array salary[10][3]. Your program should have 4 functions. The first function will be used to read monthly salary of 10 employees and put it in the first column of the array. The second function will be used to calculate the income tax for each employee and then store it in the second column of the array. The third function will be used to calculate the net salary of each employee and store it in the third column of the array. Finally, the fourth function will be used to display the gross salary, income tax and net salary for each employee. You must pass the array as reference in each function you used.Write a program that stores first n prime numbers in a two-dimensional integer array. You should ask user to input row and column values of two-dimensional array. You should also write a function isPrimeNumber to check whether a number is a prime number or not. First n prime numbers should be found by multiplying row and column values entered by a user. Finally display the two dimensional array in a pretty form in reverse order of prime numbers. Note: You should NOT use built-in functions (except the most common ones) for finding prime numbers or displaying results.Write a program that creates a 2D array of integers of size nXn initialized with test data.The program should have the following functions:● getTotal. This function should accept a 2D array as an argument and returnthe total of all the values in the array.● getAverage. This function should accept a 2D array as an argument and returnthe average of all the values in the array.● getRowTotal. This function should accept a 2D array as the first argument andan integer as its second argument. The second argument should be the subscriptof a row in the array. The function should return the total of the values in thespecified row.● getColumnTotal. This function should accept a 2D array as the first argumentand an integer as its second argument. The second argument should be thesubscript of a column in the array. The function should return the total of thevalues in the specified column.● getHighestInRow. This function should accept a 2D array as the firstargument and an integer as its second…
- In statistics the median of a set of values is the value that lies in the middle when the values are arranged in sorted order. If the set has an even number of values, then the median is taken to be the average of the two middle values. Write a function that determines the median of a sorted array. The function should take an array of numbers and an integer indicating the size of the array and return the median of the values in the array. You may assume the array is already sorted. Use pointer notation whenever possible.Write a program for the following information: Year has 365 days. You create array for temperature of each day in a year. Assign random temp values range of 30-110. Using a function Search in the array do you have 100 degree and what days. Print how many days and what days. Also print the Temp array in nice format in a function. Sample outputCreate an array of N integers. Ask from the user how many elements he/she wants to input in the array. Determine the following: (you may define a function for each item below) sum of all numbers INPUTTED the average of all numbers, count how many are EVEN numbers(excluding zero), how many are odd numbers and how many zeroes were inputted? At the end, print the accumulated and counted values (for items a-e given above) In the array.
- 1.Enter a positive integer value n (6 <= n < 30) and take n integers from the user as input and store them in array a. Then move the elements of this array one step to the left and make the first element of the array the last element of the array. Shift this array with a function. Display integer value n, the array elements in original order and the array elements in modified order (after shifting). For example, if the original order of the array a is like below : a: 33 45 67 89 12 7 After shifting one step to the left, you should get the following order of the array а: a: 45 67 89 12 7 33Program - python Create an array of 10 integers and pre-populate it with 10 numbers. Then write a function called printit which will loop through the array and print the values out. Call the function to show it works. Now write another function called finditem and pass it the array and a number to find, call the function which should return a boolean if it's found or not. Test it out on the number 50. If the number fifty is in your array it should print True otherwise false.Write one program that does the following: Ask the user for ten (10) grades, and store the data in an array. Compute the average of all the grades. Print the original ten grades and the average. Declare an integer array with the name of “grades” of size 10 in the main function. Create a function called “getGrades” that prompts the User for the grades and puts them in an integer array. The function will receive an integer array and the size of the array. In the function prototype and the function header, call the array “gradeArray” and call the size of the array "size." iii. Create a For Loop that cycles through each cell of the array. At each cell prompt the User for a grade. Store the grade entered by the User into the array cell. From main, send this function the array called “grades” and the size of the array. Create a function called “computeAverage” that computes the average of an array…