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
chubhunter [2.5K]
3 years ago
7

Write a program in Java to input a letter. If it is an uppercase letter then

Computers and Technology
1 answer:
Vadim26 [7]3 years ago
7 0

Answer:

The program is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 char chr;

 System.out.print("Input Character: ");

 chr = input.next().charAt(0);

 if(Character.isUpperCase(chr) == true){      chr+=5;  }

 else{      chr-=3;  }

 System.out.println("Encode Character: "+chr);

}

}

Explanation:

This declares the character

 char chr;

This prompts for input

 System.out.print("Input Character: ");

This gets the input from the user

 chr = input.next().charAt(0);

This checks for uppercase; if true, it is encoded by the next 5th

<em>  if(Character.isUpperCase(chr) == true){      chr+=5;  }</em>

If lowercase, it is encoded by the previous 3rd

 else{      chr-=3;  }

This prints the encoded character

 System.out.println("Encode Character: "+chr);

You might be interested in
Match these items. 1 . Naturalization Act stated that a foreigner had to live in the United States fourteen years to become a ci
Romashka-Z-Leto [24]

Answer and Explanation:

1. Naturalization Act:

  • Expressed that an outsider needed to live in the United States fourteen years to turn into a native.

2. Judiciary Act:

  • It was an effort to save Federalist standards

3. Sedition Act:

  • Approved fines up to $5,000 and detainment for ruining the legislature.

4. Alien Act:

  • Allowed the President to oust aliens or outsiders whom he judged "risky"

5. Alien and Sedition Acts:

  • Constrained through Congress by the Federalists.

6. Alien Enemies Act:

  • Allowed the President to detain or extradite hazardous outsiders or aliens in time of war
8 0
3 years ago
What are 25 items that trees made?
alexandr1967 [171]

Answer:

(things,can't think of more

.......)

  • paper
  • charcoal
  • doors
  • chairs
  • jewelry
  • wood frames
  • broom handles
  • furniture made with wood
6 0
3 years ago
Read 2 more answers
A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Whic
Nikolay [14]
This totally depends on what they need and what they are willing to spend. If they just need access to google docs/ sheets etc for example (so just the web with a web browser), either Linux / Un*x or Windows will do and linux is the free choice. If they want to be part of the microsoft ecosystem or use some windows specific software they will need to use Windows or an emulator in Linux.

I would not recommend MSDOS in this day and age.
7 0
3 years ago
Read 2 more answers
You want to search the web for information on the movie Captain America: Civil War. What would be the best way to enter the key
Digiron [165]

Answer:

Option C i.e., Captain America: Civil War.

Explanation:

When the user required the data or information of the movie Captain America: Civil War then, the following option is the best format to search for the information of the movie because if any user search anything in the proper format then they gets better results related to the following search and if the user enters improperly then they also get the information but it takes some time to satisfy you.

7 0
3 years ago
DIMM is a type of which component? <br> 1.CPU<br> 2.RAM<br> 3.expansion slot<br> 4.chipset
gulaghasi [49]

Answer:

2.RAM

Explanation:

BECAUSE IT CAN BE EASILY VIRIFIED ON THE INTERNET

7 0
3 years ago
Other questions:
  • If I gain a rank and go under the points that the rank coust do I lose the rank
    8·2 answers
  • Which of the following terms best describes the product development process?
    8·1 answer
  • During the _____it is important to figure out how the test will be scored.
    9·1 answer
  • Variable-length entities. fixed-length entities. data structures that contain up to 10 related data items. used to draw a sequen
    14·1 answer
  • Related to Image Classification
    13·1 answer
  • What is the full form of USB​ ?
    15·1 answer
  • Based on the details in The Riddle of the Rosetta Stone, how did the career of Jean-Baptiste Fourier differ from that of Jacques
    9·2 answers
  • Write a print statement that displays a random integer between 5 and 5000. Assume the random library is imported.
    12·1 answer
  • A typical day in programming and software development would involve
    7·1 answer
  • 2y/3 - y-1/6 + 7y-1/4 = 2 1/6​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!