-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsw_Lab3.m
More file actions
34 lines (34 loc) · 1014 Bytes
/
csw_Lab3.m
File metadata and controls
34 lines (34 loc) · 1014 Bytes
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
%Pizza App Software
clc;clear;
fprintf(['Pizzas available today:\nA) Cheese B) Hawaiian C) Meat Lovers ' ...
'D) Pacific Veggie\nE) Pepperoni F) Sausage G) Spinach and Feta H) The Works\n'])
p = input('Pizza choice: ','s');
if p == 'A' ||p == 'B'||p == 'C'||p == 'D'||p == 'E'||p == 'F'||p == 'G'||p == 'H'
s = input('Choose your size - 1)Small 2)Medium 3)Large: ');
if p=='A'||p=='E'||p=='F'
c1=0;
else
c1=2;
end
if s==1||s==2||s==3
n = input(['Number of pizzas to purchase: ' ...
'']);
if s==1
c2=9.99;
elseif s==2
c2=11.99;
else
c2=13.99;
end
if n>=1 && n<=25
c = (c1+c2)*n;
fprintf('Total cost: $%.2f',c)
else
fprintf('Invalid option; please try again.');
end
else
fprintf('Invalid option; please try again.');
end
else
fprintf('Invalid option; please try again.');
end