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
scoray [572]
3 years ago
12

Declare a character variable letterStart. Write a statement to read a letter from the user into letterStart, followed by stateme

nts that output that letter and the next letter in the alphabet. End with a newline. Hint: A letter is stored as its ASCII number, so adding 1 yields the next letter. Sample output assuming the user enters 'd': de
Computers and Technology
1 answer:
natka813 [3]3 years ago
8 0

Answer:

public class ANot {

   public static void main(String[] args) {

       System.out.println("Enter a char");

       Scanner in = new Scanner(System.in);

       char letterStart = in.next().charAt(0);

       char nextCha = (char)(letterStart+1);

       System.out.print(letterStart);

       System.out.println(nextCha);

   }

}

Explanation:

The main logic here is understanding that characters in Java are stored as ASCII numbers and as such some mathematic operations can be carried out on them. So we add 1 to the value of the entered character to get the character next to it, the opposite is also possible (Subtracting 1 to get the value before it)

Note also that in reading a character using the scanner class Java does not support the nextChar like it does for other primitive data types so we use the method charAt(). To obtain the character at a particular index.

You might be interested in
In two to three sentences, describe one advanced search strategy and how it is useful.
Sveta_85 [38]

Answer:

A search stagey is useful because you can make complicated searches easily and also get reliable data.

8 0
3 years ago
You need to update your router settings, so you log into the administration panel, Whose Internet protocol (IP) address is 192.1
devlian [24]

Answer:

D

Explanation:

5 0
2 years ago
True or false scientists investigate and seek to explain the natural world
weqwewe [10]
<h2>True</h2>

<h3>Reason;</h3>

We have got so many discoveries just bcoz of this investigation by scientists.

7 0
3 years ago
460N of force is exerted on an object with a surface area of 2,5m.How much pressure is felt by the object?​
BartSMP [9]

Explanation:

p=F/A

p=460N/2m×5m

=46N/m2

7 0
2 years ago
Read 2 more answers
This is your code.
lubasha [3.4K]

Answer:

35

Explanation:

We will be going inside B array, because he was in second place in array E,and will be the first element of array B, so it's 35

E can be understanded as:

E=[[21, 'dog', 'red'],[35, 'cat', 'blue'],[12, 'fish', 'green']], so, you can see array E as array of arrays or so-called two-dimensional array

6 0
2 years ago
Other questions:
  • A technology _____ begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is
    13·1 answer
  • The Left Shift key is used to capitalize which keys?
    5·2 answers
  • In the windows firewall, any rules preceded by a __________ checkmark have not been enabled. black gray green red
    13·1 answer
  • Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T
    14·1 answer
  • Wap to input any multi digits number and display the sum of odd digits and even digits​
    5·1 answer
  • Is downloading like installing?
    13·1 answer
  • Which one is correct
    8·1 answer
  • What is the trickiest time of the day to drive? A. Early morning B. Late night C. After the sun sets
    8·2 answers
  • WILL MARK CORRECT ANSWER AS BRAINLIEST PLSSSS HELP!
    13·2 answers
  • 8
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!