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
Why online fraud rose 79% in UK after they switched to the chip and PIN system in the first three years?
irakobra [83]

Answer:

TBH I HAVE NO FREAKING IDEA BUT I NEED POINTS BC IM DOING AN EXAM AND HAVE NO MONEY SORRY

5 0
2 years ago
An online museum is creating a site hosting hundreds of thousands of digital representations of art from around the world. The w
Firdavs [7]

Answer:

A. the museum can choose a heuristic approach which will achieve a lossless compression, but they cannot be sure that it is the most efficient compression for each image

C. algorithms for lossless compression exist, so the museum can use those to compress the image

Explanation:

4 0
2 years ago
What can we learn from the example of the wi-fi alliance with regard to the necessity of networking standards?
Vera_Pavlovna [14]
The Wi-Fi alliance is an alliance that promotes the wireless technologies and the interoperability between them. It defines the the security of the wireless technologies and the application protocols. From this example we can learn that is crucial to have one platform that defines the main characteristic of a type of network in order to have strictly defined standards and protocols, and by doing so, have interoperable networks. 
7 0
3 years ago
A farmer is going to divide her 60 acre farm between two crops. Seed for crop A costs $20 per acre. Seed for crop B costs $10 pe
Julli [10]
She would put more acres of crop b as it makes more money per acre which will give her a better investment
3 0
3 years ago
Read 2 more answers
Which of the following parts can be stored outside without contaminating the environment? A) Windshields B) Batteries C) Brake m
Lilit [14]
Windshields can be stored outside without contaminating the environment

4 0
3 years ago
Other questions:
  • Discuss two advantages and two disadvantages of agile methods.
    6·1 answer
  • To read visual and audio text means
    11·1 answer
  • Consider the following C code fragment:
    10·1 answer
  • How do I use this without the spring?
    6·1 answer
  • Owners of individual domains get to decide what content is published on their websites. Why might this autonomy be important to
    12·1 answer
  • Consider the recursive method whose definition appear below. Why? public static String mysteryString (String s){ if(s.length()==
    10·1 answer
  • the term that is used to describe how many bits are used in each pixel to show the number of colours used
    11·1 answer
  • A command, such as a button or keyboard shortcut, that performs a specific task is known as a
    9·2 answers
  • ou have a company network that is connected to the internet. You want all users to have internet access, but you need to protect
    13·1 answer
  • Apply the Fill - Teal, Accent 4, Soft Bevel text effect (the 5th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!