1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Assoli18 [71]
2 years ago
6

Write a program using LinkedList class and ListIterator interface to demonstrate the following activities:

Computers and Technology
1 answer:
babunello [35]2 years ago
3 0

The program is an illustration of LinkedList.

<h3>What is a LinkedList?</h3>

A LinkedList is a data structure element that contains nodes where each node represents a value and also points to the next node.

<h3>The main program</h3>

The program written in Java, where comments are used to explain each line of the program is as follows:

import java.util.LinkedList;

import java.util.Iterator;

class Main {

 public static void main(String[] args) {

     //This creates the Alphabets LinkedList

   LinkedList<String> Alphabets = new LinkedList<String>();

   //This creates an iterator for the Alphabets LinkedList

   Iterator it = Alphabets.iterator();

   //This adds P, Q, R and T to the list

   Alphabets.add("P");    Alphabets.add("Q");    Alphabets.add("R");    Alphabets.add("T");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This adds O to the beginning of the list

   Alphabets.addFirst("O");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This adds U to the list

   Alphabets.add("U");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This adds S after R

   Alphabets.add(4,"S");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

   //This removes O and Q from the list

   Alphabets.remove("O"); Alphabets.add("Q");

   //This prints the Alphabets LinkedList

   System.out.println(Alphabets);

 }

}

Read more about LinkedList at:

brainly.com/question/19754898

You might be interested in
What are the advantages of using a folder?​
Fofino [41]

Answer:

1. easy access to files

2. better organization

Explanation:

8 0
3 years ago
Which of the following is your personal record of payments and bill-paying?
oksian1 [2.3K]

Answer:

I believe its a statement

Explanation:

4 0
3 years ago
1. Which of the following is a result of a successful negotiation?
Alik [6]
Maybe a Win win outcome
7 0
4 years ago
Read 2 more answers
Write a program to prepare the monthly charge account statement for a customer of CS CARD International, a credit card company.
WITCHER [35]

Answer:

import java.util.*;

import java.text.*;

class CreditCardBill

{

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

NumberFormat defaultFormat = NumberFormat.getCurrencyInstance(Locale.US);

System.out.println("CS Card International Statement");

System.out.println("===============================");

System.out.print("Previous Balance: $");

double prevBalance = sc.nextDouble();

System.out.print("Additional Charges: $");

double addCharges = sc.nextDouble();

double interest;

if(prevBalance == 0)

interest = 0;

else

interest = (prevBalance + addCharges) * 0.02;

System.out.println("Interest: "+defaultFormat.format(interest));

double newBalance = prevBalance + addCharges + interest;

System.out.println("New Balance: "+defaultFormat.format(newBalance));

double minPayment;

if(newBalance < 50)

minPayment = newBalance;

else if(newBalance <= 300)

minPayment = 50.00;

else

minPayment = newBalance * 0.2;

System.out.println("Minimum Payment: "+defaultFormat.format(minPayment));

}

}

5 0
3 years ago
What are the functions of an input device​
marshall27 [118]

Answer:

To feed the computer with data/instructions

6 0
3 years ago
Read 2 more answers
Other questions:
  • As referenced in this Canvas guide (Links to an external site.), Canvas is best viewed at a minimum of 800x600 pixels, which is
    5·1 answer
  • Write a Bash script that searches all .c files in the current directory (and its subdirectories, recursively) for occurrences of
    14·1 answer
  • There is no need to schedule video calls ahead of time; they can be used the same way as
    6·1 answer
  • Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string. If it is fo
    5·2 answers
  • Which of the following is considered proper typing technique?
    15·1 answer
  • A method that movie distributors are adopting to make it possible to view movies instantly, without DVD, is known as:
    11·1 answer
  • You are a network consultant who has been asked to attend an initial meeting with the executive management team of ElectroMyCycl
    10·1 answer
  • what would be the result of running these two lines of code? symptoms = ["cough" "fever", "sore throat", "aches"] print (symtoms
    11·1 answer
  • Choose the correct color to complete the sentence.
    15·1 answer
  • Are they going to make season two of Midori Days
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!