-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMasterCode.m
More file actions
101 lines (79 loc) · 2.14 KB
/
MasterCode.m
File metadata and controls
101 lines (79 loc) · 2.14 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
101
%% clear
clear all;
close all;
clc;
%% MasterCode
choice = 3;
while (choice ~= 0)
disp(newline)
disp('Exercise 1: Press 1.')
disp('Exercise 2: Press 2.')
disp('Exit Programm: Press 0.')
disp(newline)
prompt = 'Make a choice : ';
choice = input(prompt);
while ( choice ~= 1 && choice ~= 2 && choice ~= 0)
prompt = 'Wrong input! Please try again : ';
choice = input(prompt);
end
if choice == 1
disp(newline)
disp('#Question 1.1')
disp(newline)
question_1_1
disp(newline)
disp('Press any key to continue.')
disp(newline)
pause;
disp('#Question 1.2')
disp(newline)
question_1_2
disp(newline)
disp('Press any key to make a new choice.')
disp(newline)
pause;
elseif choice == 2
disp(newline)
disp('#Question 2.1.')
disp(newline)
question_2_1
disp(newline)
disp('Press any key to continue.')
disp(newline)
pause;
disp('#Question 2.2')
disp(newline)
question_2_2
disp(newline)
disp('Press any key to continue.')
disp(newline)
pause;
disp('#Question 2.3')
disp(newline)
question_2_3
disp('Press any key to continue.')
disp(newline)
pause;
disp('#Question 2.4')
disp(newline)
question_2_4
disp(newline)
disp('Press any key to continue.')
disp(newline)
pause;
disp('#Question 2.5')
disp(newline)
question_2_5
disp(newline)
disp('Press any key to continue.')
disp(newline)
pause;
disp('#Question 2.5 reloaded')
disp(newline)
question_2_5_reloaded
disp(newline)
disp('Press any key to make a new choice')
disp(newline)
pause;
end
end