1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ladessa [460]
3 years ago
15

Instructions Write a program that asks the user for a number. If the number is between 1 and 255, the program outputs the corres

ponding ASCII character. If it is outside of that range, the program outputs Out of range.
Computers and Technology
1 answer:
Alenkasestr [34]3 years ago
8 0

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a number between 1 -255");

       int num = in.nextInt();

       if(num >= 1 && num<=255){

           char c = (char)num;

           System.out.println("The ASCII Value of "+num+" is "+c);

       }

       else{

           System.out.println("Out of range");

       }

   }

}

Explanation:

  • Use the scanner class to receive a number from the user save in a variable num
  • Use if statement to ensure the number is within the valid range num >= 1 && num<=255
  • Convert the number to the ASCII equivalent by casting it to char data type
  • Output the number and the ASCII equivalent
  • if num was out of range, print Out of range

You might be interested in
When disabling inherited permissions on an object, what happens if you select Remove all inherited permissions from this object?
Rasek [7]

Answer:

Answer explained below

Explanation:

When disabling inherited permissions on an object, if you select Remove all inherited permissions from this object then you lose every user or group assigned to the folder.

This will delete all existing permissions, including administrator accounts, leaving you a blank slate to apply your own permissions to the folder.

5 0
2 years ago
What is the advertising photographer’s main objective in creating an image?
iren2701 [21]
B. To sell it as a product
8 0
3 years ago
In the world of computing,accessibility MOST often refers to what
Nutka1998 [239]

<span>Accessibility refers to access to some form of computer technology. This means that numbers are easily organized and data is easily calculated making it easier for people’s lives. It is a means of an efficient and more productive existence in the work environment.</span>

5 0
3 years ago
In a(n) __________ situation, a wireless device is configured to appear to be a legitimate access point, enabling the operator t
Basile [38]

Answer:

A) Malicious Association,

Hope this helps.

Explanation:

7 0
3 years ago
Which of the following tasks can you perform using a word processor?
My name is Ann [436]
Create a outline of sections to be included in a document
8 0
2 years ago
Other questions:
  • Writers should avoid jargon because jargon ______. a. Takes too long to use b. Limits what ideas can be explored c. Conveys too
    12·1 answer
  • Which of the following is a correct definition of the term rectification? A. Rectification is the opposition to current flow in
    14·2 answers
  • You are working on an excel table and realize that you need to add a row to the middle of your table. what is one way to do this
    12·1 answer
  • When might be the best time to start saving for retirement?
    5·2 answers
  • If your network consists of all connected devices connecting to one central device, such as a switch, what type of topology is b
    8·1 answer
  • Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and releas
    13·1 answer
  • An administrator is helping a user connect a smartphone to a tablet via Bluetooth. What should the administrator do first?
    6·1 answer
  • One of the most common encryption protocols in use today. It is an asymmetric protocol that enables the sharing of a secret key
    7·1 answer
  • Which role will grant a delegate read-only access to a particular workspace within a user’s Outlook mailbox?
    15·2 answers
  • Connect research concepts to their definitions
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!