C/C++ :: Maintain Student Academic Records Using Linked List
Sep 16, 2014
Assignment on Linked List : Write a program that maintains student academic records using a linked list. The data structure is to be implemented as an array of structures. The fields of the structure are as follows:
• Student ID - this should be unique
• Last name
• First name
• Middle initial
• Course
• QPA
• Address
The program shall be menu driven. This means that the actions that the user can do with the program is govern by choosing an option. The menu shall look like this:
Student Records
1. Add student Academic Record
2. Edit student first name
3. Delete student record
4. View student record (by last name)
5. View all student records
6. Exit
For the edit and delete, the search value should be the student ID. What's lacking on my codes is for the 3rd option. What should I must do with it? These are my codes
I've remade a program to store student database using linked list. When I try to display the list of student with their information (It displays nothing)
So I have to store a student Id and gpa and name in a linked list. I keep getting error messages.
Like: lab 20.cpp(43): error C2628: 'Student' followed by 'int' is illegal (did you forget a ';'?) (43): error C3874: return type of 'main' should be 'int' instead of 'Student' (71): error C2664: 'Student::Student(const Student &)' : cannot convert parameter 1 from 'int' to 'const Student &' Reason: cannot convert from 'int' to 'const Student' No constructor could take the source type, or constructor overload resolution was ambiguous
The programme has to be a linked list to gather student info, (ie name, lastname, student no, and three grade); the first and last name must use malloc correctly, there must be an insert and delete function and a printfunction. and they must print out in alphabetical order.
I want to maintain a list. which will update at regular interval. so I thought to with linked list. Earlier I have used linked list.
Code:
typedef struct { short nwkaddr; unsigned char macaddress[8]; }device_t; }
[code]....
This program is giving many errors. I tried lot to fix it. If I fix one then other bug is arising. for that I did't mentioned what bug i got.Main Issue is while (curr->next->list != NULL) this is giving segmentation fault if i add element second time
I wrote this menu-driven program that maintains a list of restaurants. The program runs fine as it is right now, but my problem is I need to create a new array template class to maintain the list of restaurants, and when a new restaurant is added it must be created dynamically.
I'm having a hard time figuring out what exactly I need to do for this. Templates confuse me allot and I've read all the sections on templates here and in my book, but i'm still lost. The dynamic memory part is throwing me off as well.
I'm about to begin work on an exercise that requires me to maintain a list of the variables inside a c source file. I'm trying to figure out how I'm going to pluck out the variable names from all the other noise. My first thought would be to count any word that isn't a keyword or other type of grammar syntax, such as parenthesis, brackets, semicolons, etc. right?
I am trying to use a class Student and declare it as a list type. I can pushback but without changing the List.h or Node.h how can I print the data in list2?
I'm trying to write a function that takes two linked lists and creates a third one with only the common elements.
It assumes the first list (the caller) has no dups, but it doesn't seem to be working. The program doesn't crash, it just hangs when it is supposed to display L3 (the third list)..everything else runs and is displayed fine.
I have a linked list comprised of chars like so...
Code:
node1 - "p" node2 - "o" node3 - "p"
I need a function that will take in three perameters...node *replaceChar(node *head, char key, char *str)Stipulations of this function. head is the head of the list, 'key' and 'str' are guaranteed to contain alphanumeric characters only (A-Z, a-z, and 0-9). str can range from 1 to 1023 characters (inclusively). So if I call this function with these perameters..
Code:
node *head == /*the head of the list to be examined*/ char key == "p"char *str == "dog"The new list will look like this... node1 - 'd' node2 - 'o' node3 - 'g' node4 - 'o' node5 - 'd' node6 - 'o' node7 - 'g'
All instances of 'p' were replaced with 'dog' I have a toString function which takes in a string and converts it to a linked list and returns the head. So assume that you can call the function on str = "dog" so...
Code:
toString(str) == /*this will return the head to the list made from the str*/
If it's unclear what my question is...I am stumped on how to write the replaceChar function the one that takes in three perameters..
// Write a function called insertEntry() to insert a new entry into a linked list.
Have the procedure take as arguments a pointer to the list entry to be inserted (of type struct entry as defined in this chapter), and a pointer to an element in the list after which the new entry is to be inserted.
// The function dveloped in exercise 2 only inserts an element after an existing element in the list, thereby prenting you from inserting a new entry at the front of the list.
(Hint: Think about setting up a special structure to point to the beginning of the list.)
This is a working version of the exercise, but I don't think I'm doing what's asked. I was able to add an element to the beginning of the list using an if statement, not creating a special structure that points to the beginning of the list. How would I go about creating a special structure that points to the beginning of the list to add a new element at the beginning of the list?
Write a program that maintains a database containing data, such as name and birthday, about your friends and relatives. You should be able to enter, remove, modify, or search this data. Initially, you can assume that the names are unique. The program should be able to save the data in a fi le for use later.
Design a class to represent the database and another class to represent the people. Use a binary search tree of people as a data member of the database class. You can enhance this problem by adding an operation that lists everyone who satisfies a given criterion.
For example, you could list people born in a given month. You should also be able to list everyone in the database.
In the existing code,fork has call parallel to create process.my job is to store all the process id into vector so that we can verify the status of the jobs. I was able to save all the jobs but as the callback happen so I have lost my all value which was store into vector.
How can i maintain variable between multiple process.
You are required to write a program for a Used Car Dealer company. In the system you need to maintain the cars’ inventory and details. Each car in the company contains the following details:
• Car Registration Number • Car Make or Brand • Car Model • Car Colour (eg. Silver, Black , Red) • Year of manufacturing (The year the car was manufacture) • Engine Capacity (in cc) • Transmission (manual or automatic) • Cost of the car (SGD)
The Car Registration Number is in the format of AAA1234 or AA1234A or A1234A which is accordance to the Malaysia car registration format. The A alphabet is in accordance to the registration number for respective in Singapore. (eg. AEW9829 or W1212Y or MCD1177). Note the A and the 1234 total count in the registration number can be less than 3 like AT9829 or BHY280. The Car Make is for the identifying the manufacturer of the car like Honda, Toyota, Proton..etc. The Car Model is to represent the Manufacturers’ respective model like Honda City, Honda Civic, Honda Accord, Toyota Vios, Toyota Camry … etc.
You are required to create menu and operations for:
1) Create a new Car account 2) Edit existing Car account details 3) Remove a car account from the system 4) Search for cars in the system (based on Car Make, Model, Year of manufacturing or Price) 5) Check total inventory in the system
I need to make the functions using these function prototypes. I am mainly having problems with GetFirst() and SwapData() but how to do it..
Header File with Prototypes Code: #ifndef LINKEDLIST_H #define LINKEDLIST_H /** * @file * This file provided a doubly-linked list implementation capable of storing any arbitrary data. * The list implementation relies on a chain metaphor: a list is merely a sequence of links * (ListItems) and there is no separate construct to represent the entire list, each ListItem in it
What is "if(prev)"? Wouldn't "prev" always have the same value? Secondly, if tmp is NULL (which will be the case when the loop if(ptr->val == val) finds a match the first time it is run), is *prev assigned a NULL?
I'm having a small issue here with my linked list.I built a linked list with strings and it worked perfectly.Now since i'm using strtok() to separate the string.for now here's what i've got:
I have the codes for the functions: "Given the functions that we have discussed and defined in the class and the code that we have created, create the code for the Delete Node function and the Search function. Create an application that will incorporate all the functions that we have discussed and the new ones that you need to create. The application should allow the linked list to be built initially from a text file. The application should then allow for the user select an operation to perform. The acceptable operations are
- to search for an item - to delete an item - to enter a new item - to exit the application
After the initial build and loading of data from the textfile, the application should print a listing of each item in the list and the node that it is located in. after a delete or insert, the application should display an output of the list again showing each item in the list and the node that it resides in.
The data item for this problem will be the inventory structure that we created in class and the data is in the inventory file that you already have downloaded."
I am having difficulty getting my program to run. I have looked and looked many times trying to figure out what I am doing wrong. I have a hunch that it's my load function that's acting up, but from my perspective, my creation of my singly linked list looks good. From the creation of my singly linked list, does anything stand out as being abnormal?
I been ask to create a sorted linked list module, and to test each function with 1 unit, 2 +.so i wrote my addtofront function( we have to use the same as the teacher)
but i cant seem to test it because it always display a seg fault.... i dont know what i did wrong....how do i call this function in main to display a string i want?
I decided to make a linked list program using classes and templates.I implemented my linked list and added some basic functions, everything worked just fine. Then I proceeded to add templates...First, the error list:
#pragma once template<class T> class Node { private: Node* next;
[code]....
To sum up: Something's wrong with the templates that I used in "List.cpp" and what it could be.
My program is almost done all that is left is entering big numbers, the program can add and subtract small numbers but not big numbers because it puts them all in one node, I need the program to store each number in a node.
#include<iostream> #include<string> using namespace std; class Node { public: int value; Node * next;
I have created this program to merge two linked list into one ,but however everything is working fine but on execution it providing a segmentation fault error ( on calling merging function )
code :
#include<iostream> #include<stdio.h> using namespace std; struct node{ int data; node* link;
I am unable to make any logical algorithm to access middle of stack. I am using stack implemented with linkedlists, I have following functions available for stack like push,pop,top.