5824 Shares

Write a c++ program to output the following ASCII table?

Write a c++ program to output the following ASCII table? Topic: Case switch statement c program
June 20, 2019 / By Davy
Question: | 0 ^@ | 1 ^A | 2 ^B | 3 ^C | 4 ^D | 5 ^E | 6 ^F | 7 ^G | | 8 BS | 9 \t | 10 \n | 11 ^K | 12 ^L | 13 CR | 14 ^N | 15 ^O | | 16 ^P | 17 ^Q | 18 ^R | 19 ^S | 20 ^T | 21 ^U | 22 ^V | 23 ^W | | 24 ^X | 25 ^Y | 26 ^Z | 27 ESC| 28 ^\ | 29 ^] | 30 ^^ | 31 ^_ | | 32 SP | 33 ! | 34 " | 35 # | 36 $ | 37 % | 38 & | 39 ' | | 40 ( | 41 ) | 42 * | 43 + | 44 , | 45 - | 46 . | 47 / | | 48 0 | 49 1 | 50 2 | 51 3 | 52 4 | 53 5 | 54 6 | 55 7 | | 56 8 | 57 9 | 58 : | 59 ; | 60 < | 61 = | 62 > | 63 ? | | 64 @ | 65 A | 66 B | 67 C | 68 D | 69 E | 70 F | 71 G | | 72 H | 73 I | 74 J | 75 K | 76 L | 77 M | 78 N | 79 O | | 80 P | 81 Q | 82 R | 83 S | 84 T | 85 U | 86 V | 87 W | | 88 X | 89 Y | 90 Z | 91 [ | 92 \ | 93 ] | 94 ^ | 95 _ | | 96 ` | 97 a | 98 b | 99 c |100 d |101 e |102 f |103 g | |104 h |105 i |106 j |107 k |108 l |109 m |110 n |111 o | |112 p |113 q |114 r |115 s |116 t |117 u |118 v |119 w | |120 x |121 y |122 z |123 { |124 | |125 } |126 ~ |127 DEL| Very confused. Tips inclide: use loops and conditionals There are 16 rows with 8 columns per row - you can use two nested loops, one for the rows and one for the columns. Use if statements to decide if when you need to print out extra spaces or whether you want to print out the character as a symbol (A) or as a descriptive word (DEL). Help would be appreciated. Using Code Blocks
Best Answer

Best Answers: Write a c++ program to output the following ASCII table?

Bambie Bambie | 2 days ago
I am afraid I took too much air from your assignment. Probably your instructor expected you to use a switch and case statements in order to gain your result, but I hope this is helpful after all. #include #include using namespace std; const char *asc33[]={ "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", "BS", "\\t", "\\n", "^K", "^L", "CR", "^N", "^O", "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", "^X", "^Y", "^Z", "ESC", "^\\", "^]", "^^ ", "^_", "SP" }; template void printOne(int i, const T c) { cout << "|" << setw(3) << i << ' ' << setw(3) << c << ' '; if ((i+1) % 8 == 0) cout << "|" << endl; } int main() { int iElements = sizeof(asc33) / sizeof (char *); int i = 0; for (i = 1; i <= iElements; i++) printOne(i - 1, static_cast(asc33[i-1])); for (--i; i <= 126; i++) printOne(i, static_cast(i)); printOne(i, static_cast("DEL")); return 0; }
👍 212 | 👎 2
Did you like the answer? Write a c++ program to output the following ASCII table? Share with your friends

We found more questions related to the topic: Case switch statement c program


Bambie Originally Answered: How can I create a program with this output?
I'm new to programming but i wrote out this if it helps you. PHP HTML part Arithmetic
Perform another task Y/N
PHP part Its probably bad coding, but it works. If you need any other help just ask

Xylina Xylina
char enter; cin >> enter; if(enter > x1 && enter < x2) // replace x1 and x2 with decrease and top sure of lowercase alphabets from ascii table cout << "decrease case alphabet" << endl; // do similar for top case and digits, and if char isn't in both this kind of three degrees, then it ought to be a particular personality. I received't provide you with an in intensity answer as it is clearly a homework question!
👍 90 | 👎 -1

Xylina Originally Answered: How do I write this program?
1. the score is in decimal format, what grade if the scores are, (89.1 to 98.9) and (59.9 to 59.99) 2. when to use try and catch block? 3. what is the display layout? 4. when exception is thrown the programming flow will be terminated, it is what you want?

If you have your own answer to the question case switch statement c program, then you can write your own version, using the form below for an extended answer.