-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry_project1_furniture (2)
More file actions
100 lines (100 loc) · 3.92 KB
/
try_project1_furniture (2)
File metadata and controls
100 lines (100 loc) · 3.92 KB
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
99
100
# Written by Jing Wang for Program Design
# try_furniture is a Unix shell script.
# To use the script, copy it into the same directory as your scource file
# Set execute permission for the file by issuing the command:
# chmod +x try_furniture
# Compile your program, producing a.out as the executable
# To run the script, type
# ./try_furniture
# The user input from the script will not be shown on the screen.
# Compare the results from your program with the expected results on the test cases.
echo '===================================================='
#
./a.out <<-EndOfInput
0
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 0'
echo 'Invalid input. The input should be in the range of 1 to 5.'
echo '===================================================='
./a.out <<-EndOfInput
6
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 6'
echo 'Invalid input. The input should be in the range of 1 to 5.'
echo '===================================================='
./a.out <<-EndOfInput
1 0
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 1'
echo 'Enter months rented: 0'
echo 'Invalid input. Enter a positive number for months rented.'
echo '===================================================='
./a.out <<-EndOfInput
5 1
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 5'
echo 'Enter months rented: 1'
echo 'Amount due ($): 35'
echo '===================================================='
./a.out <<-EndOfInput
1 2
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 1'
echo 'Enter months rented: 2'
echo 'Amount due ($): 105'
echo '===================================================='
./a.out <<-EndOfInput
4 10
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 4'
echo 'Enter months rented: 10'
echo 'Amount due ($): 200'
echo '===================================================='
./a.out <<-EndOfInput
3 15
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 3'
echo 'Enter months rented: 15'
echo 'Amount due ($): 464'
echo '===================================================='
./a.out <<-EndOfInput
2 27
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 2'
echo 'Enter months rented: 27'
echo 'Amount due ($): 650'
echo '===================================================='
./a.out <<-EndOfInput
4 53
EndOfInput
echo '----------------------------------------------------'
echo 'Expected:'
echo 'Please select from the following menu: 1.Sofa 2. Loveseat, 3. 4 Post Bed, 4. Dresser, 5. Kitchen Table'
echo 'Enter furniture selection: 4'
echo 'Enter months rented: 53'
echo 'Amount due ($): 925'
echo '===================================================='