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
Any action that causes harm to your computer is called a
oksano4ka [1.4K]

Answer:

Security risk.

Explanation:

It is making your computer vulnerable to attacks and less secure.

3 0
3 years ago
What is a trojan horse in computer science?
Firdavs [7]

Answer:

type of malware that is often disguised as legitimate software. Trojans can be employed by cyber-thieves and hackers trying to gain access to users' systems. Users are typically tricked by some form of social engineering into loading and executing Trojans on their systems.

Explanation its malware

4 0
3 years ago
State five differences between selecting and highlighting ​
exis [7]

Answer: The difference between highlighting the text and selecting the text is highlighting is when you change the highlight/back color of the text and selecting is when you temporarily highlight it to change a certain part.

Explanation:

5 0
3 years ago
Jenny, a programmer, uses Microsoft Excel 2016 to generate data required for the programs she develops. She uses various functio
Marizza181 [45]

Answer:

Math & Trig

Explanation:

INT is Math & Trig function that returns the integer part of the given number, rounds down to the nearest integer.

For example,

INT(3.1428) will give us 3

INT(-5.88) will give us -6

4 0
4 years ago
10. Realice un algoritmo que solicite números y los sume, solo se detendrá cuando se ingrese un número negativo.
Kisachek [45]
Hi! I don’t know what any of this means but I hope you have an amazing day and I hope god/allah/etc. blesses you :)
sorry I couldn’t answer
7 0
3 years ago
Other questions:
  • A ________ is when teachers develop a professional based network of people selected by him/her to pursue learning needs and shar
    12·1 answer
  • T<br> F<br> 5.<br> You can save presentations in PDF and XPS formats.
    14·1 answer
  • Which result would support the particle theory of light?
    6·2 answers
  • Which phase takes all the detailed design documents from the design phase and transforms them into the actual system? Testing ph
    7·1 answer
  • One of the biggest changes to affect the internet will be the continuing adoption of a new version of the internet protocol, ver
    5·1 answer
  • What does a capitalist economy allow people to do?
    11·2 answers
  • NEED HELP ASAP!!!!!!!!!!
    10·2 answers
  • Multiple Choice
    9·1 answer
  • There is a group of 10 people who are ordering pizza. If each person gets 2 slices and each pizza has 5 slices, how many pizzas
    9·1 answer
  • Technological advancements during the industrial age provided Americans with:
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!