Skip to content

Commit bbee06d

Browse files
Add missing prompt folder
1 parent 2979ae0 commit bbee06d

File tree

5 files changed

+80
-2
lines changed

5 files changed

+80
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project Default is
2+
for Main use ("main.adb");
3+
for Source_Dirs use (".");
4+
package Compiler is
5+
for Switches ("ada") use ("-g","-gnata","-gnatyr");
6+
end Compiler;
7+
end Default;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package body Employee is
2+
3+
procedure Set_Attribute
4+
(O : in out Person_T;
5+
Value : String) is
6+
begin
7+
null;
8+
end Set_Attribute;
9+
10+
function Get_Attribute
11+
(O : Person_T)
12+
return String is
13+
begin
14+
return "";
15+
end Get_Attribute;
16+
17+
procedure Print (O : Person_T) is
18+
begin
19+
null;
20+
end Print;
21+
22+
end Employee;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package Employee is
2+
3+
type Person_T is tagged private;
4+
-- create primitive subprograms to set/get attributes for Person_T and
5+
-- to print the contents of Person_T
6+
procedure Set_Attribute
7+
(O : in out Person_T;
8+
Value : String);
9+
function Get_Attribute
10+
(O : Person_T)
11+
return String;
12+
procedure Print (O : Person_T);
13+
14+
-- Create a new type Employee_T based on Person with some
15+
-- additional attributes
16+
-- Create primitive subprograms to set/get these new attributes and to
17+
-- print the entire contents of Employee_T
18+
19+
-- Create a new type Position_T based on Person with some
20+
-- additional attributes
21+
-- Create primitive subprograms to set/get these new attributes and to
22+
-- print the entire contents of Position_T
23+
24+
private
25+
type Person_T is tagged null record;
26+
27+
end Employee;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
with Ada.Text_IO; use Ada.Text_IO;
2+
with Employee;
3+
procedure Main is
4+
function Read
5+
(Prompt : String)
6+
return String is
7+
begin
8+
Put (Prompt & "> ");
9+
return Get_Line;
10+
end Read;
11+
function Read_Date
12+
(Prompt : String)
13+
return String is (Read (Prompt & " (YYYY-MM-DD)"));
14+
15+
Applicant : Employee.Person_T;
16+
-- Create objects to store information for an Employee and Position
17+
18+
begin
19+
Employee.Set_Attribute (Applicant, Read ("Attribute"));
20+
Employee.Print (Applicant);
21+
-- set attributes / print contents for employee and position
22+
end Main;

support_files/build_labs_folder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def build_folder(course, destination, ada95, build):
107107

108108
prompt_source = os.path.join(source_folder, "prompt")
109109
if not has_lab(os.path.join(directory, f)):
110-
print(" No lab")
110+
print(" No lab")
111111

112112
elif os.path.exists(prompt_source):
113113
os.makedirs(destination_folder, exist_ok=True)
@@ -135,7 +135,7 @@ def build_folder(course, destination, ada95, build):
135135
gprbuild(os.path.join(destination_folder, "answer"))
136136

137137
else:
138-
print(" No prompt folder")
138+
print(" No prompt folder")
139139

140140

141141
if __name__ == "__main__":

0 commit comments

Comments
 (0)