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
A software program that includes tools for entering, editing, and formatting text and graphics is called a word processing progr
shtirl [24]

i think the answer is true

7 0
2 years ago
Write c++ program to find maximum number for three variables using statement ?​
pantera1 [17]

Answer:

#include<iostream>

using namespace std;

int main(){

int n1, n2, n3;

cout<<"Enter any three numbers: ";

cin>>n1>>n2>>n3;

if(n1>=n2 && n1>=n3){

cout<<n1<<" is the maximum";}

else if(n2>=n1 && n2>=n3){

cout<<n2<<" is the maximum";}

else{

cout<<n3<<" is the maximum";}

return 0;

}

Explanation:

The program is written in C++ and to write this program, I assumed the three variables are integers. You can change from integer to double or float, if you wish.

This line declares n1, n2 and n3 as integers

int n1, n2, n3;

This line prompts user for three numbers

cout<<"Enter any three numbers: ";

This line gets user input for the three numbers

cin>>n1>>n2>>n3;

This if condition checks if n1 is the maximum and prints n1 as the maximum, if true

<em>if(n1>=n2 && n1>=n3){</em>

<em>cout<<n1<<" is the maximum";}</em>

This else if condition checks if n2 is the maximum and prints n2 as the maximum, if true

<em>else if(n2>=n1 && n2>=n3){</em>

<em>cout<<n2<<" is the maximum";}</em>

If the above conditions are false, then n3 is the maximum and this condition prints n3 as the maximum

<em>else{</em>

<em>cout<<n3<<" is the maximum";}</em>

return 0;

3 0
3 years ago
PLEASE HELP ASAP I WILL GIVE BRAINLIEST TO CORRECT ANSWER
salantis [7]
The correct answer is letter b
8 0
3 years ago
Read 2 more answers
How do you insert a table by using standard toolbar?​
MissTica

Answer:

Click the Insert Table button on the Standard Toolbar. Drag over the grid that appears to select the number of rows and columns you want. To use automatic formatting, choose Table AutoFormat from the Table menu. Select several Formats from the menu on the left to see how the table will look.

5 0
2 years ago
Which of the following syntaxes displays a dialog box, causing the user to enter input text?
maks197457 [2]

Answer:

c. prompt(text[,default Input])

Explanation:

In javaScript the prompt() method displays a dialog box which allows the user input text required by the program.

5 0
3 years ago
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    5·1 answer
  • What does LMS Date Updated mean?
    9·1 answer
  • A software license gives the owner the to use software.
    12·2 answers
  • Can Someone give me a 5 paragraph essay about all of the uses in Microsoft Word.
    9·1 answer
  • Which of the following is an example of hypertext pattern reading?
    13·1 answer
  • You change a document that is saved on your computer by cutting text from the document what happens to the text when you preform
    5·1 answer
  • In addition to using comments and track changes, you can also use the comparison feature for reviewing documents. In this activi
    11·1 answer
  • Choose the HTML5 element below that is used to configure an area on a web page that can stand on its own and could potentially b
    5·1 answer
  • mary needs to rename her report.txt file to final_report.txt. which command will allow her to do this?
    10·2 answers
  • When a support agent does not know the answer to a question, a good incident management strategy is to tell the user ____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!