From 5dfd3085bb3ca674e1d1926167a7c1cbf4cfc0c2 Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:47:12 -0600 Subject: [PATCH] vault backup: 2024-09-18 11:47:12 --- .../software development/ECE1400/Chapter.md | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/education/software development/ECE1400/Chapter.md b/education/software development/ECE1400/Chapter.md index 2183477..1da91d5 100644 --- a/education/software development/ECE1400/Chapter.md +++ b/education/software development/ECE1400/Chapter.md @@ -59,4 +59,31 @@ switch (i % 3) { The program would print `onetwo` because each case is missing a `break` statement. -> 11. The following table shows the telephone ar \ No newline at end of file +> 11. The following table shows the telephone area codes in the state of Georgia along with the largest city in each area: + +| Area code | Major city | +| --------- | ---------- | +| 229 | Albany | +| 404 | Atlanta | +| 470 | Atlanta | +| 478 | Macon | +| 678 | Atlanta | +| 706 | Columbus | +| 762 | Columbus | +| 770 | Atlanta | +| 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; + +switch (area_code) { + case 404: + case 470: + case 678: + case 770: + printf("Atlanta"); + break; + case + +} +``` \ No newline at end of file