Write a program in Java to store 10 different numbers in Single Dimensional Array, split the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program in Java to store 10 different numbers in Single Dimensional Array, split the array into two separate arrays. One arrays contains all prime numbers in ascending order while the other array contains all the even numbers in descending order. ( 2 should be grouped with prime numbers and while inserting a number in the array insert at it appropriate location according to its value) SAMPLE INPUT: 130,32,54,2,42,87,19,176,199,31 OUTPUT: First Array : 2,19,31,199 Second Array: 176,130,54,42,32 Write a program in Java to store 10 different numbers in Single Dimensional Array, split the array into two separate arrays. One arrays contains all prime numbers in ascending order while the other array contains all the even numbers in descending order. ( 2 should be grouped with prime numbers and while inserting a number in the array insert at it appropriate location according to its value) SAMPLE INPUT: 130,32,54,2,42,87,19,176,199,31 OUTPUT: First Array : 2,19,31,199 Second Array: 176,130,54,42,32
Expert Answer:
Answer rating: 100% (QA)
Heres a Java program that implements the described functionality To change this l... View the full answer
Related Book For
Statistics For Managers Using Microsoft Excel
ISBN: 9780133130805
7th Edition
Authors: David M. Levine, David F. Stephan, Kathryn A. Szabat
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Write code using struct-defined data types Organize source code in multiple header and implementation files (.h and .cpp files). Create, initialize, read, update, and display the contents of struct...
-
Given an array, Arr[] of integer numbers have size N. The task is to find out single or consecutive numbers from Arr[] with 0 sum. When found, print "1" otherwise "0". Example-1: Input: 4 (6,-2,3,-1)...
-
For the element of Figure 8-3 (shown as Figure P8-4) subjected to the linearly varying line load shown acting over the vertical side, determine the nodal force replacement system using Eq. (6.3.7)....
-
West Coast Apparel Co. manufactures a variety of clothing types for distribution to several major retail chains. The following costs are incurred in the production and sale of blue jeans: a. Salary...
-
Missing data and profitability analysis Summary financial information for two independent companies is presented below. Required (a) Calculate the missing amounts. (b) Calculate the gross profit...
-
Party Time Amusements Company owns movie theaters. Party Time engaged in the following business transactions in 2012: Aug 1 Daniel Smith invested $400,000 personal cash in the business by depositing...
-
Kazibwe, a businessman does not maintain a complete set of books for his business transactions. The following is a summary of his cash transactions for the year ended December 31, 2015. Receipts Kshs...
-
A solid circular cylinder is subjected to the loading shown in the figure below. A rigid bar is attached to the free end of the cylinder and an axial load, P, is applied to the end of the rigid bar...
-
Describe four key ways that Forster's story "the machine stops" predicts the modern world and its technologies?
-
A ten-year 100 face amount bond has an annual coupon rate of 8% payable semiannually. The bond is callable at the end of the 5th, 7th, and 9th years at par, immediately after the coupon payment....
-
Which statement is most characteristic of the competing conflict style? a.) "I know you think we're lost, but the restaurant is definitely down this road. Turn left!" b.) "I know you think we're...
-
Calculate the price of a 4-year annual coupon payment bond given the discount rates in the table below. Year Discount rate 1rst 2nd 3rd 4th 0.39% 1.40% 2.50% 3.60%
-
Min, a real estate professional, is representing a client who is interested in purchasing a neighbourhood strip mall that is for sale. The client tells Min he wants to sell it in 5 years for...
-
find the cofactors of given matrix sec30 100 37 sin240 cot30
-
The outer loop controls the number of students. Note that the inner loop of this program is always executed exactly three times, once for each day of the long weekend. Modify the code so that the...
-
Given the following probability distributions for variables X and Y: Compute a. E(X) and E(Y). b. X and Y. c. aXY. d. E(X + Y). 0.2 0.4 0.3 0.1 100 50 50 30 200 20 300 20
-
A growing niche in the restaurant business is gourmet casual breakfast, lunch, and brunch. Chains in this group include EggSpectation and Panera Bread. Suppose that the mean per person check for...
-
An industrial sewing machine uses ball bearings that are targeted to have a diameter of 0.75 inch. The lower and upper specification limits under which the ball bearings can operate are 0.74 inch and...
-
For the given periodic process execution times and periods (P1 has the highest priority), show how much CPU time of higher-priority processes will be required during one period of each of the...
-
For the periodic processes shown below: a. Schedule the processes using an RMS policy. b. Schedule the processes using an EDF policy. In each case, compute the schedule for an interval equal to the...
-
For the given set of periodic processes, all of which share the same deadline of 12: a. Schedule the processes for the given arrival times using standard ratemonotonic scheduling (no data...
Study smarter with the SolutionInn App