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
Data values in a program are held in _________. a data types b names c variables d lockers
Tpy6a [65]

Answer:

Answered below

Explanation:

Data values in a program are held in variables. Variables are like containers for holding different types of data. A variable can be identified depending on the kind of data it holds. Variables can hold data types of integers, strings, arrays, lists, sets, Boolean etc. They hold unique data types and a can not hold different data types. Different rules exist for naming variables in different programming languages. A variable name should start with lowercase letters and be descriptive of the data it holds.

7 0
3 years ago
You can access cloud files from any computer smart phone or tablet as long as it is connected to the Internet is it true or fals
Zepler [3.9K]

Answer:yes

Explanation:

because it is the internet

8 0
3 years ago
What are some activities that work especially well in Outline view? Check all that apply.
bogdanovich [222]

The answer should be A,D,E,and F

8 0
3 years ago
Read 2 more answers
Which one of the following indicates a file's format? A. Driver B. Extension C. Icon D. Platform
Vaselesa [24]
The correct answer is B. extension

Extensions are the acronyms you see on a file such as .doc, .exe, .dll, or similar.
6 0
3 years ago
Which of these is not an application software?
fredd [130]
A; control and measurment
6 0
3 years ago
Read 2 more answers
Other questions:
  • You notice that lately your computer has been running slow. When you open up your web browser, you get endless pop-up ads to the
    8·1 answer
  • A motherboard uses dual channeling, but you have four DIMMs available that differ in size. The motherboard supports all four siz
    7·1 answer
  • Select the correct answer. Larry finds it easy to run legacy programs and applications in a virtualized environment. How does th
    5·1 answer
  • Which finger types the return or enter key?
    6·2 answers
  • Why is a monitor an output device?
    15·1 answer
  • A research team is studying parallel computing. They want to run parallel process without having to use multiple processors. How
    7·1 answer
  • Each of these is a step in cEach of these is a step in conflict resolution: Evaluate solutions suggested. Define the problem. De
    7·1 answer
  • Which task would most likely be completed by a physician’s assistant?
    12·1 answer
  • Write a program that asks the user to enter a positive integer that represents a number in the decimal system and then displays
    12·1 answer
  • Can someone reply me
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!