Question

In Java. Display certain parts of the ASCII Table using System.out.printf, in a neat tabular format...

In Java. Display certain parts of the ASCII Table using System.out.printf, in a neat tabular format (the main routine need NOT be is a separate .java file) and include ALL of the following characters:

Escape Sequences & Special Chars

Dec Hex Oct Chr Seq

    0    0    0 NUL   \0

    8    8   10   BS

    9    9   11 TAB   \t

   10    a   12   LF   \n

   12    c   14   FF   \f

   13    d   15   CR   \r

   27   1b   33 ESC

ASCII Table

| Dec Hex Oct Chr | Dec Hex Oct Chr | Dec Hex Oct Chr |

|   32   20   40      |   64   40 100   @ |   96   60 140   ` |

|   33   21   41   ! |   65   41 101   A |   97   61 141   a |

      . . .

|   62   3e   76   > |   94   5e 136   ^ | 126   7e 176   ~ |

|   63   3f   77   ? |   95   5f 137   _ | 127   7f 177 DEL |

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshots:

CODE:

public class Main
{
   public static void main(String[] args) {
      
       int i;
       System.out.printf("Escape Sequences and Special Characters:\n");
       System.out.printf("------------------------------------\n");
       System.out.printf("Dec\tHex\tOct\tChr\tSeq\n");
       System.out.printf("------------------------------------\n");
       System.out.printf("0\t0\t0\tNUL\t\\0\n");
       System.out.printf("8\t8\t10\tBS\n");
       System.out.printf("9\t9\t11\tTAB\t\\t\n");
       System.out.printf("10\ta\t12\tLF\t\\n\n");
       System.out.printf("12\tc\t14\tFF\t\\f\n");
       System.out.printf("13\td\t15\tCR\t\\r\n");
       System.out.printf("27\t1b\t33\tESC\n");
       System.out.printf("------------------------------------\n\n");
      
      
       System.out.printf("ASCII Table\n");
       System.out.printf("---------------------------------------------------------\n");
       System.out.printf("| Dec Hex Oct Chr | Dec Hex Oct Chr | Dec Hex Oct Chr   |\n");
       System.out.printf("---------------------------------------------------------\n");
       for(i=32;i<63;i++){
            System.out.printf("| %3d %3x %3o %3c ",i,i,i,i);
            System.out.printf("| %3d %3x %3o %3c ",i+32,i+32,i+32,i+32);
            System.out.printf("| %3d %3x %3o %3c   |\n",i+64,i+64,i+64,i+64);
       }
      
       System.out.printf("| %3d %3x %3o %3c ",i,i,i,i);
       System.out.printf("| %3d %3x %3o %3c ",i+32,i+32,i+32,i+32);
       System.out.printf("| %3d %3x %3o %3s   |\n",i+64,i+64,i+64,"DEL");
       System.out.printf("---------------------------------------------------------\n");


   }
}

Add a comment
Know the answer?
Add Answer to:
In Java. Display certain parts of the ASCII Table using System.out.printf, in a neat tabular format...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 6. Suppose r0-0x8000, and the memory layout is as follows: Address Data 0x8007 0x8006 0x8005 0x8004...

    6. Suppose r0-0x8000, and the memory layout is as follows: Address Data 0x8007 0x8006 0x8005 0x8004 0x8003 0x8002 0x8001 0x8000 0x79 0xCD 0xA3 0xFD 0xOD 0xEB 0x2C 0x1A Suppose the system is set as little endian. What are the values of rl and r0 if the instructions are executed separately? (a) LDR (b) LDR (c) LDR (d) LDR rl, r1, r1, r1, [re] [r0, #41 [r0], #4 [r0, #41 ! r1 - r1 - r0 - Appendix 1: ASCII Table...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT