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
grin007 [14]
2 years ago
11

3. Write a program that has the user enter two Strings. Display whether the first String is less than (comes first alphabeticall

y), equal to, or greater than (comes after alphabetically) the first.
Computers and Technology
1 answer:
Citrus2011 [14]2 years ago
4 0

Answer:

The solution code is written in Python 3

  1. firstStr = input("Enter first string: ")
  2. secondStr = input("Enter second string: ")
  3. if(firstStr < secondStr):
  4.    print("The first string comes first alphabetically.")
  5. elif(firstStr > secondStr):
  6.    print("The second string comes first alphabetically.")
  7. else:
  8.    print("The first and second string are same")

Explanation:

Firstly, prompt the user to input two strings (Line 1 - 2).

Next create if else if statement to check if the firstStr is less than, greater than or equal to the secondStr and then print the appropriate message accordingly (Line 4- 9). For example, the program display message "The first string comes first alphabetically." if it find the firstStr is less than secondStr.

You might be interested in
Create a game that rolls two dies (number from 1 to 6 on the side) sequentially for 10 times (use loop). If at least once out of
Alex73 [517]

Answer:

Explanation:

The following code is written in Java and loops through 10 times. Each time generating 2 random dice rolls. If the sum is 10 it breaks the loop and outputs a "You Win" statement. Otherwise, it outputs "You Lose"

import java.util.Random;

class Brainly {

   public static void main(String[] args) {

       UseRandom useRandom = new UseRandom();

       boolean youWin = false;

       for (int x = 0; x<10; x++) {

           int num1 = useRandom.getRandom(6);

           int num2 = useRandom.getRandom(6);

           if ((num1 + num2) == 10) {

               System.out.println("Number 1: " + num1);

               System.out.println("Number 2: " + num2);

               System.out.println("You Win");

               youWin = true;

               break;

           }

       }

       if (youWin == false) {

           System.out.println("You Lose");

       }

   }

}

class UseRandom{

   public int getRandom(int n)

   {

       Random r=new Random();

       int rand=r.nextInt(n);

       return rand;

   }}

8 0
2 years ago
How will I go about conducting the investigation on fake news
Leno4ka [110]

Answer:

You can begin your report, and write about CNN, BBC, or any other liberal news network.

Explanation:

5 0
2 years ago
What is one advantage of a wireless network
Tema [17]
Advantages of a Wireless Network<span> over Wired. As I mentioned in the introduction, the main </span>advantage of a wireless network<span> over a wired </span>one<span> is that users can move around freely within the area of the </span>network <span>with their laptops, handheld devices etc and get an internet connection.</span>
7 0
3 years ago
Read 2 more answers
Please
Andrew [12]

Answer:

C. 2^16

Explanation:

In Computer Networking, there are five (5) classes of IP addresses, these include;

- Class A

- Class B

- Class C

- Class D

- Class E

The various classes of IP address are represented by the value of their first octet. The first octet value of Class B is 128-191 with a subnet mask of 16.

Hence, from the IP address 149.130.x.y where x and y are 8-bit numbers. The x and y equals 16-bit numbers.

Thus, 2^16 devices can connect to the Wellesley network before we run out of IP addresses.

3 0
3 years ago
A data in database can be presented in _____ format​
Serggg [28]

Answer:

Data is stored in tables, where each row is an item in a collection, and each column represents a particular attribute of the items. Well-designed relational databases conventionally follow third normal form (3NF), in which no data is duplicated in the system. ... With a homogenous data set, it is highly space efficient

6 0
2 years ago
Other questions:
  • Which option should you select to ignore all tracked changes in a document
    6·1 answer
  • Which of the following refers to special eyeglasses from Google that provide the user with visual information directly in front
    5·1 answer
  • What is the term for a device that converts digital data from a computer into analog signals and back again?
    9·1 answer
  • Write a program that converst the temperature from Celcius to Fahrenheit. The formula is: F (9/5)C+32
    12·2 answers
  • Although designed to support remote dial-in access to a corporate network, what service below is commonly used with 802.1x port
    12·1 answer
  • The Marketing Department for CSM Tech Publishing is busy producing videos and print materials (stored in PDF format) for distrib
    6·1 answer
  • The biggest limitation of a network operating system (NOS) is _____ in terms of memory, process, device, and file management.
    7·1 answer
  • Whats with the bot spamming customer care numbers...kinda annoying when im trying to help people.
    12·1 answer
  • Jason Chang is creating photos of his restaurant for a new website. Some of the photos of the staff have red eye, others are bad
    14·1 answer
  • Greg is concerned about the use of ddos attack tools against his organization, so he purchased a mitigation service from his isp
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!