WAP to input days of a week and decide "school day" or "holiday" using IF ….THEN statement. in qbasic
Answers
Answer:
considering Saturday is a holiday
Cls
Input "Enter the day"; D$
if D$ = "Monday" then
print D$;" is a school day"
else if D$ = "Tuesday" then
print D$;" is a school day"
else if D$ = "Wednesday" then
print D$;" is a school day"
else if D$ = "Thursday" then
print D$;" is a school day"
else if D$ = "Friday" then
print D$;" is a school day'
else if D$ = "Saturday" then
print D$;" is a holiday"
elseif D$ = "Sunday" then
print D$;" is a holiday"
else
print "Invalid Option"
end if
end
considering Saturday is a school day
Cls
Input "Enter the day"; D$
if D$ = "Monday" then
print D$;" is a school day"
else if D$ = "Tuesday" then
print D$;" is a school day"
else if D$ = "Wednesday" then
print D$;" is a school day"
else if D$ = "Thursday" then
print D$;" is a school day"
else if D$ = "Friday" then
print D$;" is a school day'
else if D$ = "Saturday" then
print D$;" is a school day"
elseif D$ = "Sunday" then
print D$;" is a holiday"
else
print "Invalid Option"
end if
end