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
nikklg [1K]
3 years ago
9

g given the signature of a function void ascendingwords(char sentence[], int size), where sentence is an array of characters(i.e

. a null terminated string) and size is the amount of memory allocated for the buffer sentence. Complete the function to print the words in the sentence in an ascending order. the user needs to provide the input. for example if the sentence is Programming is Fun. then the function should print the output Fun is Programming
Computers and Technology
1 answer:
BlackZzzverrR [31]3 years ago
6 0

Answer:

// This program is written in C++ programming language

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

using namespace std;

// Function starts here

string ascendingwords(string sentence)

{

// Calculate length of input text

int len = sentence.length() - 1;

// Create a begin and end variable

int begin, end = len + 1;

// Declare and initialize an output string

string output = "";

// Perform iteration while there's still some text in the input string

while(len >= 0)

{

if(sentence[len] == ' ')

{

begin = len + 1;

while(begin != end)

output += sentence[start++];

output += ' ';

end = len;

}

len--;

}

begin = 0;

while(begin != end)

output += sentence[begin++];

return output;

}

// Main method starts here

int main()

{

// Declare string

string sentence;

// Prompt user for input

cout<<"Enter a string: ";

cin>>sentence;

cout <<ascendingwords(sentence);

return 0;

}

You might be interested in
Why are coders using encoder software? What are their advantages and disadvantages? And when might a coder need to use the codin
IrinaVladis [17]
<span>Coders using encoder software:
To enhance their productivity</span><span>
Speed and Efficiency
</span><span>Accuracy and consistency
</span>
Encoding is done to reduce the number of bit to be transmitted and save bandwidth .can be fairly complex and contain some delicate parts. This makes them less tolerant of mechanical abuse and restricts their allowable temperature.

<span>including increased productivity, accuracy, and efficiency in coding and the consistent application of coding rules. However, there is a cost to the software, but savings can be seen in other areas.</span>

7 0
3 years ago
Which of the following is the component of the processor that directs and coordinates most of the operations in the computer?A.
drek231 [11]

Answer:

C. control unit.

Explanation:

A processor is a miniaturized central processing unit a in digital system that interconnects and controls the activities of other components in the device.

The components of a microprocessor are the bus, registers, cache memory, arithmetic and logical unit and the central or control unit.

The bus is the transportation medium for all activities in the processor. The registers like the accumulator and the B register are memory locations used to hold the operand of an operation.The cache memory holds data meant for immediate use by the processor. Arithmetic and logical unit carries out the various arithmetic and logical operation in the processor, while the control unit is responsible for handling or managing all activities in the processor.

5 0
3 years ago
Within the try clause of a try statement, you code a. all the statements of the program b. a block of statements that might caus
SVETLANKA909090 [29]

Answer:

B) A block of statement that might cause an exception.

Explanation:

Exception handling is a good programming technique that prevents our program from crashing when an exception occurs during execution. The try clause is used with a catch to handle any exception that might occur, so whenever a statement that might cause an exception is to be used, this should be contained in a try statement block of code.

5 0
3 years ago
The entities on which data are collected are _____.
sasho [114]

Answer:

<h2>ELEMENT</h2>

Explanation:

<h3>hope it helps you!!!</h3>
8 0
2 years ago
You receive an email from someone who claims to be a representative from your credit card company. the email asks you to clink o
larisa86 [58]
You should call the company that your credit card is in and ask if you were sent an email. tell the time it was sent. the date. everything.
8 0
3 years ago
Other questions:
  • True or false? You can test your marketing emails in different email clients from within the email editor.
    10·1 answer
  • To add and remove chart elements, you can use the add chart element button in the charts layout group on the ____ tab.
    6·1 answer
  • When using the “reply all” option, your message will automatically be sent to ____ recipients of the original message. ​?
    7·2 answers
  • In an inheritance situation, the new class that you create from an existing class is known as the:
    5·1 answer
  • Derek is working at the help desk when he receives a call from a client about an issue with the company's email. The customer is
    9·1 answer
  • The multitasking, multi-user, operating system developed by Bell Laboratories that operates on a wide variety of computing platf
    13·1 answer
  • Plato Web Tech B Semester Test- I'll mark brainiest for answers to ALL
    9·1 answer
  • Sean Cody is a website most known for what?
    9·2 answers
  • Identify a statement that accurately differentiates between short-term memory and working memory.
    15·1 answer
  • a web server will utilize a directory protocol to enable users to authenticate with domain credentials. a certificate will be is
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!