C/C++ :: Student ADT - How To Delete A Record

Feb 24, 2014

My assignment for class was to create a Student ADT. I have three files. First one is Student.h which defines a Student record and has the prototypes of the functions that can be used with Student. I have Student.cc which is where the functions are actually declared. And my final file is testStudent.cc where the "main" function is that is creating a Student and callign all of the functions to make sure they work properly.

I have all of the functions working properly, except for my destroyStudentRecord function. It is supposed to deallocate the record, but I am unsure of how to actually do this. The current implementation appears to only deallocate the firstName field, as when you display the record after deallocationg it, everything still shows up except the first name. I have tried deallocating each field of the record before deallocating the record itself and that gave me the biggest list of errors I have ever seen.

I realize the implementation of some things in here might be a bit odd, but this is exactly how we are required to do things for this assignment and nothing about the implementation can really be changed unless something is actually just plain wrong(which is of course a possibility as I am quite new to this!). As I said though, everything else is working exactly as it should be, so my only issue at all is with actually deleting the record once I have created one.

Student.h:

#include <iostream>
#include <cstdlib>
using namespace std;
#ifndef _STUDENT_H_
#define _STUDENT_H_
struct Student {

[Code] ....

View 9 Replies


ADVERTISEMENT

C :: Student Record System / File Handling

Feb 25, 2013

Code:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
}

[code]....

I dont know how to modify the previous record that i have done in the Add Student function. i searched from different sites and got this code for modifying a record in a text file. But, i cant figure it out why its not working.

View 2 Replies View Related

C++ :: Manipulate Array Of Student Record Objects

May 15, 2014

Create an application to manipulate an array of student record objects. A student record will consist of a name (first, middle, and last), an ID number (9 numeric digits, cannot be more or less), an address (street, city, state, and 5 digit Zip code), and a phone number (3 digit area code and 7 digit number). The application will support an array of students. The user will be allowed to enter records from the keyboard, sort records by either name (last, first, middle) or by ID, save the records to a disk file (name supplied by user), and read the records from a disk file (name again supplied by user).

Create a fixed length string that must check that the length of the string is the required length. The fixed length class should be done as a template with the number of characters as the template argument. From this fixed length string, derive a class to hold digits of a fixed length.

Create component classes as necessary to use together to implement the student record class.

Use either the array template created in an earlier lab to handle the array or you may use the vector class from the STL to handle the array of student record objects.

The maximum number of students will be 25 (it may be less).

View 1 Replies View Related

C# :: Update Then Delete Record In Datagridview

Apr 21, 2015

In my project i need to update the attn_dateTimeOut in database.After i updated it will automatic delete the specific row record that had been updated. I had two question:

1) in my database there are a few table is assign not null."attn_dateTimeOut" is a table that haven insert any record. When i update it using below code,it work and can update but it comes out error.Error show "record cannot be null".

2) I want t make it when i updated the "attn_dateTimeOut",it will auto delete the row of updated record.I do usign back code "DeleteRecord" but it nothing change!How should i do?

Here my code:

private void txt_proximity_KeyPress(object sender, KeyPressEventArgs e) {
if (e.KeyChar == (char)13) {
TMPB_attn row_TMPN_attn = BusinessLogicLayer.TMS_GET_PROXIMITY_VALID_TO_USE(txt_proximity.Text);
if (!String.IsNullOrEmpty(txt_proximity.Text)) {

[Code] .....

View 1 Replies View Related

C/C++ :: Delete Record From Binary File?

Jan 12, 2013

How To Delete A Record From binary File - C++ ?

View 1 Replies View Related

C :: Record Data (add / Delete) In Text File

Aug 24, 2013

I'm still learning intro to C language. Currently I'm having problem with my code. The task is to ask user to input information about staff and write them into a text file. The problem occur when:

1) output in text/.exe file display random characters.

2) Data obtained from New_Staff unable to pass into Export_Profile.

3) a new output will overwrite the existing information in the text/.exe file

4) the delete function unable to delete correctly after the first time i delete a staff information in text file.

The code is as follows:

#include <stdio.h>
#include <stdlib.h>

void Menu();
void New_Staff();
void Delete_Staff();
void Export_Profile();

[Code] ....

View 4 Replies View Related

C/C++ :: How To Create Function To Delete Record Of Binary File

Aug 17, 2013

I want to create a function to Delete , Edit record of Bianry File in C++, I have tried again and gain but not success .

View 1 Replies View Related

C++ :: Program Code To Create Database Add Delete Record In Ubuntu

Feb 13, 2014

i want programcode which can be executed for create database add delete record in ubuntu

View 1 Replies View Related

C Sharp :: DropDown Values Are Changed When Delete A Record In GridView

Aug 6, 2012

I have a Gridview ,in that one of the Column is DropDownList .I have 10 Records in my Grid and my DropDown Values are like this 1,2,3....10.This is the format to store my DropDown values ,if i delete 4th Row ,then my DropDown Values are Changed like 1,2,3,4....9.This is my task ,but i'm getting this format 1,2,3,--,5...10.

View 1 Replies View Related

C :: List - Why Delete Function Doesn't Delete

Dec 9, 2014

I have to manage a Clinic. I need to delete a booking (for example, if John said he's coming on March 22nd at 15:30 but then he say he's not going to come, I have to delete that booking so another person can use it).

idSearched: the id of the person that is not going to come. I have a lot of specialties and each one has a list. So I ask for the speciality to delete the node (the node contains John's booking). If I don't find it, I return (-1). searchSpecByID return a pointer to the list where the speciality is. So head will point to the first node of the list. In nodeToDelete I have the node I want to delete.

The program detects OK when is the first in the list and when not, but it doesn't delete the node.

Code:

typedef struct bookingList{
tSpecialty specialty;
struct nodo* intro;
} tList;

[Code].....

View 7 Replies View Related

C++ :: Printing Name And GPA Of Student?

Feb 17, 2015

#include <iostream>
#include <string>
using namespace std;
struct studentType {
string name;
double gpa;

[Code] .....

View 11 Replies View Related

C :: How To Get The Average Score For Each Student

Nov 10, 2013

I have to get the average score for each student. And modify my avgmarks function and write the marks to a output txt file.

Code:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

int bubble(int*,int);
void filewrite();
void avgmarks();
void fileprint();
void filesort();
void rollin();

[Code] .....

View 1 Replies View Related

C++ :: Student Grades Do Not Print?

Mar 26, 2013

//******************************************************************************
// GradeCalculator.cpp
// Input: Student Grades in Each Category
// Output: Final Grade, Numerical Grade, Witty Comment
// Final Grade Calculator
// This program calculates a final grade using a formula, assigns a
// corresponding letter grade, and outputs a "witty" comment to the user.
//******************************************************************************

#include <iostream>
#include <fstream> // For file I/O
#include <string>
#include <iomanip>
#include <cmath>

using namespace std;

// Declare function prototypes
void OpenFiles(ifstream&, ofstream&);

[Code] .....

View 1 Replies View Related

C :: Add More Student Information To The Specific Txt File?

Mar 12, 2013

I'm trying to add more student information to the specific txt file. I did struct my student information and separated it with an array with max size of 200.

The inside of my current file looks like

Toshi
Aka
Nonal
Donald

The first one represent student[0] and next one is student[1] and so on till student[199]. Right now, only 4 space is occupied, which means the array has information till student[3] but not from student[4] (I guess it has null condition).

What I want to do is, I want to add a new student information to student[4] and till student[199] once at each time.

So, my prompt will look like
Would like to add a new student? Y/N
(if yes goes to below statement and exit if NO)
Hi. Please enter the information of new student. ___________
Student added. Please press any key to continue.

If the key is pressed, it goes back to my initial prompt and continues till I press N.

I sure I'm not using for loop to do this thing, because I'm adding student name one by one.

However, the array is already occupied by other student name till student[3] so, I want to add a new student information to student[4] (I don't want to overwrite the current information). And if student[4] is occupied, then [5] and so on.

View 7 Replies View Related

C# :: Display Student Who Get Highest Marks

Aug 14, 2012

i wnt to display student who get highest marks among them...i have code for finding maximum marks from them but don't kne how to print only top 5 student...

Code:

static void Main(string[] args)
{
Console.WriteLine("Please Enter Number of Students :");
int n = Convert.ToInt32(Console.ReadLine());
StudentDetails[] student = new StudentDetails[n];
for (int row = 0; row < n; row++)
{
Console.WriteLine("Please Enter Student name :");

[Code]...

(dis code in Visual Studio)

View 6 Replies View Related

C++ :: Linked List Of Student Database

Mar 6, 2013

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)

Code:
#include <iostream>
#include <string>
using namespace std;
struct StudentRecord {

[Code] ....

View 4 Replies View Related

C++ :: How To Change Just A Single Student Data

Jan 6, 2015

For Example i have made a text file included some students data. Now i want to change just a single student data. That file should remain same just that student's data replace.

View 3 Replies View Related

C++ :: What Is Process Of Student Profiling System

Oct 3, 2014

what is the process of student profiling system using c++?

View 2 Replies View Related

C++ :: Linked List To Store Student ID And GPA

Apr 2, 2014

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

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;
struct Student {
string name;
double gpa;

[Code] ....

View 1 Replies View Related

C++ :: List Class With Student Type?

Jul 3, 2013

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?

Node.h
#ifndef NODE_H
#defineNODE_H
#include <string>

[Code].....

View 6 Replies View Related

C/C++ :: Writing And Sorting Student Report

Sep 27, 2014

I'm trying to write a table (2D array) with a string of random chars in one row for the student names, six other rows for the project numbers and random numbers for the grades.Then calculate the averages of grades per student and per project, add them as the last row and the last column. And write a menu of 4 options:

1- sort per student names (alphabetical order)
2- sort per student grades (in increasing order)
3- sort per project grades ( in increasing order)
4- exit

The program must continue execution after displaying any report, need to use an infinite loop, it exits only if the chosen 'exit'.

Here's what I have:

#include <ctime>
#include <string>
#include <iomanip>
#include <iostream>
using namespace std;
ints=12,p=6;
stringnames[20];

[Code] ....

And then, I need to show interactively the same report with all types of sorting:

sort table by any row, (user enters the row number)

sort table by any column. (user enters the col number)

sort table sorted by student names as well.

View 12 Replies View Related

C :: How To Search For Record And Deletes It

Apr 9, 2013

I am trying to get my program to search for the account ID in the structure and deletes the record as the account ID is found. The problem is that my codes are not working. (since my whole program is too long, I only show a part of it.) Here are my codes:

Code:

#include <stdio.h>
#include <string.h>
struct Account
{
char* Account_ID;
char* AccountOwner_FirstName;
char* AccountOwner_LastName;
}

[code]....

View 4 Replies View Related

C++ :: Adding New Record To Array?

Feb 1, 2013

I'm having some issues with adding a record to my array.

#include <iostream>
#include <fstream>
#include <string>

[Code].....

View 2 Replies View Related

C++ :: How To Sell Record / Title

Sep 24, 2014

Alright I no longer have compiler errors. I require writing code for selling a record. How would I go about that?

#include <iostream>
#include <cstdlib>
#include <string>
#include <fstream>
#include <cctype>
#include <conio.h>
using namespace std;
//declare variables
void Add();

[Code] ...

View 9 Replies View Related

C++ :: Reading From TXT File That Is A Record

Apr 18, 2014

I'm working on a program using class booktype... to hold information about various books that I have saved on a txt file. Each object of the class book type holds the author, publisher, ISBN, number of copies in stock.

I am still very much new at c++ and not exactly sure how to get in info from the file I've made earlier..

Code:
#include<iostream>
#include<iomanip>
#include<string>
#include<cstring>
#include<fstream>
using namespace std;
class bookType {

Also the text file is formatted where after I've entered the author's name I then hit return, then publisher then I hit return, ISBN then return, and so forth does that effect the program? As for my txt file this is what I have

Code:
Moby Dick
Sebastian Armesto
Oberoson Books Ltd
0001
201
The Scarlet Letter

[Code] ....

View 6 Replies View Related

C :: Trying To Match Student ID With Highest Score Along With Grade

Nov 25, 2013

I am trying to correlate the student's highest score with that student's ID. The old code is in blue and the new code is in green which includes a sort. The particular information in question is in red.

Ide1

Code:
#include <stdio.h>
int main(void) {
/*Set up two arrays to include up to 50 elements each.*/
int st_numval_id[50] = {0}, st_val_tstscr[50]= {0}, i = 0, j = 0, temp;

[Code] .....

Enter the student's id and test score:

/*After the following input, then enter 0 to end the input*/

Student ID Test Score Letter Grade
------------ ----------- --------------
1653 77 C
1945 72 C
1020 50 F
1955 92 A
1900 81 B

ABOVE AVERAGE STUDENTS

Ave Test Score Students Above Ave Number of: A's B's C's D's F's
----------- ---------- --------- --- --- --- --- ---
62.00 4 1 1 2 0 1

THE STUDENT WITH THE HIGHEST TEST SCORE

Student ID Test Score Letter Grade
--------- ---------- ------------
1900 0 F

Press any key to continue...

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved