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
vivado [14]
3 years ago
14

Write a program that prompts the user to enter three words. The program will then sort the words in alphabetical order, and disp

lay them on the screen. The program must be able to support words with both uppercase and lowercase letters. You must use C style strings (string class).
Computers and Technology
1 answer:
Softa [21]3 years ago
3 0

Answer:

#include <iostream>

#include<bits/stdc++.h>

using namespace std;

bool sorter(string a, string b)

{

   return a<b;

}

int main(){

   string wordList[3];

   string word;

   for (int i = 0; i < 3; i++){

       cout<< "Enter word: ";

       cin>> word;

       wordList[i] = word;

   }

   sort(wordList, wordList+3, sorter);

   for (int i = 0; i < 3; i++){

       cout<< wordList[i]<< "\n";

}

}

Explanation:

The C++ source code prompts the user for string words that are appended to the wordList array. The array is sorted with the sort() function from the C++ bits library. The finally for loop statement prints out the items in the array.

You might be interested in
Final one bit l y links are a virus that will corrupt your files do not go on it
diamong [38]

Answer:

ok mk

Explanation:

3 0
2 years ago
Read 2 more answers
Life Decisions Cyber Cafe is a cafe with free Internet service and computers that are linked to various online career opportunit
djverab [1.8K]

Answer:

The correct answer is d) all of the above

Explanation:

The size of the info is necessary to give the users heads up about the amount of data needed to access it, the type of the video is also important so the user can know the environment appropriate for viewing it and also tips for viewing will help users know the requirements needed to view it.

4 0
3 years ago
Design the logic for a program that allows a usher to continuously enter numbers until the usher enters 0. Display the sum of th
uysha [10]

int sum = 0, n;

do {cin>>n; sum+=n;}while (n!=0);

cout<<sum;

5 0
3 years ago
Why ues storage unit?​
Jet001 [13]

Huh? I don’t understand your question... please be more specific so we can help you

6 0
3 years ago
How could the following line of code be shortened?
Alinara [238K]

Answer:

2

Explanation:

The second option is the only one that will work. The last would work but doesn't make the code any shorter.

8 0
1 year ago
Other questions:
  • How do you get 99 points on sunny meadows simulation?
    6·2 answers
  • The TabIndex value assigned to a text box's identifying label must be _______________ for the text box's access key to work corr
    14·1 answer
  • Write the percentage 5 1/4 as a decimal​
    8·1 answer
  • What is the acronym that helps you remember the order of math operations?
    9·2 answers
  • HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical control
    12·1 answer
  • We want to transmit 40 packets and the following packets are getting lost, 3,9, 25,28, 35. How many rounds are needed if
    5·1 answer
  • . Which of the following is NOT a valid declaration for a character string?
    6·1 answer
  • JPG is considered a lossy file format. What does this mean?
    15·2 answers
  • If you want the input gear to spin in the same direction as the output gear you must use a _______ gear.
    13·1 answer
  • State the difference between font colour and shading.​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!