Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
Create a java program that will ask the user to enter 10 integer numbers separated with spaces and identify
which of the numbers are odd and which are even. Display all even and after displaying all even numbers, compute the SUM. Also display all odd number and after displaying all odd numbers, compute the AVERAGE. Implement using Array.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 2 images
Knowledge Booster
Similar questions
- Write in javaarrow_forwardWrite a Java program that creates an array of integers with length 5 and fills it with the number 1 through 5 then loop through the array and print out each elementarrow_forwardUsing Java Eclipse IDE (Average an array) Write two overloaded methods that return the average of an array with the following headers: public static int average(int [] array) public static double average(double [] array) Write a test program that prompts the user to enter 10 double values, invokes this method, then displays the average value.arrow_forward
- You are give an array which contains the following integers : 9, 10, 12, 15, 7, 2, 1, 16, 18, 5, 6. Write a java program that will give you the product of this arrayarrow_forwardIn JAVAarrow_forwardUsing Java language, do the following: Declare an array of double of size 365 to store daily temperatures for one year. Using this data structure, write a code fragment to find / The hottest and coldest days of the year. / The average temperature of the year. / The difference between the hottest and coldest days. • Hint: It is better to build a method for each task and notice that the hottest is the largest value and the coldest is the smallest value.arrow_forward
- Using JAVA, write array method that carry out the following tasks for an array of integers. Swap the first and the last elements in the array Remove the middle element if the array length is odd, or the middle two elements if the length is even. Return true if the array contains two adjacent duplicate elements Return the second largest element in the array Return the sum of the elements in the array Write a single test program in methods are called. Display the array before and after each call to demonstrated correct operation of the methods.arrow_forwardWrite a java program that: • Reads 10 integer numbers and store them in an array of size 10. • Find and display how many numbers in the array divisible by 2. • Print those numbers on the screen. • Find and display the average of all odd numbers in the array. Sample Input/Output: Enter 10 numbers: 1 2 4 2 5 7 30 11 3 21 There are 4 numbers divisible by 2. Those are : 2 4 2 30 The average of odd numbers in the list is 8arrow_forwardWrite the following Java code: Create an array of size 10 with elements entered by the user. Print the Array Switch the first and last elements of the array. Shift all elements by one to the right, and move the last element into the first position. Replace all even numbers with 0.arrow_forward
- Solve by javaarrow_forwardWrite a java program (class) called Grades to do the following. Must use an array. Ask the user for 20 grades. Get from the user each grade and fill an array with the grades. Find the average of the elements of the array. Print how many grades are smaller than the average. To get you started, your program code will begin as follows: import java. util. *; //includes Scanner public class Grades { public static void main(String[] args) { //begins main methodarrow_forwardin javaarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY