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
OLga [1]
3 years ago
12

Extend the class linkedListType by adding the following operations: Write a function that returns the info of the kth element of

the linked list. If no such element exists, terminate the program. Write a function that deletes the kth element of the linked list. If no such element exists, terminate the program.
Computers and Technology
1 answer:
WINSTONCH [101]3 years ago
6 0

Answer:

Explanation:

The following code is written in Java. Both functions traverse the linkedlist, until it reaches the desired index and either returns that value or deletes it. If no value is found the function terminates.

public int GetNth(int index)

       {

       Node current = head;

       int count = 0;

       while (current != null)

       {

       if (count == index)

       return current.data;

       count++;

       current = current.next;

       }

       assert (false);

       return 0;

       }

public int removeNth(int index)

       {

       Node current = head;

       int count = 0;

       while (current != null)

       {

       if (count == index)

       return current.remove;

       count++;

       current = current.next;

       }

       assert (false);

       return 0;

       }

You might be interested in
What inventor patented the first American movie projector?
yulyashka [42]
Thomas edison is the answer
3 0
3 years ago
Read 2 more answers
Alexa it is olewi.............................................
Sladkaya [172]

Answer:

jvksvksdvkbvkjsdkcn

Explanation:

6 0
3 years ago
Read 2 more answers
The security administrator for Corp.com. You are explaining to your CIO the value of credentialed scanning over non-credentialed
Zepler [3.9K]

Answer:

b. Customized auditing.

Explanation:

Vulnerability scanning is a process of finding or testing a system for weak or vulnerable spots which can be exploited by outsiders. It helps to boost the computer network in an organisation.

There are two types of vulnerability scanning, they are credentialed and non-credentialed scanning and they are defined as implied. The non credentialed scan requires no authorisation and credentials for scanning to take place while credentialed scan is the reverse.

The credentialed scanning provides baseline and customised auditing features.

3 0
3 years ago
Read 2 more answers
Convert each of the following for loops into an equivalent while loop. (You might need to rename some variables for the code to
MAVERICK [17]

Answer:

~CaptnCoderYankee

Don't forget to award brainlyest if I got it right!

Download txt
5 0
3 years ago
16. Budget Analysis Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop shoul
strojnjashka [21]

Answer:

import java.util.Scanner;

public class num8 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter month's budget");

       double monthBudget = in.nextDouble();

       double totalExpenses = 0.0;

       double n;

       do{

           System.out.println("Enter expenses Enter zero to stop");

           n = in.nextDouble();

           totalExpenses += n;

       }while(n>0);

       System.out.println("Total expenses is "+totalExpenses);

System.out.println("The amount over your budget is "+ Math.abs(monthBudget-totalExpenses));

   }

}

Explanation:

  • Using Java programming language
  • Prompt user for month's budget
  • Use Scanner class to receive and store the amount entered in a variable
  • Use a do while loop to continuously request user to enter amount of expenses
  • Use a variable totalExpenses to add up all the expenses inside the do while loop
  • Terminate the loop when user enters 0 as amount.
  • Subtract totalExpenses from monthBudget and display the difference as the amount over the budget

6 0
2 years ago
Other questions:
  • Write a program that asks the user for two file names. The first file will be opened for input and the second file will be opene
    8·1 answer
  • A lottery ticket contains five unique numbers. A set of unique numbers does not contain repeated elements. The winning combinati
    10·1 answer
  • The quicksort pivot value should be the key value of an actual data item; this item is called the pivot. True or False?
    11·1 answer
  • What property must be set on a menu item to have the user activate that option by pressing Ctrl C on the keyboard
    11·1 answer
  • Choose the correct term to complete the sentence.
    12·1 answer
  • Help help help help help!!!
    7·1 answer
  • 1.
    7·1 answer
  • What are the disadvantages of vector images when compared to bitmap images?
    14·1 answer
  • What are the two protocols used most often with iot devices? (select two. )
    10·1 answer
  • when inputting a formula into excel or other spreadsheet software, what components are required for the formula to function prop
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!