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]
3 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]3 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
Write a program to prepare the monthly charge account statement for a customer of CS CARD International, a credit card company.
WITCHER [35]

Answer:

import java.util.*;

import java.text.*;

class CreditCardBill

{

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

NumberFormat defaultFormat = NumberFormat.getCurrencyInstance(Locale.US);

System.out.println("CS Card International Statement");

System.out.println("===============================");

System.out.print("Previous Balance: $");

double prevBalance = sc.nextDouble();

System.out.print("Additional Charges: $");

double addCharges = sc.nextDouble();

double interest;

if(prevBalance == 0)

interest = 0;

else

interest = (prevBalance + addCharges) * 0.02;

System.out.println("Interest: "+defaultFormat.format(interest));

double newBalance = prevBalance + addCharges + interest;

System.out.println("New Balance: "+defaultFormat.format(newBalance));

double minPayment;

if(newBalance < 50)

minPayment = newBalance;

else if(newBalance <= 300)

minPayment = 50.00;

else

minPayment = newBalance * 0.2;

System.out.println("Minimum Payment: "+defaultFormat.format(minPayment));

}

}

5 0
3 years ago
you have just received a new hdd so you connect it to your computer. the disk manager software recognizes the disk but when you
crimeas [40]

The most likely problem is the disk is not low-level formatted. Windows' Disk Management system software gives you the ability to carry out sophisticated storage functions.

Windows' Disk Management system software gives you the ability to carry out sophisticated storage functions. Hard disk software is used on hard disk drives to complete a variety of tasks, such as file system checks and error checking, backups, defragmentation, data recovery, and partitioning.

Initializing a new drive can be used to set up a new drive.

See Expand a basic volume to extend a volume into space that isn't already occupied by a volume on the same drive.

Utility software called disk management tools is used to manage data on disk by carrying out various operations on it. Additionally, they carry out tasks like managing drives, formatting disks, checking disks, and partitioning devices.

To know more about Disk Management click here:

brainly.com/question/2742036

#SPJ4

8 0
2 years ago
Read 2 more answers
Use the paragraph underneath to answer the four questions.
Xelga [282]
Wow...that’s a long paragraph
8 0
3 years ago
What does the Design Templates option on the
Mars2501 [29]

Answer:change the background of the slides

Explanation:

4 0
4 years ago
Bottom-up integration testing has as it's major advantage(s) that
irakobra [83]
It's C) no stubs need to be written
8 0
3 years ago
Other questions:
  • A _____ provides a file-system interface which allows clients to create and modify files.
    11·1 answer
  • Si la velocidad del sonido en el aire es de 330m/s , calcula la longitud De onda en metros, de una nota musical de frecuencia 55
    5·1 answer
  • One example of a Microsoft Store app is Select one: a. Photos. b. Paint. c. File Explorer. d. Notepad.
    10·1 answer
  • Sarah has entered data about football players from team A and team B in a worksheet. She enters names of players from team A wit
    9·2 answers
  • A website must have a unique address with all the following features
    14·1 answer
  • Which of the following allows computers to communicate with each other? RAM NIC Hard drive Floppy disk
    11·1 answer
  • Plz I need the answer!!!:(
    11·1 answer
  • What is output if month = 11 and day = 14?
    13·2 answers
  • Calculate the value of z. Given v=4, w=5, x=8, y=2z= (v+ w) * x / y;print (“value of z is “, z)
    8·1 answer
  • Which of the following statements about content-based filtering is TRUE?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!