Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a circular (singly linked list) of ints using the file in HW10. You are to use SINGLY LINKED NODES and NOT the java Linked

Create a circular (singly linked list) of ints using the file in HW10.

You are to use SINGLY LINKED NODES and NOT the java Linked List class.

Pass this list to a method that deletes ever node whose item is an EVEN number.

Print the list. You should have only odd numbers remaining.

HW10:

import java.util.ArrayList; import java.util.List; import java.util.Scanner;

public static void main(String[] args) { //create a list called "list1" that conatains integers Scanner keyboard = new Scanner(System.in); Listlist1 = new ArrayList<>(); int n; System.out.println("Enter input numbers with space between each integer"); System.out.println(""); // add integers to list1 do{ n = keyboard.nextInt(); if(n==0){ break; } list1.add(n); } while (true); //display inputed integers System.out.print(" Inputed list of numbers are: "); for(int i =0; ieven = new ArrayList<>(); Listodd = new ArrayList<>(); //use for loop to determine whether an integer is even or odd for (int i =0; i

Rubric:

* method to create initial CIRCULAR list

* method to print CIRCULAR list

* method to delete even numbers from CIRCULAR LIST. Only HALF credit if you turned it into a list, deleted , and then made it circular again

* Good, modular, well written code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

3. SCC Soft Computer

Answered: 1 week ago