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
Bezzdna [24]
3 years ago
5

Modify the program to include two-character .com names where the second character can be a letter or a number, as in a2.com. Hin

t: Add a second loop, following the while (letter2 <= 'z') loop, to handle numbers.
import java.util.Scanner;
public class DomainNamePrinter {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
char letter1 = '?';
char letter2 = '?';
System.out.println("Two-letter domain names:");
letter1 = 'a';
while (letter1 <= 'z') {
letter2 = 'a';
while (letter2 <= 'z') {
System.out.println("" + letter1 +
"" + letter2 + ".com");
++letter2;
}
++letter1;
}
return;
}
}
Computers and Technology
1 answer:
klemol [59]3 years ago
3 0

Answer:

add the following loop before or after the while (letter2 <= 'z') loop.

<em>letter2 = '0'; </em>

<em>while(letter2 <= '9' && letter2 >='0'){ </em>

<em>System.out.println("" + letter1 + "" + letter2 + ".com"); </em>

<em>++letter2; </em>

<em>}</em>

Explanation:

Bold formatted statement in following code is added to handle numbers:

import java.util.Scanner;

public class DomainNamePrinter {

public static void main (String [] args) {

Scanner scnr = new Scanner(System.in);

char letter1 = '?';

char letter2 = '?';

System.out.println("Two-letter domain names:");

letter1 = 'a';

while (letter1 <= 'z') {

letter2 = 'a';

while (letter2 <= 'z') {

System.out.println("" + letter1 + "" + letter2 + ".com");

++letter2;

}

letter2 = '0';

while(letter2 <= '9' && letter2 >='0'){

System.out.println("" + letter1 + "" + letter2 + ".com");

++letter2;

}

++letter1;

}

return;

}

}

You might be interested in
Which of the following is not an Error Style for data validation?
Brut [27]

Based on the Microsoft Excel data validation, the option that is not an Error Style for data validation is the <em><u>choice that does not show an error alert.</u></em>

Given that there is no option available, the best way to answer this question is to show the types of Error Styles for data validation available.

<h3>Different types of Error Style for data validation</h3>
  • Stop style: this will bring the option of "Retry, " "Cancel, " and "Help."

  • Warning style: this will show "Continue," with options of "Yes," "No," "Cancel," and "Help."

  • Information Style: this will ask you to input the whole number with the option of "Ok," "Cancel," and "Help."

Hence, in this case, it is concluded that the Error Style for data validation is Stop, Warning, and Information Style.

Learn more about Error Style for data validation here: brainly.com/question/18497347

4 0
2 years ago
What is one way for an entrepreneur to decrease risk?
marysya [2.9K]

Answer

we can  decrease risk for an entrepreneur by creating a team of trusted advisors to rely on.

there are some points that we can take in mind know how  to position our company as a safe position.

revenue streams and additional technology, paving the way for future growth.

Entrepreneurs can use all these  unique strategies to decrease those risk

8 0
3 years ago
What are 3 tools you would use to make the spreadsheet look nicer? Explain what
Lady bird [3.3K]

Answer:

Add-Ons, Add-Ins and use Excel

Explanation:

4 0
3 years ago
Drag each label to the correct location. Each label can be used more than once. Match the device to the port through which it co
son4ous [18]

Answer:

Mouse - USB

Monitor - display port, HDMI, and thunderbolt port

External hard drive - USB and thunderbolt port

Flash drive - USB

Explanation:

A computer mouse is an input device used to interact with a computer system. It connects with the computer through the USB port.

A Monitor is an output device that is used to display information on a computer system. It can be connected to the system through the display ports, HDMI, and the thunder port.

The External hard drive is a storage device that holds data for a long period of time. It has adapters to connect to the computer through the USB ports or thunderbolt ports. The flash drive is similar in function to the hard drive but small in size and storage space. It only connects with the computer through USB ports.

5 0
3 years ago
The traditional role of a manager is that of a(n):__________ a. encoder. b. sensegiver. c. communication champion. d. informatio
GREYUIT [131]

The traditional role of a manager is that of a(n):<u> information processor.</u>

<u></u>

<h3>What is called as information processing?</h3>

information processing , the acquisition, recording, organization, retrieval, display, and dissemination of information. In recent years, the term has often been applied to computer-based operations specifically. information processing.

<h3>What is information processing in computer?</h3>

Information processing refers to the manipulation of digitized information by computers and other digital electronic equipment, known collectively as information technology (IT). Information processing systems include business software, operating systems, computers, networks and mainframes.

To learn more about Information processing , refer

brainly.com/question/6392847

#SPJ4

7 0
2 years ago
Other questions:
  • Sarah is working on a project in which she needs to record all the extracurricular activities in her college. Her college teache
    13·2 answers
  • When using bits to represent fractions of a number, can you create all possible fractions? Why or why not?
    6·1 answer
  • What features are provided by most GUIs?
    7·1 answer
  • Write a function called which_vowels_present that takes a single string parameter. Complete the function to return a list of str
    6·1 answer
  • Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both players choose the same item
    9·1 answer
  • Which key is used to indent the first line of a paragraph to the right?
    15·2 answers
  • If a folder exists on an NTFS partition, which permission is needed by a user who needs to set security permissions on the folde
    11·1 answer
  • What is the most popular monitor​
    11·1 answer
  • Select all the correct answers.
    8·1 answer
  • Write a function that takes a list and returns its first element​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!