aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk3/hw3_directory/strap012_HW3C.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ee1301/wk3/hw3_directory/strap012_HW3C.cpp')
-rw-r--r--ee1301/wk3/hw3_directory/strap012_HW3C.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/ee1301/wk3/hw3_directory/strap012_HW3C.cpp b/ee1301/wk3/hw3_directory/strap012_HW3C.cpp
index 7267e02..69eb51f 100644
--- a/ee1301/wk3/hw3_directory/strap012_HW3C.cpp
+++ b/ee1301/wk3/hw3_directory/strap012_HW3C.cpp
@@ -13,23 +13,18 @@ Character Detection
#include <cmath>
#include <iomanip>
using namespace std;
+
char swapCase(char s) {
char New;
cout << "You entered " << s;
- if (s >= 'a' && s <= 'z')
- {
+ if (s >= 'a' && s <= 'z') {
New= s - 32;
cout << ", I respond with " << New;
- }
- else
- {
- if (s >= 'A' && s <= 'Z')
- {
+ } else {
+ if (s >= 'A' && s <= 'Z') {
New = s + 32;
cout << ", I respond with " << New;
- }
- else
- {
+ } else {
cout << ", which is not a valid character";
}
}