Structure definition to create a singly-linked list

Assignment Help C/C++ Programming
Reference no: EM131799784

Use this structure definition to create a singly-linked list.

strict Employee { string fname; string lname; double salary; Employee "next; );

You are given a data file that contains data for the three parameters in HW3Data.dat. You need to write A function of void return type named create_list that accepts the head of the list as the argument, This function needs to read the data file, read one line at a time and assign the read parameters to the structure members. How, we need to attach this structure instance as a node to the list. Use this function to assign the elements for the head node as well.

Remember, we already did this in Homework 1 problem 1. In that problem we stored the read parameters into an array of structure. Here. WE are using a linked list. The logic of reading and storing does not charge. Just think how you need attach that Item to a linked list.

A function of void return type called show_list that accepts the head of the list as the argument. In this function, you need to display the contents of all nodes in the list in the format of:

LastHame FirstHame salary
A function of void return type called insert_item that accepts the head of the list and the structure instance to insert. It should also accept the first name of the employee after which the new item needs to be inserted,
A function of void return type called delete_item that accepts the head of the list and the first name of the Employee to be deleted from the list,

To test if you program is working, use the following main function.
int main()
{
Employee *head = new Employee; //head of the list
create_list(head);
Employee *item=new Employee; //item to be inserted_item->fname =."Robert'% item->Iname="Johnson;
item->salary=75000.50;
insert_item(head,"Sheila",item);//insert after Sheila
delete_item(head, "Sheila");//delete Sheila
show_list(head); return 0;
}
You must get the following out put.

John Harris 50000
Lisa Smith 75000.5
Adam Johnson 68500.1
Robert Johnson 75000.5
Tristen Major 75800.8
Yannic Lennart 58000.6
Lorena Emil 43000
Tereza Santeri 48000

Attachment:- Data.rar

Reference no: EM131799784

Questions Cloud

Prepare the journal entries to record the three investments : The year-end fair values per share were as follows: Nirmala $21; Oxana $39; and WTA $20. Prepare the journal entries to record the three investments
Motivation for un climate change conference : Highlight the successes and/or failures of the conference...be specific. Who are beneficiaries of this landmark agreement if any?
Describe any operating problems : identify the direct materials and/or direct labor variance (s) that could be affected, and indicate whether the variances
How many years are left in the lives of petrobras : How many years are left in lives of Petrobras' Equipment and other assets, on average? State clearly any assumptions that you make in arriving at your estimate.
Structure definition to create a singly-linked list : Use this structure definition to create a singly-linked list - write A function of void return type named create_list that accepts the head of the list
Reasons for the use of job order cost system method : A job order cost system is a system that accumulates costs for each job. Consider the aspects of job order costing and respond to the following.
What is the largest reorder cost to make the malt in-house : Joe needs to purchase malt for his micro-brew production. His supplier charges $35 per delivery (no matter how much is delivered) and $1.20 per gallon.
Determine the equivalent uniform annual cost : A CNC lathe, used in a production process, requires major repair. Determine equivalent uniform annual cost of keeping (repairing and using) the existing machine
Which printer should the framing store purchase : John Smith Framing has noticed that a lot of customers would like to be able to print photographs to frame. But since the store does not have an art printer.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd