Write a program that should ask the user to input 12 elements (positive whole numbers) inside the array and then it will sort the even numbers in ascending order and odd numbers in descending order. If the user's input is not a positive whole number, then prompt "ERROR! Please input a positive whole number only. Sample Output: Input: 1 18 15 17 14 25 30 77 48 52 64 89 Even Numbers: 14 18 30 48 52 64 Odd Numbers: 89 77 25 17 15 1
Q: Write a program that prompts the user to enter 50 integers and stores them in an array. The program…
A: Program code: //include the required header files #include <iostream> #include…
Q: Write a program that read from user an array, called tab, of 5 integers and: 3. Displays the maximum…
A: Sample Response: //Java programimport java.util.*;//class definitionpublic class LargestInArray{…
Q: Write a program that generates 100 random integers between 100 and 1000 inclusive and displays the…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and also provided OUTPUT…
Q: A positive integer is called a perfect number if it is equal to the sum of all of its positive…
A: In the thread we use the isPerfectNumber() function to check a number is perfect or not.and then we…
Q: Write a program to find the value in an integer array all of length N that occurs at least (N/2 + 1)…
A: #include<stdio.h> #define MAX_SIZE 5000 int main(void) { int N; //Declare an array…
Q: Write a program that reads 10 integer numbers and store them in an array of size 10. Your program…
A: Program Approach: Importing necessary package Defining the main class Defining the main method…
Q: Write a program that reads 10 integers into an array, computes the average, largest, and smallest…
A: code in C++: #include <iostream> #include <bits/stdc++.h> using namespace std;…
Q: Write a program that accepts a series of numbers, stores the numbers into an array, writes the…
A: - We will have one array which will take the numbers we want and then accordingly the operations…
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: Implement the following method to sort the columns in a twodimensional array. A new array is…
A: A Java program is as follows, “Sample.java” import java. util. Scanner; public class Sample {…
Q: Write a program, which creates an array of N elements of type integers. Output and display how many…
A: Solution :
Q: Given an array A[] of N elements. The task is to count number of even and odd elements in the array.…
A: #include <bits/stdc++.h>using namespace std; // } Driver Code Ends//User function Template…
Q: Write a program that reads a list of integers, and outputs the two smallest integers in the list, in…
A: import java.util.*;public class Main{public static void main(String[] args) { int…
Q: Write a program that will read 15 integers from the user into array num. your program should count…
A: Program description: n is a user input integer variable. num is an integer array of size 15.…
Q: Write a program to shift all the zero present in the array in the alternative order, For example.…
A: Include Header files Declare an array A[] initialized with values using for loop reorder the given…
Q: Write a program that randomly fills an array of integers andthen sorts it. The array size is entered…
A: Objective: This program fills an array with random integers (-1, 0, 1) and sorts the array.…
Q: Write a program to enter 10 numbers using keyboard and put them in an array. Now generate another…
A: since you have not mentioned the programming language in your question. I will attempt this in C++.…
Q: Write a program that asks the user to input 8 numbers and save them in g 2D array with 4 rows and 2…
A: Required:
Q: Write a program that sorts a given array by using Bubble Sort. Then, find out the index of the input…
A: A function bubble_sort(int*) is used for sorting the array using bubble sort. A function…
Q: Create a two dimensional array that can store below values in same rows and columns. Get value from…
A: The required Python code for given problem is: n=int(input("Enter the value of n: ")) # read…
Q: import math array = [4, 5, 6, 7, 8, 9, 33, 24, 15, 11] print("Original array") print(array)…
A: The code given is:- import math array = [4, 5, 6, 7, 8, 9, 33, 24, 15, 11] print("Original array")…
Q: Write a program that will ask the user to enter the size of the array n < 100. Once the array size…
A: Step 1 : initialize a size variable and ask user to enter size of array in size Step 2 : declare the…
Q: Write a program that works as follows. Declare an array A of integers of size 10 and fill the array…
A: Required C++ code given Below:
Q: Write a program that creates an array of integers sine 10. And do the following
A: a)a=[]while True: if len(a)==10: break else: k=int(input("Enter a number greater…
Q: Write a program that creates and initializes an array with the following four values: 2.3, 4.5, 8.0,…
A: Array indexing starts from 0 Use one for loop which takes values from 0 to 3 and in the other loop…
Q: Write a program that: 1. Prompts the user to enter an integer representing the size of an array of…
A: Lets see the solution.
Q: Please write a program that will generate an N-element array, where N is a random value taken from…
A: The program is written in C#. Check the program screenshot for the correct indentation. Please check…
Q: Please use C++ Write a program that should ask the user to input 12 elements (positive whole…
A: for sort in ascending data to use function std::sort() code : #include<iostream> using…
Q: Write a program that generates 100 random integers between 100 and 1000 inclusive and displays the…
A: Program: #include <iostream>using namespace std;int main() { srand((unsigned) time(NULL));…
Q: Write a program that first reads an integer for the array size, then reads numbers into the array,…
A: #include<stdio.h> int main() { int a[N],i, even=0, odd=0; printf( "Enter %d integer…
Q: Write a program that populates an integer array size 10 with random digits in the range [1,9]. The…
A: rand() generates random number from 0 to 32767 To make it from 0 to 8 you can use modular operation…
Q: Write a program that will input 5 numbers (double type) and display the numbers, their sum and…
A: Here I have created an array of type float with size as 5. Next, I have taken input from the user…
Q: Write a program that create a 5-by-6 array. All elements in the array are random integer numbers…
A: Program is below with output and commented explanation.
Q: Write an application program that could be used to find the numbers divisible by 30 stored in a…
A: Computer Programming: Programming is the procedure of forming a set of instructions that directs a…
Q: 1. Write a program that fils an array with 10 random integer values between O and 100, your program…
A: As per bartleby policy, we can only answer 1 part per question. Please post rest sub parts in…
Q: Write a program to enter 10 numbers using keyboard and put them in an array. Now generate another…
A: #include <iostream>using namespace std;int main(){ int arr[10]; char arr2[10];…
Q: Write a program that creates an array of N names. Each name has 5 exam scores. Output the names with…
A: The question is to write the C code for the given problem.
Q: Write a program that declares an array of 10 numbers, and then read 10 single digit numbers nto the…
A: program that declares an array of 10 numbers, and then read 10 single digit numbers into the array…
Q: Write a program that reads 10 integers stored in an array and an integer, counts the occurrence of…
A: Let us see the answer - Introduction- Array- Instead of defining distinct variables for each item,…
Q: Write a Numpy program to create an array of elements of size 51 with largest element si is 185 and…
A: Required:- Write a Numpy program to create an array of elements of size 51 with the largest element…
Q: Write a program that first reads an integer for the array size, then reads characters into the…
A: #include<iostream>using namespace std;void Consonant(char x[], int s){ for(int…
Q: Write a program that will rearrange and print an array of positive integers entered by the user. The…
A: C++: C++ is an object oriented programming language that was developed as an extension of…
Q: Write a program that: 1. Prompts the user to enter an integer representing the size of an array of…
A: Lets see the solution.
Q: Write a program that declares an array of 15 integers and reads the values from the user. Make sure…
A: Given: Write a program that declares an array of 15 integers and reads the values from the user.…
Q: Write a program that prompts the user to enter 50 integers and stores them in an array. The program…
A: Program Plan:- 1. Initialise all the required header files. 2. declare the array of 50 numbers. 3.…
Q: Write a program that takes input 10 integer numbers and stores in an array. Afterward, count the…
A: Start. Check the array indexes if they have same number. If yes then increase the index and check…
Q: Write a program that will ask the user to input the number of rows and columns in an array. To fill…
A: Here I have taken input from the user and stored it into different variables. Next, I have created…
Q: Write a program that prompts the user to enter 50 integers and stores them in an array. The program…
A: A program is to be written in such a way that it takes prompts the user to enter the 50 integers.…
Q: Write a program that does the following: 1. prompts the user to guess a letter in a hard-coded word…
A: Start Declare an empty list of letters Initialize word with "Kookaburra" Ask the user to enter a…
Write a program that should ask the user to input 12 elements (positive whole numbers) inside the array and then it will sort the even numbers in ascending order and odd numbers in descending order. If the user's input is not a positive whole number, then prompt "ERROR! Please input a positive whole number only.
Sample Output:
Input: 1 18 15 17 14 25 30 77 48 52 64 89
Even Numbers: 14 18 30 48 52 64
Odd Numbers: 89 77 25 17 15 1
Step by step
Solved in 2 steps with 3 images
- Write a program that will ask the user to enter the size of the array n < 100. Once the array sizeis validated, it is required that the user will enter the elements of the array. Finally, display thesorted array elements using any sorting algorithm.Sample run: Enter the size of the array: 4 Array element 1: 6Array element 2: 4Array element 3: 5Array element 4: 2The sorted array is: 2 4 5 6Write a program that prompts the user for an integer, then asks user to enter that many integer value. Store these values in an integer array and print the array. Reverse the array elements so that first element become the last element, the second element become the second to last element, and so on, with the old last element now first. Do not just reverse the order in which they are printed; actually, change the way they are stored in the array. Try not to create a second array; just rearrange the elements within the array you have. (Hints; Swap elements that need to change place.) When the elements have been reversed, Print the array again.Write a program that creates an array of integers sine 10. And do the following- a) Ask the user to enter 10 numbers (all > O) 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 average
- Write a program that reads 10 integers from the keyboard, store them in an array. Then modify the array so that each element is incremented by 1. Last, display the incremented array.Write a program to ask the user for the number of arrays he wants to maintain and then populate eacharray by taking elements from the user. Merge all these arrays in another array and finally remove duplicateelements from the merged array.Please use C++ Write a program that should ask the user to input 12 elements (positive whole numbers) inside the array and then it will sort the even numbers in ascending order and odd numbers in descending order. If the user's input is not a positive whole number, then prompt "ERROR! Please input a positive whole number only. Sample Output: Input: 1 18 15 17 14 25 30 77 48 52 64 89 Even Numbers: 14 18 30 48 52 64 Odd Numbers: 89 77 25 17 15 1
- Write a program that prompts the user to enter 50 integers and stores them in an array. The program then determines and outputs which numbers in the array are sum of two other array elements. If an array element is the sum of two other array elements, then for this array element, the program should output all such pairs separated by a ';'. If no two elements can equal the value of an element, the line can remain empty, as shown above for list[0] and list[5].Write a program that randomly fills an array of integers andthen sorts it. The array size is entered by the user and the values are chosen at randomin {-1, 0, 1}. Analyze the time complexity of your program. Here is a sample run: Enter the size: 10 ↵Enter1 0 1 −1 0 1 −1 0 0 0−1 −1 0 0 0 0 0 1 1 1Write a program, which creates an array of 5 elements of type integer. Print the elements of the array. 2 5 7 6 8
- Write a program that declares an array of 15 integers and reads the values from the user. Make sure that the user doesn’t enter a value greater than 10 (if the user enters a value not in the allowed range, discard that value and read another to put into the array). Now tell the number that occur maximum number of times in the array. For example for the following 7 has maximum occurrence. 4,7,3,3,2,7,1,5,7,9,9,9,7,8,10 Use both linear and binary search.Write a method that finds the largest element in an arrayof double values using the following header:public static double max(double[] array)Write a test program that prompts the user to enter ten numbers, invokes thismethod to return the maximum value, and displays the maximum value. Here isa sample run of the program: Enter ten numbers: 1.9 2.5 3.7 2 1.5 6 3 4 5 2 ↵EnterThe minimum number is: 6Write a program that reads integers between 1 and 100 and countsthe occurrence of each number. Assume the input ends with 0 and that the maximum capacityof the array is 100