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
The difference between Return key and word Wrap
saveliy_v [14]
The enter key is used when we want to go directly to the next line while writing whereas through word wrap the cursor automatically shifts to the next line when the word limit for a particular line is exceeded
3 0
3 years ago
Sidney works in the accounting department. His boss just assigned him a task that involves creating budget formulas for the comp
madreJ [45]
In excel spreadsheets, Sidney need to consider specifying relationships between the information you have stored in your spreadsheets when creating formulas. The elements that will help you understand using spreadsheet are the constants, operators, references and functions. This will enable her to use the formulas, without hassle in spreadsheets.
6 0
2 years ago
What report shows which types of mobile devices visited a website?.
Lerok [7]

Answer:

Technology > Network report. All traffic > Source/Medium report.

Explanation:

hope this helps

8 0
1 year ago
Assume the system with 256B memory and 64B cache and the block size of 16 bytes. I.e., there are 4 blocks in the cache. (a) For
Nataliya [291]

Answer:

Check the explanation

Explanation:

1.

System = 256Byte = 8 bit

Cache = 64B , block size = 16 byte.

A) Direct Mapped Cache:

Block offset = log (Block size) = log 16 = 4bit

Total # of block inside cache = 4.

Therefore index offset = log 4 = 2bit.

Remaining is tag bits.

Therefore tag bits = 8-(4+2) = 8-6 = 2 bits

Tag                              Index offset                                Block offset

(2 bits)                             (2 bits)                                           (4 bits)

Fully associative cache :

In fully associative cache, any of main memory block can be placed anywhere in cache. Therefore index offset =0 bits.

Therefore tag bits = 8-block offset bit= 8-4 =4bits

Tag                               Block offset

(4 bits)                                (4 bits)

4 0
3 years ago
How do i win Mine Craft
Vlad [161]
Answer: defeat the dragon? I think
3 0
3 years ago
Read 2 more answers
Other questions:
  • Is full dive vr possible and can we accomplish it with today’s technology? Explain why
    13·2 answers
  • Each time the user selects an item from a list box in a web page, a postback occurs, the web page will redisplay, and the page_l
    12·1 answer
  • If you copy a drawing from the Internet and use it in a report, you might be violating the artist's
    8·1 answer
  • A network technician is attempting to add an older workstation to a Cisco switched LAN. The technician has manually configured t
    11·1 answer
  • Can anyone help me this is due today :) <br> Thank you so much
    14·2 answers
  • Write a program that accepts a positive integer N as command-line argument, and outputs True if N is the square of some integer,
    13·1 answer
  • PLZ HELP! ANSWER (WITH CORRECT ANSWER AND EXPLANATION THAT ACTUALLY IS CORRECT) GETS BRAINLIEST!
    13·1 answer
  • G i r l s o n l y j o i n <br> id= ons jcuv jke
    13·2 answers
  • File names should be limited to 144 characters.<br><br> true or false
    12·1 answer
  • Why does the media play such an important role in our personal freedom? Select 3 options.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!