Home /
Expert Answers /
Computer Science /
in-java-pls-assignment1c-and-the-next-letter-is-each-data-type-in-your-programming-language-has-pa541
(Solved): in java pls Assignment1C: And the next letter is... Each data type in your programming language has ...
in java pls
Assignment1C: And the next letter is... Each data type in your programming language has unique properties. One of the interesting properties of the char data type is that even though it looks like a letter, it can also act like a number. For example, it's possible to add or subtract from the char value to get a different letter! Your task for this assignment is to prompt the user to enter a single letter. You must store this letter as a char value. Then you must print out the next three letters in alphabetical order. This can be done by adding an integer to the char value and saving the results in another char variable. When you have all three letters, you can concatenate (combine) them as part of a string or print statement. Note: Depending on your programming language, you may need to "cast" one datatype to another as part of this assignment. This can be done by putting the desired datatype name in parenthesis next to the value you want to cast, like so: int \( i= \) (int) \( (3.2+2.4) \) Ask your lab instructor if you need help with this concept! An example of the program's output is shown below. Your program's output must match this format, but it should work for any valid user input. Save your source code in a file called Assignment1C (with a file extension of .cpp, .cs or .java) Sample Output:
Program steps : 1. Declare Scanner object Scanner sc = new Scanner(System.in); 2. The method next() from Scanner class reads String. The method charAt() extracts a character from the required position. Store the first letter as input character. char