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