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
Gnom [1K]
3 years ago
6

2.20 Write an expression involving a three-letter string s that evaluates to a string whose characters are the characters of s i

n reverse order. If s is 'top', the expression should evaluate to 'pot'.
Computers and Technology
1 answer:
sergey [27]3 years ago
4 0

Answer:

The program in Python is as follows:

s = input("Three letter string: ")

if(len(s)==3):

    print(s[::-1])

else:

    print("Invalid length")

Explanation:

This prompts the user for a three-letter string

s = input("Three letter string: ")

The following if condition checks if the length of the string is 3. If yes, it reverses and print the reversed string

<em>if(len(s)==3):</em>

<em>     print(s[::-1])</em>

If otherwise, it prints "Invalid length"

<em>else:</em>

<em>     print("Invalid length")</em>

<em />

<em></em>

You might be interested in
Hi i choose brainlyest 4 free
irinina [24]

Answer:

bet

Explanation:

7 0
3 years ago
Read 2 more answers
Microsoft ________ is a cloud storage and file sharing service
kiruha [24]
<span>Microsoft Onedrive is a cloud storage and file sharing service.
</span>This hosting service operated by Microsoft enables backup, storage and sharing of photos, videos, documents, and more – anywhere, on any device. <span>Files can be synced to a PC and accessed from a web browser or a mobile device, as well as shared publicly or with specific people.</span>
4 0
3 years ago
For this project you have been asked to write a program for a local store owner. The store owner wants to keep a record of the n
elena55 [62]

Answer:

see explaination

Explanation:

#include <iostream>

using namespace std;

void display (string* name, double* purchase, int n)

{

cout<<"Name Purchase"<<endl;

cout<<"------------------------"<<endl<<endl;

for(int i=0;i<n;i++)

{

cout<<name[i]<<" "<<purchase[i]<<endl;

}

}

double calculate(double* purchase,int n)

{

double avg, sum=0;

for(int i=0;i<n;i++)

{

sum=sum+purchase[i];

}

avg=sum/n;

return avg;

}

int main()

{

int n;

cout<<"How many customer will you enter? "<<endl;

cin>>n;

string *name=new string[n];

double *purchase=new double[n];

for(int i=0;i<n;i++)

{

cout<<"Enter the customer"<<i+1<<"'s name: "<<endl;

cin>>name[i];

cout<<"Enter that customer's purchase: "<<endl;

cin>>purchase[i];

}

display(name, purchase,n);

double avg=calculate(purchase,n);

cout<<"Average purchase: "<<avg<<endl;

}

See attachment for the screenshot

7 0
3 years ago
One acre of land is equivalent to 43,560 square feet. Write a program that asks the user to enter the total square feet in a tra
lana [24]

Answer:

Explanation:

Using Python programming language:

def get_number_acres(square_feet):

   return square_feet / 43560

sq_feet = input('Enter the number of square feets >>> ')

number_acres = get_number_acres(sq_feet)

7 0
3 years ago
What is the output of the following program fragment? int alpha [ 5 ] = {100, 200, 300, 400, 500}; int i; for (i = 4; i &gt; 0;
masha68 [24]
Out put:
500 400 300 200
3 0
3 years ago
Other questions:
  • PC’s &amp; More has shifted to sales and service of laptops and PCs, where it has the potential to triple the number of its cust
    14·1 answer
  • ATM is an abbreviation that stands for Automatic Teller machine?
    5·2 answers
  • Write a while loop that prints
    13·1 answer
  • What are the advantages of using an external style sheet?
    9·1 answer
  • Which slide elements must claire use to enhance her presentation?
    10·2 answers
  • Web pages are accessed through a software program called a _____.A) ​web crawlerB) ​web browserC) ​web serverD) ​web app drawer
    5·1 answer
  • What are the programs required to work in computer
    7·1 answer
  • Your computer monitor’s power switch is in the ‘ON’ position; however, the display is blank. Which of the following is NOT a lik
    5·1 answer
  • Excel files have a default extension of ?
    12·1 answer
  • You have a slicer and a chart on the same page for your sales data by state. If you use the menu to sort by territory in alphabe
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!