Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// Complete the code in the PICTURE. JAVA Programming import java.util.*; public class LabEmpty { public static void main(String[] args) { List al = new

// Complete the code in the PICTURE. JAVA Programming

import java.util.*;

public class LabEmpty { public static void main(String[] args) { List al = new LinkedList(); // Add items to the List String song = "Across the Universe"; for (int i = 0; i

// Uses a ListIterator to traverse the list public static void traversal (List list) { ListIterator li = list.listIterator(); while (li.hasNext()) System.out.print(li.next()); System.out.println (""); } // Delete blanks and convert alphabetic characters to upper case public static void modifyList (List list) { //Code in the PICTURE goes here.

} } }

image text in transcribed

Download and compile the LabEmpty java file. The program builds a linked list of characters. Complete the modifyList method. Use a Listlterator that traverses the entire list of characters. As it traverses the list, the iterator should delete every blank character. It should also replace alphabetic characters with their uppercase equivalent. While your code should work for any list, for the sample list, the output should be: ACROSSTHEUNIVERSE Once you are satisfied that your method works as expected, complete the missing code elements below. public static void modifyList (List list) ListIterator it list.listterator(); while ( char ch if (ch ' else Character.toUpperCase(ch))

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

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

d. What language(s) did they speak?

Answered: 1 week ago

Question

What is computer neworking ?

Answered: 1 week ago

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago