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
Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline.
blondinia [14]

Answer:

#include <iostream>

using namespace std;

int main()

{

   cout<< rand() % 50 + 100 <<endl;

   cout<<rand() % 50 + 100 <<endl;

   

   return 0;

}

Explanation:

The rand() gives you a random number. If you use rand() % 50, it will give you a random number between 0 and 49. Since we are required to have the numbers between 100 and 149, add 100 to this expression. This way, you will have a random number between 100 and 149. Type this expression two times and use "endl" to end with a new line.

5 0
3 years ago
When solving a problem in a group situation, which of the following traits should be demonstrated?
kakasveta [241]

Answer:

compromise should be demonstrated

8 0
2 years ago
Explain the steps users can take to maintain an operating system
Mars2501 [29]

First is it to always clean out all the junk that is left behind by the operating system and the browsers. You can easily do this using the Disk Cleanup utility included on the windows systems. You can clean up the registry. However, you should be very careful with the registry. Any wrong move might mess up everything


Search and destroy viruses and malware on your PC by installing an anti-virus security program and setting up an automated maintenance schedule.


Defragment main and partitioned drives to keep your computer running smoothly.


Uninstall software programs and personal files like pictures, movies and music that are no longer in use to free up more space. The more the space, the faster the PC will go. You can also run the msconfig command in the RUN command prompt to uncheck start up programs that you do not use

4 0
3 years ago
To print the number of elements in the array named ar, you can write :
Diano4ka-milaya [45]

Answer:

Option c is correct.

Example :

public class Subject

{

public static void main(String [] args)

{

int ar[]={5,4,6,7,8};

System.out.println("the number of array elements are: ",ar.length);

}

}

Explanation:

The above program is created in java language in which Subject is a class name.Inside Subject class , there is main method.

Inside the main method, there is An array named 'ar' which data type is an integer and we have assigned the value to this array.

in the next line, we are printing the total no. of the element in the array with the length function which displays the length of an array or variable.

8 0
3 years ago
Which marketing strategy is represented by advertisers paying for online display ads?
e-lub [12.9K]

Answer:

The answer is (c) paid media

Explanation:

Because they are paying for the ad to be displayed online. hope this helps!

8 0
3 years ago
Other questions:
  • . Two or more functions may have the same name, as long as their _________ are different.
    9·1 answer
  • Write a program that will ask the user to input a phrase (multiple word sentence), and an integer value. A static function will
    14·1 answer
  • What major criteria must a product or process meet in order to be considered emerging technology?
    6·1 answer
  • You want to substitute one word with another throughout your document. What tool(s) should you use?
    9·1 answer
  • Ten examples of an interpreter
    8·1 answer
  • I connected to an external hard drive to transfer some photos from my vacation. When I try to drag the photo, it bounces right b
    14·1 answer
  • In python, Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" ot
    12·1 answer
  • Question 1 of 10
    15·1 answer
  • PLEASE I NEED HELP WITH THIS, IS FOR TODAY
    10·2 answers
  • With _____ technology, a web server delivers information to users, who have signed up for the service, instead of waiting for th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!