need help with a program

PROGRAM SPECS
A veterinarian needs a program to manage his processing of his patients. When a person arrives with their pet, the pet information is input into a Pet structure. Next, the pet record is entered into his queue of patients at the proper location. The pet information consists of the owner’s name (20 characters), the pet’s name (20 characters), and an integer emergency code (0 = normal, 1 = emergency).
When the vet finishes with a patient, that animal is removed from the queue. The vet then takes the next patient in the queue. We will not consider emergencies. It will always be FIFO.
To simulate the day’s operations, a transaction file is used. Each record in the file consists of four fields:


action code (1 character) A (add this patient) or H (handle next patient)


owner’s name


pet’s name

If the action code is H, then the other two fields are not present. If the action code is A, then the other two fields are present.



the data file called patients.txt :
A Samuel Spade Fido
A John Jones Rover
A Betsy Ann Smithville Jenny
H
H
A Lou Ann deVille Kitty
H
A Tom Smythe Fifi
A Marie Longfellow Jack
H
H
H

my code so far is a work in progress
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
  
#include <iostream>
#include <list>
#include <string>
#include <vector>


using namespace std;

// 
class class_xmpl

{ 

 string petName ;

string ownerName;


 int emergencyCode ;
public:

 class_xmpl(string name_in = "James Bond", int id_in = 007)

{
 petName = name_in;



	ownerName = name_in;

 emergencyCode = id_in;

}

 void set_name(string name_in)

{

 petName = name_in;


} 

 string get_name()

{
 return petName;
}

 void set_name(string name_in)

{

ownerName = name_in;


}

 string get_name()


{ 

 return ownerName;


}

};
 

//

int main()


{


 vector <class_xmpl> vector_xmpl;


class_xmpl scrt_agent;


list <class_xmpl> L;


vector_xmpl.push_back(scrt_agent);


 system("pause");

return 0;

 }
Last edited on
closed account (o3hC5Di1)
Hi there,

Could you please be a little bit more specific about what it is you are encountering problems with? Like which part of the assignment?

All the best,
NwN
Topic archived. No new replies allowed.