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
gayaneshka [121]
3 years ago
9

Create a linked list for library patrons. Put at least 8 patrons in the list. (You should hard code this data.) Ask for a person

's name. Tell if the person is in the list or not. If the person is in the list, show the person's information. Data fields are: Name, Library card number, Street, City, Zip
Computers and Technology
1 answer:
Evgesh-ka [11]3 years ago
7 0

Answer:

Explanation:

#include <bits/stdc++.h>

using namespace std;

/* Link list node */

class Node

{

public:

string Name;

long Library_card_number;

string Street;

string City;

long Zip;

Node* next;

};

/* Given a reference (pointer to pointer) to the head

of a list and an int, push a new node on the front

of the list. */

void push(Node** head_ref,string name,long lcn,string street,string city,long zip)

{

/* allocate node */

Node* new_node = new Node();

/* put in the key */

new_node->Name = name;

new_node->Library_card_number = lcn;

new_node->Street = street;

new_node->City = city;

new_node->Zip = zip;

/* link the old list off the new node */

new_node->next = (*head_ref);

/* move the head to point to the new node */

(*head_ref) = new_node;

}

/* Checks whether the value x is present in linked list */

Node* search(Node* head, string x)

{

Node* current = head; // Initialize current

while (current != NULL)

{

if (current->Name == x)

return current;

current = current->next;

}

return NULL;

}

/* Driver program to test count function*/

int main()

{

/* Start with the empty list */

Node* head = NULL;

int x = 21;

/* Use push() to construct below list

14->21->11->30->10 */

push(&head, "Joe",1,"hippy Street","Bay area",2009);

push(&head, "Marie",2,"lippy street","san jose",2010);

push(&head, "Harry",3,"gippy Street","Bay area",2009);

push(&head, "Ashish",4,"dippy street","san jose",2010);

push(&head, "Zuck",5,"sippy Street","Bay area",2009);

push(&head, "Gates",6,"kippy street","san jose",2010);

push(&head, "Page",7,"pippy Street","Bay area",2009);

push(&head, "Brin",8,"dippy street","san jose",2010);

string name;

cout<<"Enter name of the person to search: ";

cin>>name;

Node* z = search(head,name);

if(z!=NULL){

cout<<"\nPerson found in the list"<<endl;

cout<<"Name: "<<z->Name<<endl;

cout<<"Library Card Number: "<<z->Library_card_number<<endl;

cout<<"Street: "<<z->Street<<endl;

cout<<"City: "<<z->City<<endl;

cout<<"Zip: "<<z->Zip<<endl;

}else{

cout<<"No person found with the name "<<name<<endl;

}

return 0;

}

You might be interested in
The rules and guidelines for appropriate computer mediated communication are called?
irinina [24]
<span>The rules and guidelines for appropriate computer mediated communication are called netiquette. 
It is a blend of two words: net (from Internet) and etiquette, or the appropriate behavior. 
</span>
4 0
3 years ago
Access-lists pose a logical problem which often has more than one solution. Can you think of a different set of rules or placeme
Maksim231197 [3]

Answer:

Question is incomplete. it needs a topology diagram and also it needs Router R1 table. I assume User has access to the topology and Routing table.

Below Configuration will help to fix ACL problem

Hosts from the 172.16.0.0/16 network should have full access to Server1, Server2 and Server3 but this is not currently the case, as L1 can’t communicate to Server2 or Server3.

Explanation:

Following Configuration on Cisco Router R1 will help to fix all the ACL problems.

enable

configure terminal

no ip access-list standard FROM_10

ip access-list standard FROM_10

deny host 10.0.0.2

permit any

exit

!

no ip access-list standard FROM_172

ip access-list standard FROM_172

permit host 172.16.0.2

exit

!

interface GigabitEthernet0/0

ip access-group FROM_192 out

end

write memory

!

7 0
3 years ago
R15. Suppose there are three routers between a source host and a destination host. Ignoring fragmentation, an IP datagram sent f
maria [59]

Answer:

The answers are: an IP datagram, and 3 forwading tables.

Explanation:

An IP datagram sent from a source host to a destination host will travel through 8 interfaces. 3 forwarding tables will be indexed to move the datagram from source to destination.

8 0
3 years ago
which application software allows you to compose written ideas on a computer? database, spreadsheet, word processor or graphics
Kazeer [188]
Word processor because it's more for writing
8 0
3 years ago
Passwords are usually alphanumeric and usually cannot contain spaces or ________.
vlada-n [284]

Answer:

The answer is A. Punctuation.  A password can contain symbols

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • The condition, ____, entered in the criteria row of a long text field in a query window would retrieve all records where the lon
    8·1 answer
  • What is the name of the process of heat transfer in which heat is transmitted through light waves?
    7·2 answers
  • People often delete or read email based upon the subject line alone select one:
    10·2 answers
  • When creating a firewall exception, what is the difference between opening a port and allowing an application through?
    7·1 answer
  • A financially stable person is able to
    12·2 answers
  • Which of the following people choose a career path for the right reasons
    12·2 answers
  • Create a function named first_a that uses a list comprehension. The function will take a single integer parameter n. Find every
    13·1 answer
  • Double bar graphs compare multiple what
    11·1 answer
  • In the Dognition_aggregated_by_DogID data set, what is consistent about the relationship between breeding group and number of te
    15·1 answer
  • Jacob has a text file open, and he is typing on the keyboard. What is the best description of how the
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!