Question: Imagine you are developing a software component for a space exploration program. You can only send small numeric messages at a time. Each message is

Imagine you are developing a software component for a space exploration program. You can only send small numeric messages at a time. Each message is exactly five numbers long.Write some code that takes five integers from input and prints them out as characters, one after the other, without spaces in between.Note: You don't need to import java.util.Scanner.Sample RunUser input in [][77][97][122][101][115]Mazespublic class Answer {// Ensure the class name matches the file name public static void main(String[] args){// Declare integer variables for each character int char1=0; int char2=0; int char3=0; int char4=0; int char5=0; // Read five integers from input (assume input is provided correctly) char1= Integer.parseInt(System.console().readLine()); // Read first integer char2= Integer.parseInt(System.console().readLine()); // Read second integer char3= Integer.parseInt(System.console().readLine()); // Read third integer char4= Integer.parseInt(System.console().readLine()); // Read fourth integer char5= Integer.parseInt(System.console().readLine()); // Read fifth integer // Convert integers to characters and print them without spaces System.out.print((char)char1); System.out.print((char)char2); System.out.print((char)char3); System.out.print((char)char4); System.out.print((char)char5); }}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!