From 26c475fff54a1f6569a1690b56c9ccb28047c2be Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:52:12 -0600 Subject: [PATCH] vault backup: 2024-09-18 11:52:12 --- .../{Chapter.md => Chapter 5 Exercises.md} | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) rename education/software development/ECE1400/{Chapter.md => Chapter 5 Exercises.md} (90%) diff --git a/education/software development/ECE1400/Chapter.md b/education/software development/ECE1400/Chapter 5 Exercises.md similarity index 90% rename from education/software development/ECE1400/Chapter.md rename to education/software development/ECE1400/Chapter 5 Exercises.md index 1da91d5..19f3909 100644 --- a/education/software development/ECE1400/Chapter.md +++ b/education/software development/ECE1400/Chapter 5 Exercises.md @@ -74,7 +74,7 @@ The program would print `onetwo` because each case is missing a `break` statemen | 912 | Savannah | > Write a switch statement whose controlling expression is the variable `area_code`. If the value of `area_code` is not in the table, the `switch` statement will print the corresponding city name. Otherwise, the `switch` statement will display the message `"Area code not recognized."` Use the techniques discussed in section 5.3 to make the `switch` as simple as possible. ```c -int area_code = 0; +int area_code; switch (area_code) { case 404: @@ -83,7 +83,21 @@ switch (area_code) { case 770: printf("Atlanta"); break; - case - + case 706: + case 762: + printf("Columbus"); + break; + case 229: + printf("Albany"); + break; + case 478: + printf("Macon"); + break; + case 912: + printf("Savannah"); + break; + default: + printf("Area code not recognized."); + break; } ``` \ No newline at end of file