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
Arman takes a picture with his smartphone which he subsequently posts online. Beatrice finds the picture online and posts a copy
KatRina [158]

Answer:C

Explanation:

5 0
3 years ago
What does BMP stand for?
OverLord2011 [107]
Hello there!

It is Bitmap.

Hope This Helps You!
Good Luck :)
6 0
3 years ago
Read 2 more answers
What is systems integration?
valina [46]

Explanation:

In engineering, system integration is process of bringing various component subsystems together into one single system and also ensuring that these subsystems function as one system together.

In information technology, it is process of linking together various computing systems and various software applications functionally or physically, to act as coordinated whole.

System integrator integrates various discrete systems utilizing variety of techniques.

7 0
4 years ago
Which type of worker would most likely be able to begin work after receiving a high school degree and completing an
makvit [3.9K]
I’m pretty sure it’s miner

“I’ll give you head I mean brainiest”
3 0
3 years ago
A university with remote campuses, which all use different service providers, loses Internet connectivity across all locations.
Anastaziya [24]

Answer:

A & D.

Explanation:

In real time operating system, the best description for this type of attack explained in the question is;

DOS and Race Condition.

Because race condition takes place when 2 or more threads are able to both access and change shared data simultaneously ,while DOS is a good foundation to build a custom made Real time operating system.

Thus, options A & D are correct.

5 0
3 years ago
Other questions:
  • Which technology is the basis for XML?
    14·1 answer
  • Your friend Rebecca called because she is working on a budget and needs help with the AutoSum feature. She thinks AutoSum will b
    8·1 answer
  • In the view that follows, which field can't be updated create view example_2 as select invoice_number, invoice_date, invoice_tot
    13·1 answer
  • Given a String variable named line1 and given a Scanner reference variable stdin that has been assigned a reference to a Scanner
    11·1 answer
  • Which best describes the Help feature of Word?
    13·2 answers
  • Is phone data used when connected to wifi
    12·1 answer
  • To enforce the concept of separating class definition from its function implementations, where should the function implementatio
    14·1 answer
  • Complete the function to return the factorial of the parameter,
    9·2 answers
  • What is the difference between information poor and information rich<br>​
    13·1 answer
  • When you try to move the desktop icon using the click and drag method and it doesn't move, what is the reason?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!