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
AleksAgata [21]
3 years ago
12

Write a program that uses the function strcmp() to compare two strings input by the user. The program should state whether the f

irst string is less than, equal to, or greater than the second string7. Write a program that uses the function strcmp() to compare two strings input by the user. The program should state whether the first string is less than, equal to, or greater than the second string
Computers and Technology
1 answer:
Andru [333]3 years ago
3 0

user_str1 = str ( input ("Please enter a phrase: "))

user_str2 = str ( input("Please enter a second phrase: "))

def strcmp (word):

user_in1 = int (len(user_str1))

user_in2 = int (len(user_str2))

if user_in1 > user_in2:

return "Your first phrase is longer"

elif user_in1 < user_in2:

return "Your second phrase is longer"

else:

return "Your phrases are of equal length"

You might be interested in
How to learning algothrim bett
Stells [14]
The GCSE Computing MOOC (created with Cambridge University Press and Raspberry Pi) can be used either as a course or a flexible teaching resource,
8 0
3 years ago
If someone said to you, “Pseudocode is a waste of time! It’s just more work because you end up writing the same program twice,”
myrzilka [38]

Answer:

It allows the designer to focus on main logic without being distracted by programming languages syntax.

* Since it is language independent, it can be translated to any computer language code.

* It allows designer to express logic in plain natural language.

* It is easier to write actual code using pseudocode.

* Unlike algorithms, pseudocodes are concise so pseudocodes are more readable and easier to modify.

Explanation:

8 0
2 years ago
Explain how communication is smooth and efficient working​
ohaa [14]

Answer:

To communicate effectively, you need to avoid distractions and stay focused. Inconsistent body language. Nonverbal communication should reinforce what is being said, not contradict it. If you say one thing, but your body language says something else, your listener will likely feel that you're being dishonest.

8 0
2 years ago
Read 2 more answers
Can someone tell me how this is a SyntaxError! (Python3)
Basile [38]

Answer:

The expression on line 9 required 2 brackets

Explanation:

Given

The attached code

Required

Why syntax error.

The error points to line 10, but the error is actually from line 9

To get an integer input, the syntax is:

variable-name = int(input("Prompt"))

From the attached code, the line 9 is:

amount = int(input("Enter cheese order weight: ")

By comparing the syntax to the actual code on line 9, only 1 of the brackets is closed.

<em>This, in Python 3 is a sytax error</em>

6 0
3 years ago
Write a program that accepts a whole number as
SashulF [63]

This is for Python

number = int(input('Number: '))

number = number * 12

print(number)

3 0
2 years ago
Other questions:
  • Remember that the function "main" takes optional parameters, these being common:
    10·1 answer
  • Which of the following is an example of a logic bug?
    8·1 answer
  • Can someone please help me with the three questions please?
    6·1 answer
  • The array mycats is an 8 element array of type kitty that has already been declared and initialized. write the expression(s) in
    5·1 answer
  • If a triathlon is a sport combining three events, what do you think would be the word for a sport combining five events?
    7·1 answer
  • Ayudaa, 5 ejes de sistemas tecnológicos
    5·1 answer
  • A ____ can be used to enter, display, or edit data
    5·1 answer
  • All _______ that store more than one piece of data ​
    12·1 answer
  • Briefly explain how Riboflavin deficiency lead to disease state.​
    15·1 answer
  • What is the difference between a computer’s RAM and its hard disk?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!