Your program allows a user to enter array of 'n’ integers, where 'n' is entered by the user (n < 10). The program prints the odd numbers at the odd positions in descending order. The first row (where 'n' is entered) has position = 0. There is a newline character \n' between any two printed numbers. Below is an example when 'n' = 4: 4 1 7 OUTPUT: Press any key to continue
Q: Write a program named FullName2.sce that prompts the user for an array of x data and an array of y…
A: given data, enter x data : [1, 2, 3, 4] enter y data : [2, 5, 9, 10]
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 test program that prompts the user to enter two 3 * 3 arrays of integers and displays…
A: I have provided java code with output in step 2.
Q: My professor wants the program to have this: Write a program that creates a 32-element array of…
A: You can find the java code in the below steps. We need to create 32 array from random values between…
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 allows the user to enter an array of elements (integers) then sort these…
A: Since you haven't specified the programming language to be used, the code provided is in C++. You…
Q: Binary search is a very fast searching algorithm, however it requires a set of numbers to be sorted…
A: The code is given in step 2:
Q: Write a program that prompts the user to read two integers and displays their sum. Your program…
A: As per Bartleby Guidelines: “Since you have asked multiple question, we will solve the first…
Q: What would be the output of the following algorithm when the user enters the array numbers as: 26,…
A: answer is
Q: Write a program that calculates the average of an array of 5 floating-point values.
A: Algorithm: Start Declare A[5] Set I = 0 Set Sum = 0 While I < 5 : READ A[I] Sum += A[I]…
Q: Write a program that declares an array of 5 integers. Populate the array by asking 5 integer numbers…
A: As you have not mentioned any specific language so I provide the output and code screenshot in C++
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 grades arithmetic quizzes as follows: (Use the below startup code for…
A: The, code has given below:
Q: Allow a user to enter any number of double values up to 15. The user should enter 99999 to quit…
A: import java.util.*;import java.lang.*; public class DistanceFromAverage { public static void…
Q: Write a program that reads in ten integers and displays the number of distinct numbers and the list…
A: logic: - public static int findDistinctNumbers(int arr[],int outputArr[]) { int i,j,k=0;…
Q: Write a program to produce an array of integer random numbers. Your program should find out from the…
A: import java.util.Random; // importing Randomimport java.util.*; public class Code{ public static…
Q: Ask the user to enter a size of array between 2 to 10. b. Based on the size entered, write a loop…
A: Required:
Q: Write a program that creates an array to hold 5 temperature values (integers are fine). Using a…
A: Approach: import random class and scanner class. define the main class and the main method. define…
Q: Write a program that ask user to key in test scores. Store the scores in an array. Then, display…
A: #include <stdio.h> int main(){ //Getting number of students printf("Enter total…
Q: Write a program that creates an array of integers size 10. And do the following- a) Ask the user to…
A: Hi. As there is no programming language mentioned, I will attempt this question in C++. Let's…
Q: In the previous activity, you used a loop to count how many negative numbers an array contained. Use…
A: Following is the code loop we want to implement in order to get numbers between lower and upper…
Q: Input a number of your choice: 1 Enter a size of an array from 1-10: 4 Input 4 numbers: 21 9 14 30…
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the main function.…
Q: Your program should allow users to find the two-digit number(s) that appear(s) the most in the array…
A: Language Python 3 n=int(input("Enter the size of the array") arrray={} twodigitnumbers=[] count=0…
Q: Write a program that declares two arrays A and B of size 10. Fill array A by generating random…
A: Here we will write a program
Q: My professor wants the program to have this: Write a program that creates a 32-element array of…
A: I will explain it in details,
Q: A point in the 2D is represented by a pair (x, y). To represent a group of points, a 2D array is…
A: EXPLANATION Below is the program for the given question. Hope you understand it well. If you have…
Q: In this problem you will write a program that will randomize the elements of an array created by the…
A: Let an array's size be n: Run the array till n/2 position. Then, if you: swap the 0th element with…
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 takes 6 integers from user and store them in an array. Calculate the Sum,…
A: Below is the required C program: - Program Approach: - Defining the necessary header file.…
Q: Write a program that creates an array of 10 user to input 10 numbers and stores each e
A: #include<stdio.h>#include<conio.h>void main(){ int a[10], i; clrscr();…
Q: Write a program that creates an array of 100 random integers in the range 1 to 200 and then using…
A: Given that, Write a program that creates an array of 100 random integers in the range 1 to 200…
Q: Write a short program that prompts the user and reads in integers into an array called Table. When…
A: C++ used to answer this question
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: 1. Prompts the user to enter an integer representing the size of an array of…
A: Lets see the solution.
Q: E4 This code read an array of 50 values x(50) then determine the result y(50). *. Print the elements…
A: The solution to the above problem is given below.
Q: A magic square is an n by n square in which each element is an integer between 1 and n*n and all…
A: Here I have first of all created a function isMagicSquare() that takes a 2D array as input and then…
Q: Write a program to store an array of integer random numbers. Program should find out from the user…
A: CODE:- import java.util.Random;import java.util.*;public class Main {public static void…
Q: 1-Write a method that returns m(i) for a given i values 2 + m(i) 2-Write a test program that reads a…
A: C++ is an object oriented programming language which gives a clear structure to program and allows…
Q: Can you make the array be randomly genorated instead of already named values, and ask the user to…
A: i have added the code to generate a random array based on users' input as asked by you. you may have…
Q: Write a program that generates an array of 9 integer numbers between 10 and 100 both inclusive. The…
A: We will solve this problem in Java language.
Q: Using the two arrays shown below,write a program that prompts the user to enter an integer between 1…
A: PROGRAM STRUCTURE: Import the Scanner class to use the Scanner function to take the input from…
Q: Write a program using arrays that generate 20 random integers between 10 and 90 and then stores it…
A: Note: Programming language is missing in the question. So we will answer this program in C++. If you…
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 reads in ten integers and displays the number of distinct numbers and the list…
A: Find the required code in java given as below and output :
Step by step
Solved in 2 steps with 1 images
- Write a menu driven program that reads an array of 10 integer from standard keyboard (user) utilizing a loop and outputs the following depending on user's choice • Choice 1 - Prints the elements of array . Choice 2 - Prints the minimum value of the array Choice 3 - Prints the maximum value of the array Choice 4 - Prints the product of all the numbers utilizing aloop. Choice 5 - Prints the sum of all the numbers utilizing a loop Choice 6- Print the elements of array in a reverse order When the program is done, your program should ask the user if they would like to enter another set of 10 numbers and the program should repeat itself. Input validation: Your program should only accepts integers.Write an application that prompts the user to enter nine integers and then store those nine integers in an array. Display the integers from first to last, and then display the integers from last to first. You do not have to sort them, just display the order entered and the reverse order entered. (In JAVA)Using the two arrays shown below,write a program that prompts the user to enter an integer between 1 and 12 andthen displays the months and its number of days corresponding to the integerentered. Your program should display “wrong number” if the user enters awrong number by catching ArrayIndexOutOfBoundsException. String[] months = {"January", "February", "March", "April","May", "June","July", "August", "September", "October","November", "December"};int[] dom = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- Write a program that simulates rolling two dice. Prompt the user to enter the number of dice rolls. Use a loop to repeatedly call a method that simulates a dice roll and returns the total of the two dice to main. Keep track of the rolls in an array in main, and end the program by showing the results of the rolls.Write a program that creates a two dimensional array with 4 rows and 3 columns that contains the below numbers. Let the computer prompt you to enter these numbers. 8 6 1 7 3 0 2 5 9 5 6 7 After that, calculate and print the total and average of these values.Write an application program that could be used to find the numbers divisible by 30 stored in a single dimensional array of size 5, your program should generate 5 random integer numbers from 50-200 inclusive, then it must display the numbers divisible by 30 in reverse order
- Please Help 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.Can you make the array be randomly genorated instead of already named values, and ask the user to enter the number of numbers that will be genorated in the array. Everything else can stay the same. '''def binary_search(arr, x): low = 0high = len(arr) - 1mid = 0while low <= high: mid = (high + low) // 2if arr[mid] < x: low = mid + 1elif arr[mid] > x: high = mid - 1else: return mid return -1arr = [ 2, 3, 4, 10, 40 ] print("The array is [ 2, 3, 4, 10, 40 ]")x = int(input("Enter which value do you seek to find from the array above? "))while not (x==2 or x==3 or x==4 or x == 10 or x == 40):print("Option isn't in the array.")x = int(input("Please input a valid number to search "))result = binary_search(arr, x) print("Searching for", x) if result != -1: print("Element is present at index", str(result))Allow a user to enter any number of double values up to 15. The user should enter 99999 to quit entering numbers. Display an error message if the user quits without entering any numbers; otherwise, display each entered value and its distance from the average. Save the file as DistanceFromAverage.java. Now, modify that program to first prompt the user to enter an integer that represents the array size. Java generates a NumberFormatException if you attempt to enter a noninteger value using nextInt(); handle this exception by displaying an appropriate error message. Create an array using the integer entered as the size. Java generates a NegativeArraySizeException if you attempt to create an array with a negative size; handle this exception by setting the array size to a default value of five. If the array is created successfully, use exception-handling techniques to ensure that each entered array value is a double before the program calculates each element’s distance from the average.…
- In Java Binary search is a very fast searching algorithm, however it requires a set of numbers to be sorted first. For this lab, create an array full of 11 integers which the user will generate. Like in the previous lab, assume that the values will be between -100 and +100. Then, using the sorting algorithm called BubbleSort, put the array in the correct order (from lowest to highest number). After this, please print the array to the screen. Finally, search the array for the target value using Binary Search. The BinarySearch code will implement the algorithm described in the lab slides. During this, you should print out a few key values which help Binary Search function. For example, this algorithm focuses on a low, mid, and high which correspond to the indices in the array the algorithm is currently considering and searching. Printing these values during the search process will help with debugging and fixing any issues. • BubbleSort sorts the array to prepare for the next step •…You’re given an array of integers and another array of three distinct integers. The first array is guaranteed to only contain integers that are in the second array, and the second array represents a desired order for the integers in the first array. For example, a second array of [x, y, z] represents a desired order of [x, x,…,x, y, y,…,y, z, z,…,z] in the first array. Write a program that sorts the first array according to the desired order in the second array. The program should perform this in place (i.e.., it should mutate the input array), and it shouldn’t use any auxiliary space. Note that the desired order won’t necessarily be ascending or descending and that the first array won’t necessarily contain all three integers found in the second array-it might only contain one or two. Please Don't Use Chat GPT Answers Sample input array = [1,0,0,-1,-1,0,1,1] order = [0,1,-1] Sample output [0,0,0,1,1,1-1,-1] Requirements: 1. Implement the above problem statement using C Programming. 2.…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 average