(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's numbers on one line, each number followed by one space.
Q: Consider the following two-dimensional array declaration: int [ ][] list = new int[row][ ]; a. Write…
A: a. list.length gives the length of main array.
Q: 5. Identify which of the following array declaration are invalid. If a declaration is…
A: According to C programming language, written valid and invalid statements.
Q: 4. Write function to copy the elements of one array into another array.
A: public class Main { public static void main(String[] args) { //testing //create array…
Q: What will be the array S, after execution of the following statement? SDB 3.2 DUP (0,2).9.2…
A:
Q: Q1) Write a program to read the values of an array 13*12 , and then display the square root of the…
A: #include <stdio.h> int main(){ int arr[13][12],i,j,k; printf("Enter the elements of…
Q: 6- Write a program to read and print a 3 by 3 array. Replace the main diagonal elements with zero.
A: Here since programming language is not defined, solving it in c++ Algorithm Start var matrix[3][3]…
Q: 2- Create the following array using ones, zeros and eye commands: [10001 11 1 1 01001 A = 0010: 11…
A: eye creates an identity matrix of specified size and here in our case it is 4x4. ones creates a…
Q: What is the output of following code segment ? int[] a = { 9, 16, 25, 1, 4};…
A: The given code segment: int[] a = { 9, 16, 25, 1, 4};Arrays.sort(a);System.out.print(…
Q: 2. Find how many numbers that are divisible by 11 in the array? And specify their locations and…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: Declare and create a 4 × 6 × 5int array.
A: Multi dimensional Array : collection of similar data type, where as multi dimensional array is also…
Q: 6. Rewrite the example 5 to print the array in reverse order.
A: In this C++ program, we will reverse the sequence of array elements. After reversing first element…
Q: 4. Write the JS Code for the following Programs? • Find the Factorial of the input Number when the…
A: Factorial of a number:- // program to find the factorial of a number // take input from the…
Q: 3) the command 'max' is used to: a. Can return the maximum number and its index in an array! b. find…
A: you answer is given below:
Q: Correct the errors in the following statements. Each row in a one-dimensional array could be…
A: Given: Each row in a one-dimensional array could be treated as a two-dimensional array.
Q: Write a program that takes characters of your name and saves it in array and then displays your name…
A: A required C++ program is as follows, #include<iostream> using namespace std; int main() {…
Q: What is the array index type? What is the smallest index? What is the representation of the third…
A: Index type of an array The index type of an array is an integer. An integer is a number without the…
Q: - Create a 6 by 8 array of random integer numbers ranged from -35 to 70, - Find how many -ve numbers…
A: The answer to the following question
Q: Consider the following code and answer the questions. int ary[] = (5, 2, 7, 1, 9, 8, 3, 4); QA: What…
A: what is the starting index of ary? 0 what is the last index of ary? 7
Q: (a) (i) What is an Array? (ii) What is the difference between an array and a simple variable? b) For…
A: Array is an inbuilt datastructure which stores collection of same type of variables. Like: int…
Q: what would be the content of the array after we remove a value
A: When a value is removed from a heap, then it is replaced by its inorder successor and then again the…
Q: What is the value stored in arrays text1 and text2 after executing the following code segment?
A: The given is a C++ code snippet where the user is required to input two strings and the…
Q: Wap to input 10 numbers from the user and find out all prime numbers are also installed them at one…
A: PROGRAM CODE: #include <iostream> // include header file for input output stream…
Q: what is the output of following java code segment
A: The given assignment has a code snippet written in java language and the requirement is to find the…
Q: Given the following array and output: int a[] = { 10, 5, -98, 3, 36}; Example Output -98 36 1.…
A: Note: In this question, the coding language is not specified then we are doing this question in the…
Q: Write down the code to traverse the array until X located
A: #include <stdio.h> // Function to traverse and print the arrayvoid printArray(int* arr, int…
Q: 1. Write a program that adds up two 4x4 arrays and stores the sum in third array.
A: As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: 66. Given the following code segment, write Java code to read 10 numbers into the array named…
A: logic:- use for loop to iterate input statement. I.e for(int i=0;i<10;i++)…
Q: Indicate true or false for the following statements: Every element in an array has the same type.…
A: 1.he array size is fixed after it is created.The statement is False ExplanationThe above statement…
Q: int ary[] = {5, 9, 4, 2, 6, 7, 8, 4}; Q A: What is the starting index of ary Q B: What is the last…
A: The detail answer is given below.
Q: int ary[] {5, 2, 7,3,9,1,6, 8, 4}; %3D Q A: What is the starting index of ary Q B: What is the last…
A: int ary[ ] = {5, 2, 7,3,9,1, 6, 8, 4}; Q A: What is the starting index of ary Q B: What is the…
Q: Find the Factorial of the input Number when the Input Number is Odd? Find the Sum of Array Contents?…
A: An algorithm to find the Factorial of the input Number when the Input Number is Odd is given below:…
Q: Q5: Write a program to input float type data into a 2D array having 5 rows and 4 columns. Find out…
A: Declare an array Input the values Initialize a variable max with first element of array Compare the…
Q: int ary[] = {5, 2, 7,3,9,1,6, 8, 4}; %3D Q A: What is the starting index of ary Q B: What is the…
A: Answer: A. 0 B. 8 C. The statements are shown below. for(int i=1;i<7;i++){…
Q: 4. Write the code to create the following ragged array, given the following table. 3 7. 9. 4. 7. 8.…
A: PROGRAM CODE: public class Main { public static void main(String[] args) { // Declaring…
Q: Assume you have the following declaration char nameList[100]; Which of the following ranges is valid…
A: Given declaration is, char nameList[100]; The range of this declaration is 0 to 99. Because the…
Q: 3.b. How can you initialize an one dimensional array? Write a program to search an element in…
A: There is this one way to initialize one - dimensional array is at the time of declaration Here is a…
Q: How do you access elements of an array? Can you copy an array x to y using y =x? 3.3 Is memory…
A: Access Array elements You can access elements of associate degree array by indices.Suppose you…
Q: Write a program to input n number of elements in an array, increment each by 1 and display the…
A: As no programming language is mentioned, using c++.
Q: Enter values from the keyboard into a 3x5 array, find line totals, and print them on the screen. The…
A: Given, The size of array is 3×5 i.e., the array contains 3 rows and 5 columns. The output format: 1…
Q: Consider the following code and answer the questions. Q A: What is the starting index of ary Q B:…
A: Required:
Q: Create a 6 by 8 array of random integer numbers ranged from -35 to 70, - Find how many -ve numbers…
A: C++ Program #include <iostream>#include <stdio.h>#include <stdlib.h>#include…
Q: Input any numbers saved in the array, output the maximum and the minimum.
A: Language is one of the most widely used programming language which has been used to create different…
Q: Q2: Create an array of integers of size 5 and take values from the user.(c++) a. Find the largest…
A: Code: #include<iostream>using namespace std;int main (){ int arr[5], i, max, min; cout…
Q: Given the following array and output: int a] = { 10, 5, -98, 3, 36}; Example Output -98 36 1. Write…
A: I have given an answer in step 2.
Q: Write code to do the following: 1. Initialize a partially filled array named months that can store…
A: #include<iostream>using namespace std;//Output function declarationvoid Output(char…
Q: What is wrong with this code? (choose one answer only) int [ ] =(1, 2, 3, 4, 5); a) The array size…
A: Given: What is wrong with this code? (choose one answer only) int [ ] =(1, 2, 3, 4, 5); a) The array…
Q: How do you access elements of an array? Can you copy an array a to b using b = a?
A: To check if the copying of an array a to b using b = a is possible or not no, copying an array a to…
Q: Q15)- write programs to summation of each row in the array with size 4 by 4
A: algorithm:- take input in matrix 4 by 4 once done use nested loop to find summation of each loop.…
Q: int ary[] = {5, 2, 7,3,9,1,6, 8, 4}; Q A: What is the starting index of ary Q B: What is the last…
A: The given array is: int ary[] = {5, 2, 7, 3, 9, 1, 6, 8, 4}; Q A: Array indexing start from 0 so the…
help with coding
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Q1: Write a program that creates an array of integers size 10. And do the following- a) Ask the user to enter 10 numbers (all > 0) one by one and store them in the array. If user enters a number < 0 then program should ask user to enter the number again with a message that "Pl enter a number > 0" b)Print the smallest number c) Print the largest number d)Print the averageWhat is the value of J[2][1] in the following array declaration? int[][] J= {{5, 10 }, {15, 20, 25}, {30, 35}}; a. 20 b. 30 c. 35 d. 15What will be the contents of the a array after the following statements are executed? [8] int a[MaxSize] ={9,2,21,10,12,6,5,8,17}; int *p=&a[0],*q; q = p+MaxSize-1; ; int solution = 0; while(p<=q) { solution += *p%2 == 0? *p: 0; p++; }
- What is wrong with this code? (choose one answer only) int [ ] =(1, 2, 3, 4, 5); a) The array size must be specified in the square brackets. b) The parentheses should be square brackets. c) The square brackets should be curly braces. d) The parentheses should be curly braces.Consider the int Array below and determine the values of A and B so that Array[0] has an integer in the range [-23, 71] Array[0] = A + rand() % B;What is the value of scores[2][3] in the following array? int [] [] scores = { {88, 80, 79, 92}, {75, 84, 93, 80},{98, 95, 92, 94}, {91, 84, 88, 96} };
- (1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's numbers on one line, each number followed by one space. Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 142.0 Enter weight 4: 166.3 Enter weight 5: 93.0 You entered: 236.0 89.5 142.0 166.3 93.0 (2) Output the total weight, by summing the array's elements. (3) Output the average of the array's elements, with 2 decimal places. (4) Output the max array element. Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 142.0 Enter weight 4: 166.3 Enter weight 5: 93.0 You entered: 236.0 89.5 142.0 166.3 93.0 Total weight: 726.8 Average weight: 145.36 Max weight: 236 Code: import java.util.Scanner; public class PeopleWeights { public static void main(String[] args) { /* Type your code here. */ }}Analyze the below code and fill in the blanks to complete the code #include <stdio.h> int main() { int Array200[2][4]={{10,20,30,40},{11,21,31,41}}; int Array100[___][___]={{1,2,3,5,6},{8,9,10,11,12},{10,20,30,40,50}}; for (int a = 0;a < 2; a++) { for (int b = 0;b < 4; b++) { printf("Array200[%d][%d] = %d \n",a,b, Array200[a][b]); } } for (int c = 0;c < __; c++) { for (int d = 0;d < __; d++) { printf("Array100[%d][%d] = %d \n",__,__, Array100[__][__]); } } }- Create a 6 by 8 array of random integer numbers ranged from -35 to 70, - Find how many -ve numbers in the array? - Multiply the array by -5 - Find the location of maximum and the minimum number in the array - List the contents of the array in matlap
- Return an integer array containing only the values from the input array that are larger than the threshold value. The relative order of the values should not be changed. threshold([1, 2, 3, 4, 5], 3) → [4, 5]threshold([5, 4, 3, 2], 0) → [5, 4, 3, 2]threshold([20, 1, 19, 3, 22, 4], 15) → [20, 19, 22] public int[] threshold(int[] nums, int threshold) { write code in here using this outline}(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's numbers on one line, each number followed by one space. (2 pts) Ex: Enter weight 1: 236 Enter weight 2: 89.5 Enter weight 3: 142 Enter weight 4: 166.3 Enter weight 5: 93 You entered: 236.0 89.5 142.0 166.3 93.0 (2) Also output the total weight, by summing the array's elements. (1 pt) (3) Also output the average of the array's elements. (1 pt) (4) Also output the max array element. (2 pts) Ex: Enter weight 1: 236 Enter weight 2: 89.5 Enter weight 3: 142 Enter weight 4: 166.3 Enter weight 5: 93 You entered: 236.0 89.5 142.0 166.3 93.0 Total weight: 726.8 Average weight: 145.35999999999999 Max weight: 236.0Write an application that stores the following nine integers in an array: 10, 15, 19, 23, 26, 29, 31, 34, 38. Display the integers from first to last, and then display the integers from last to first.