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
Write a function that asks a user for his/her name and movie
Alex777 [14]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

                     

The code is written in C++

/******************************************************************************

                             Online C++ Compiler.

              Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

#include <string>  

using namespace std;

void display()

   {

       string yourName;

       string watchedMovie;

       cout<<"What is your name?  ";

       cin>>yourName;

       cout<<"Which movie have you seen?  ";

       cin>>watchedMovie;

       cout<<"Today, I have learned that  " <<name<<" watched "<<watchedMovie<<" movie";

   }

int main()

{    

   

   display();

   return 0;

}

 

7 0
3 years ago
The insert options button lists formatting options. true or false.
dezoksy [38]
It's true and false depending on what format you  are using.
8 0
3 years ago
What are the 5 characteristics of flowchart<br>​
olchik [2.2K]

Answer:

Here's ur answer

Explanation:

(i) Should consist of standardized and acceptable symbols. (ii) The symbols should be correctly used according to flowcharts rules. (iii) Should have short, clear and readable statements written inside the symbols. (iv) It must have clear one starting point and one ending point.

3 0
3 years ago
Explain in details three security countermeasures you know.​
SpyIntel [72]

Answer:

The three options are:

1. Avoid sharing files and folders over the network without the permission of your administrators. You might fall in trouble otherwise.

2. Never share your credit card details with a third party through the internet. You can lose a lot of or all your money.

3. Always ensure that your password is strong enough or else your account can be hacked, And never share them with anybody.

Explanation:

Please check the answer.

4 0
3 years ago
He should identify his various
joja [24]

Answer:

false, that shouldn't be a a priority to identify if they are or not.

Explanation:

3 0
3 years ago
Other questions:
  • The key invention that enabled computers to go into every home and office is
    7·1 answer
  • If reading or writing a cache line of size 64 bytes to Flash requires 2.56 μJ and DRAM requires 0.5 nJ, and if idle power consum
    9·1 answer
  • A user saves a password on a website the user logs into from a desktop. Under which circumstances will the password be saved on
    14·1 answer
  • The expectations I would discuss with Erica regarding the usage of the internet
    6·1 answer
  • Pls answer fast in five mins​
    12·1 answer
  • A group of students are collaborating on an online research project. What is an example of appropriate online behavior?
    10·2 answers
  • ____ is one of the primary operations of a computer.
    10·1 answer
  • JAVA QUESTION::
    10·1 answer
  • The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sumof the previous two, for example: 0, 1
    11·1 answer
  • What number is represented as a binary code of 101110
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!