Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CCCS 111 - Introduction to Programming University of Jeddah Programming Assignment # 2 Points: 2 | CLO $2 Summary Write a program that prints out

image text in transcribedimage text in transcribed
CCCS 111 - Introduction to Programming University of Jeddah Programming Assignment # 2 Points: 2 | CLO $2 Summary Write a program that prints out a table of all ASCII characters that can be stored in a variable of type char and its various representations. Program Description Recall the two tables of 256 different ASCII characters you saw in the lecture: https://www.asciitable.com/ Dec Hx Oct Char Dec Hx Oct Html Chr Dec Hx Oct Html Chr| Dec Hx Oct Html Chr 0 0 000 NUL (null) 32 20 040 Space 64 40 100 @ 96 60 140 6#96; 1 1 001 SOH (start of heading) 33 21 041 ! ! 65 41 101 6#65; A 97 61 141 6#97; 2 002 STX (start of text) 34 22 042 " " 66 42 102 4#66; 98 62 142 6#98; MAWINE 3 003 ETX (end of text) 35 23 043 # 67 43 103 6#67; 99 63 143 6#99; c 4 004 EOT (end of transmission) 36 24 044 4#36; $ 8 44 104 & 100 64 144 4#100; d 5 005 ENQ (enquiry) 37 25 045 6#37; $ 69 45 105 #69; E 101 65 145 4#101; e 6 6 006 ACK (acknowledge) 38 26 046 6#38; 6 70 46 106 4#70; F 102 66 146 6#102; f 7 7 007 BEL (bell) 39 27 047 ' 71 47 107 4#71; G 103 67 147 g g 8 8 010 BS (backspace) 40 28 050 ( 72 48 110 4#72; H 104 68 150 4#104; h 9 9 011 TAB (horizontal tab) 41 29 051 ) 73 49 111 4#73; 1 105 69 151 4#105; i 10 A 012 LF (NL line feed, new line) 42 24 052 * * 74 4A 112 6#74; J 106 6A 152 4#106; j 11 B 013 VT (vertical tab) 43 28 053 + + 75 48 113 6#75; K 107 6B 153 6#107 12 C 014 FF (NP form feed, new page) 44 20 054 4#44; 76 40 114 6#76; L 108 6C 154 4#108; 1 D 015 CR ( carriage return) 45 2D 055 4#45; - 77 4D 115 6#77; M 109 6D 155 6#1 14 E 016 50 (shift out) 46 2E 056 . 78 4E 116 4#78; N 110 6E 156 n n F 017 SI (shift in) 47 2F 057 / / 79 4F 117 6#79; 0 Ill 6F 157 o 16 10 020 DLE (data link escape) 48 30 060 0 0 80 50 120 4#80; P 112 70 160 p p 17 11 021 DCI (device control 1) 49 31 061 1 1 81 5 Q 113 71 161 q q 18 12 022 DC2 (device control 2) 50 32 062 2 2 82 52 122 6#82; R 14 72 162 6#114; E 19 13 023 DC3 (device control 3) 51 33 063 3 3 83 53 123 4#83; $ 115 73 163 s 5 20 14 024 DC4 (device control 4) 52 34 064 4 4 84 54 124 4#84; T 116 74 164 t t 21 15 025 NAK (negative acknowledge) 53 35 065 6#53; 5 85 55 125 6#85; U 117 75 165 6#117; u 22 16 026 SYN (synchronous idle) 54 36 066 6#54; 6 86 56 126 4#86; V 118 76 166 v v 23 17 027 ETB (end of trans. block 55 37 067 7 7 87 57 127 4#87; W 19 77 167 6#119; W 24 18 030 CAN (cancel) 56 38 070 8 8 88 58 130 4#88; > 120 78 170 x x 25 19 031 EM (end of medium) 57 39 071 9 9 89 59 131 4#89; 121 79 171 y Y 26 1A 032 SUB (substitute 58 3A 072 : 90 5A 132 6#90; 122 7A 172 z z 27 18 033 ESC (escape) 59 3B 073 6#59; ; 91 5B 133 4#91; 123 7B 173 { IC 034 FS (file separator) 60 30 074 > 94 5E 136 ^ 126 7E 176 ~ ~ 31 1F 037 US (unit separator) 63 3F 077 ? ? 95 5F 137 _ 127 7F 177 6#127; DEL Source: www.Lookup Tables .com 128 144 E 160 176 192 208 224 240 29 145 161 77 193 209 225 241 130 146 162 178 194 210 226 242 IV 131 147 163 179 195 211 F 227 243 132 148 164 180 196 212 228 E 244 133 49 165 181 197 213 229 245 34 150 166 182 198 214 230 246 135 151 167 183 199 215 231 247 136 152 168 184 200 216 232 248 153 169 185 201 217 233 249 154 170 186 202 218 234 D 250 155 171 187 203 219 235 251 156 172 188 204 220 236 252 141 157 173 189 205 221 237 253 42 158 174 190 206 222 238 254 CO 143 159 175 191 207 223 239 255 Source: www.Lookup Tables.comCCCS 111 Introduction to Programming University of Jeddah Write a program using a for loop that prints all possible 256 characters in the following forms: 1. Decimal number representation (Explore the use of the %u format specifier] 2 Hexadecimal number representation (Explore the use of the %x format specifier] 3. Octal number representation (Explore the use of the 960 format specifier] 4 Character representation You already know how to print out numbers as decimal and hexadecimal numbers (using the %d l %u and %x format specifiers). Do a little research and find out how you can do the same for octal (base-8) numbers. Print out all representations of a character on a single line. Add a nice looking header at the top of your table. Use left I right alignment to make the output from your program look good. Since the table will contain 256 entries and will be too long to see without scrolling, reprint the table's header row after every 20 lines I characters. Challenge Question: Print out each character's code in binary format as well. Submission Instructions Upload an MS Word document file (.DOCX] that contains the following: 1. Source code (.CPP file) of your program. 2. Also include a screenshot of the console window output of your program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Solve the system of equations. x-y+z=-8 x+y+z=2 x+y-z=0

Answered: 1 week ago