Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program that takes an input string, converts each character of the string to a hexidecimal value, and stores it in a 2-dimensional

Write a java program that takes an input string, converts each character of the string to a hexidecimal value, and stores it in a 2-dimensional array (matrix). The 2-dimensional array must be of size 4x4. Within the program, create a method that repeatedly takes an input string length of 16 and prints out a 4x4 array (each 4x4 array separated by a space) until the input string is completely converted an stored in an array (this case would occur if the input string length is greater than 16). Array must be filled in a column by column order. Any remaining space in the array should be filled with a substitution character, resulting in a padded matrix. Input starts with a desired substituion character, next line is followed by the input string.

Example input 1:

~

Hola

Example output 1:

48 20 7E

6F 7E 7E

6C 7E 7E

61 7E 7E

Example input 2:

0

Een goede naam is beter.

Example output 2:

45 67 65 61

65 6F 20 6D

6E 65 6E 20

20 64 61 69

(space)

73 74 30 30

20 75 30 30

62 72 30 30

65 2E 30 30

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

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago