aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk3
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-02-24 11:56:45 -0600
committerRossTheRoss <msattr@gmail.com>2019-02-24 11:56:45 -0600
commit1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47 (patch)
treec8a1dfd010bb2c052b8e554a66a51a313b821f5b /ee1301/wk3
parentGet rid of Particle stuff (diff)
downloadhomework-1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47.tar
homework-1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47.tar.gz
homework-1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47.tar.bz2
homework-1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47.tar.lz
homework-1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47.tar.xz
homework-1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47.tar.zst
homework-1890f33d93f6643c4491b0c6f10ff3ae7ac7bc47.zip
Finish 3C
Diffstat (limited to 'ee1301/wk3')
-rw-r--r--ee1301/wk3/hw3_directory/strap012_HW3C.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/ee1301/wk3/hw3_directory/strap012_HW3C.cpp b/ee1301/wk3/hw3_directory/strap012_HW3C.cpp
index 59b1347..ac7bc1c 100644
--- a/ee1301/wk3/hw3_directory/strap012_HW3C.cpp
+++ b/ee1301/wk3/hw3_directory/strap012_HW3C.cpp
@@ -4,10 +4,36 @@
#include <iomanip>
using namespace std;
char swapCase(char s) {
-
+ char New;
+ cout << "You entered " << s;
+ if (s >= 'a' && s <= 'z')
+ {
+ New= s - 32;
+ cout << ", I respond with " << New;
+ }
+ else
+ {
+ if (s >= 'A' && s <= 'Z')
+ {
+ New = s + 32;
+ cout << ", I respond with " << New;
+ }
+ else
+ {
+ cout << ", which is not a valid character";
+ }
+ }
+ cout << "." << endl;
}
int main()
{
-
+ char character;
+ do {
+ cout << "Please enter a character that is an ASCII letter in the range [A-Za-z]: ";
+ cin >> character;
+ if (character!='@') {
+ swapCase(character);
+ }
+ } while (character!='@');
} \ No newline at end of file