Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment

Objective: The goal of this assignment is to practice linked lists.

Background: Suppose that you like traveling and you are planning on visiting your friends who live in different towns of Texas during Spring Break. Use a linked list to plan and organize the sequence of your visits to your friends.

Task: Write a class named Friend. The Friend class must contain the following three private data fields.

the name of the friend,
city name where your friend lives,
price/budget of the gift you are planning to purchase for this friend.

Note that you will need an additional reference field to link to the next Friend of the list. This reference field can be public. Write appropriate setter and getter methods to set and access all the private fields.

Write a different class named Organizer to maintain a linked list containing Friend elements.

Write methods within the Organizer class:

for starting a linked list with the first person,
for inserting a new friend to the list,
for deleting a friend from the list,
for searching whether a given friend is on your list,
for printing the entire list of friends you are planning to visit, and
for computing the total amount of money you are planning to spend to buy gift items for your friends.

In the main method of the Organizer class, test your methods by filling in information about at least five different friends to visit, and by printing the resulting list. Also, display the total amount of money you are planning to spend on gifts. To test insertion and deletion, add one of your friends who is not already in the list, and show that you can search for this friend. Delete a friend from the list to demonstrate that your delete method works perfectly.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92749825

Have any Question?


Related Questions in Computer Engineering

How does a java server page uses the client-server model to

How does a Java Server Page uses the client-server model to make a Web page interactive?

Question write 1 page that respond to the following

Question: Write 1 Page that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your classmates. Be substantive and clear, and use examples to ...

Question suppose we want to build a b tree that has space

Question : Suppose we want to build a B+ tree that has space for 200,000 data entries in its leaf pages. Each data entry is made up of a key and its corresponding data value. Let us assume the following specifications. E ...

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Question social networks have become popular media among

Question : Social networks have become popular media among individuals of all ages to stay connected with friends, family, colleagues and coworkers. However, many users are unaware of the dangers of sharing vast amounts ...

Make a function first-char that consumes a nonempty string

Make a function first-char that consumes a nonempty string and produces a string consisting of the first character in the original string. Do not use string-ref.

Questions -question 1 a digital computer has a memory unit

Questions - Question 1: A digital computer has a memory unit with 16 bits per word. The instruction set consists of 122 different operations. All instructions have an operation code part (opcode) and an address part (all ...

What is the broadcast domain and ports for hubs and

What is the Broadcast Domain and Ports for hubs and bridges?

These questions are for unix linuxselect the lines from

THESE QUESTIONS ARE FOR UNIX (LINUX) Select the lines from file file1 that have exactly three characters in them. Select the lines from file file1 that have at least three characters in them. Select the lines from file f ...

Scheme questionthe following program can be used to

Scheme Question The following program can be used to determine if a given interpreter is using applicative-order evaluations or normal-order evaluation: (define (p)(p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p)) ( ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As