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
Which of the following electronic payments is ideal for micropayments?
timama [110]

Answer:

B. smart cards

Explanation:

3 0
3 years ago
Read 2 more answers
Which is the correct expansion of the term Internet? 
kirill115 [55]

Answer:

international network

Explanation:

8 0
3 years ago
Read 2 more answers
What was the pascaline used for?​
Alex_Xolod [135]

Answer:

Math like multiplication, addition, division, and subtraction

3 0
2 years ago
Research online the variety of web services (see pages 197-198) currently available to software developers. List three different
Mrrafil [7]

Answer:

  1. lastpass
  2. Hootsuite
  3. Microsoft azure

Explanation:

4 0
3 years ago
What is the difference, if any, between secure HTTP and firewalls?
Jobisdone [24]

Answer:

SSL would simply encrypt whatever request is sent to the server. In order to prevent the execution of such malicious scripts/payloads at the Web application (in other words the Web server), a Web Application Firewall is implemented in place. ... Whereas, HTTPS where SSL comes into picture would have methods such as POST.

in other words its A

5 0
3 years ago
Other questions:
  • Can someone please give me a good definition to audience expectations!<br> (in film)
    8·1 answer
  • Explain the steps users can take to maintain an operating system
    15·1 answer
  • Hunter took his sick puppy to Jade to get medication. Jade is
    14·2 answers
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • How to change screen resolution in windows 10?
    5·1 answer
  • NoSQL is a programming language used to create mobile apps.<br> a) True<br> b) False
    13·2 answers
  • You can use colors, patterns, and borders to enhance the overall appearance of a worksheet and to make it easier to read. One of
    11·1 answer
  • Richard needs to copy information from another slide presentation that uses a different design template. To ensure that the info
    10·1 answer
  • A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor.
    14·1 answer
  • Write a loop that continually asks the user what pets the user has until the user enters stop, in which case the loop ends. It s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!