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]
4 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]4 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
What is it called when you let the mouse pointer pause for a moment or two over an item?
katovenus [111]

When you let the mouse pointer pause for a moment or two over an item, it is called Hovering. Hovering means positioning the pointer to a specific object without clicking yet any mouse buttons. You also do not move it for at least a second. Hovering the mouse pointer may have the targeted object display its infotip or tooltip. 

8 0
3 years ago
Ronald attended a seminar about the best practices to use when browsing the Internet. The presenter used the following statement
Salsk061 [2.6K]

Answer:

Ronald missed the words: One-time password, Secure  

Explanation:

Whenever we use public computer, there are possibilities to steal the user data by hackers. It might not be safe to use as like we have protection in personal or Office computers. But when a situation arises to use a public system, it is always recommended to use one-time password so that the logins are not misused thereafter.

Even if the hackers try to misuse, the user will get a message / authentication reply to use the login and thus we are safe. Also, always browse only secured website ie. “https”.

8 0
4 years ago
Read 2 more answers
This is my new horrible subject lol
AysviL [449]
I’m 98% sure that it is B because customer service would be provided to people who buy from the company and need help
5 0
4 years ago
A security specialist discovers a malicious script on a computer. The script is set to execute if the administrator's account be
levacccp [35]

The security specialist has discovers a malicious script on a computer known as a logic bomb.

<h3>Is logic bomb a type of malware?</h3>

A logic bomb is known to be a form of a malicious program that is set up or ignited if a logical condition is met, such as after a series of transactions have been done, or on a given date.

Therefore, The security specialist has discovers a malicious script on a computer known as a logic bomb.

Learn more about malware from

brainly.com/question/399317

#SPJ1

7 0
2 years ago
To ensure that the original value of an argument passed to a method remains unchanged after returning from the method, you shoul
lakkis [162]

Answer:

false

Explanation:

A reference parameter passed into the method can be changed by the method, when the method changes all of a parameter's variables, the parameter will keep the changes after the method is returned.

4 0
4 years ago
Other questions:
  • Categorize the following relationships into generalization, aggregation, or association. Beware, there may be n-ary associations
    14·1 answer
  • Operating system software allows you to use your fingers, a mouse or other pointing device to select screen controls, such as bu
    5·2 answers
  • Which is the most likely reason why scientists change a model?
    12·2 answers
  • Free points ♡
    6·2 answers
  • Given half a chance other people at work will take advantage of you
    11·1 answer
  • Help please
    13·2 answers
  • Which part of the processing unit does the logic operations?<br> A. ALC<br> B. CU
    9·1 answer
  • What is 4x+2x(-3-3) thanku
    11·2 answers
  • How to execute python code in command prompt *window*?
    5·1 answer
  • Say true or false
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!