answer.
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
goldenfox [79]
2 years ago
14

.13 LAB: Library book sorting Two sorted lists have been created, one implemented using a linked list (LinkedListLibrary linkedL

istLibrary) and the other implemented using the built-in Vector class (VectorLibrary vectorLibrary). Each list contains 100 books (title, ISBN number, author), sorted in ascending order by ISBN number. Complete main() by inserting a new book into each list using the respective LinkedListLibrary and VectorLibrary InsertSorted() methods and outputting the number of operations the computer must perform to insert the new book. Each InsertSorted() returns the number of operations the computer performs. Ex: If the input is:
Computers and Technology
1 answer:
Gre4nikov [31]2 years ago
7 0

Answer:

linkedListOperations = linkedListLibrary.InsertSorted(currNode, linkedListOperations); // this is right

linkedListLibrary.InsertSorted(currNode, linkedListOperations);  // half right, it count how much operation but it doesn't store it anywhere in main.

vectorOperations = vectorLibrary.InsertSorted(tempBook, vectorOperations);  // this is right

vectorLibrary.InsertSorted(tempBook, vectorOperations); // half right, it count how much operation but it doesn't store it anywhere in main.

cout << "Number of linked list operations: " << linkedListOperations << endl;

cout << "Number of vector operations: " << vectorOperations << endl;

Explanation:

The first, you are calling InsertSorted with linkedListLibrary and than you can store the number of operation inside the "linkedListOperations" variable. Then you do the same with vectorLibrary.

You might be interested in
Program MATH_SCORES: Your math instructor gives three tests worth 50 points each. You can drop one of the test scores. The final
Simora [160]

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       //Prompt and receive the three Scores

       int score1;

       int score2;

       int score3;

       do {

           System.out.println("Enter first Score Enter score between 1 -50");

           score1 = in.nextInt();

       } while(score1>50 || score1<0);

       do {

           System.out.println("Enter second Score.The second score must be between 1 -50");

           score2 = in.nextInt();

       } while(score2>50 || score2<0);

       do {

           System.out.println("Enter Third Score Third score must between 1 -50");

           score3 = in.nextInt();

       } while(score3>50 || score3<0);

       //Find the minimum of the three to drop

       int min, min2, max;

       if(score1<score2 && score1<score3){

           min = score1;

           min2 = score2;

           max = score3;

       }

       else if(score2 < score1 && score2<score3){

           min = score2;

           min2 = score1;

           max = score3;

       }

       else{

           min = score3;

           min2 = score1;

           max = score2;

       }

       System.out.println("your entered "+max+", "+min2+" and "+min+" the min is");

       int total = max+min2;

       System.out.println("Total of the two highest is "+total);

       //Finding the grade based on the cut-off points given

       if(total>=90){

           System.out.println("Grade is A");

       }

       else if(total>=80){

           System.out.println("Grade is B");

       }

       else if(total>=70){

           System.out.println("Grade is C");

       }

       else if(total>=60){

           System.out.println("Grade is D");

       }

       else{

           System.out.println("Grade is F");

       }

   }

}

Explanation:

  • Implemented with Java
  • Use the scanner class to receive user input
  • Use a do.....while loop to validate user input for each of the variables. A valid score must be between 0 and 50 while(score>50 || score<0);  
  • Use if and else to find the minimum of the three values and drop
  • Add the two highest numbers
  • use if/else if /else statements to print the corresponding grade
8 0
1 year ago
When you are shopping online and finalizing your order, you usually fill in forms for your name, address, email, and payment met
aksik [14]

Answer:

a.JavaScript

Explanation:

<em>Form validation</em> is adopted to prevent the abuse of web form by malicious users, data that are not properly validated causes or leads to security vulnerabilities, thereby making a website to be at a risk of being attacked by malicious users.

<em>Validation rules</em> checks that the data a user enters in a record meets the specify standards before the user is allowed to save the record, a validation rule evaluates the data in one or more fields and return it as true or false.

<em>JavaScript form validation  can be used to check all required fields, the steps are adopted are:</em>

<em>i) Basic validation − The form is first checked to make sure that all the mandatory fields are filled.</em>

<em>ii) Data format validation −The data that is entered is then checked for correct form and value before allowing to proceed, submit or save the record.</em>

6 0
1 year ago
C# Write, compile, and test a program named PersonalInfo that displays a person’s name, birthdate, work phone number, and cell p
Soloha48 [4]

Answer:

#include <stdio.h>

#Include<iostream>

using namespace std;

//Define required function

PersonalInfo( )   {

    printf("Name   : Robert Josh\n");  

    printf("DOB    : July 14, 1975\n");  

    printf("Work Phone : 00-00000000\n");  

    printf("Cell Phone : 11-777777777\n");  

    return(0);  

 }

int main()   {

    //Call function

 PersonalInfo( );

 return 0;

 }

Explanation:

Its just a simple code to print required details when the function PersonalInfo is called.

5 0
2 years ago
The elements in a string type array will be initialized to ____.?
ivanzaharov [21]
The elements in a string type array will be initialized to "Null".
7 0
2 years ago
Leah wants to create a PowerPoint presentation for a history report about the progressive era in the 1900s. To
Nutka1998 [239]

Answer:

File

Explanation:

8 0
1 year ago
Read 2 more answers
Other questions:
  • A(n) _____ can be used to reveal a competitor’s program code, which can then be used to develop a new program that either duplic
    9·1 answer
  • Which port, along with a special card and cables, supports the connection of microcomputers, modems, and printers in a local are
    6·1 answer
  • Your computer is crashing on a regular basis. Which of the following is an operation available to the user that should help rese
    14·2 answers
  • Which of the following statements is not true about proper tire care? a.If you see a wear bar across the width of the tread whil
    14·2 answers
  • When performing actions between your computer and one that is infected with a virus which of the following offers no risk becomi
    5·1 answer
  • What kind of device can monitor a connection at the demarc but cannot interpret data?
    9·1 answer
  • Mathematical computations by a computer are faster than your quickest mathematical computations because the top speed of a neura
    13·1 answer
  • What is the first step to apply the line and page breaks options to groups of paragraphs in a Word document?
    8·2 answers
  • A credit card company receives numerous phone calls throughout the day from customers reporting fraud and billing disputes. Most
    10·1 answer
  • Write a print statement that displays a random integer between 5 and 5000. Assume the random library is imported.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!