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
The IntList class contains code for an integer list class. Study it; notice that the only things you can do are: create a list o
torisob [31]

Explanation:

public class Int_List

{

protected int[] list;

protected int numEle = 0;

 

public Int_List( int size )

{

list = new int[size];

public void add( int value )

{

if ( numEle == list.length )

{

System.out.println( "List is full" );

}

else

{

list[numEle] = value;

numEle++;

}

}

public String toString()

{

String returnStr = "";

for ( int x = 0; x < numEle; x++ )

{

returnStr += x + ": " + list[x] + "\n";

}

return returnStr;

}

}

public class Run_List_Test

{

public static void main( String[] args )

{

 

Int_List myList = new Int_List( 7 );

myList.add( 102 );

myList.add( 51 );

myList.add( 202 );

myList.add( 27 );

System.out.println( myList );

}

}

Note: Use appropriate keyword when you override "tostring" method

8 0
3 years ago
What is the primary uses of cell phone
den301095 [7]

Some primary uses of cell phones include, keeping in touch with friends or family. As well as communicating to work and to have in the event of an emergency.

8 0
3 years ago
Read 2 more answers
Is this free? do i have to pay to use this app??
Virty [35]
No i don’t have to pay but there is additional stuff if you pay but i don’t pay for anything
3 0
3 years ago
2.3.2 Internet Safety
REY [17]

Answer:

False

Explanation:

There are also hackers online

5 0
3 years ago
Why you think Operating System is pivotal in teaching and learning.
Elina [12.6K]

Answer:

An Operating System is pivotal in teaching and learning because:

1. It enables computer users to communicate with the hardware.

2. To run any computer programme successfully, the Operating System is basic.

3. It provides a smooth interface for teachers to use video conferencing or other conferencing systems in teaching their students.

4. The OS enables the launching of other learning packages on a computer system.

5. Students can install learning apps on their systems with the help of the OS.

Explanation:

An Operating System is a software which brings about easy communication with the hardware and enablea other programs to run on the computer easily. It provides basic functionality in systems were they are installed.

6 0
3 years ago
Other questions:
  • A student is helping a friend with a home computer that can no longer access the Internet. Upon investigation, the student disco
    9·1 answer
  • Match the steps with the actions that are involved when an internal host with IP address 192.168.10.10 attempts to send a packet
    11·1 answer
  • Which computer network component allows data transfers from one computer to another through a telephone line?
    11·2 answers
  • From an IT perspective, which of the following best describes BI and BI apps?
    13·1 answer
  • Intel Centrino Technology is the combinatin of wirelesstechnology with the previous HT technology.
    14·1 answer
  • Select the correct answer. Which input device uses optical technology?
    5·1 answer
  • Can you explain the difference between software and hardware? Tell me 3 examples of each one.
    10·1 answer
  • when a picture is downloaded off the internet and then posted to social media, can the social media platform tell it was downloa
    15·1 answer
  • Hi I got a new phone and my photos are taking so long to download, on Friday it was at 13000 what do I do it’s taking so long
    14·1 answer
  • A natural language processor comes across a sentence that contains the word “weightless.” The morphology component identifies th
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!