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]
4 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]4 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
During the installation of Windows Server 2019 Standard Edition, you encounter a disk that is marked as Disk 0 Unallocated Space
sp2606 [1]

There are different kinds of system software.  What should you do to complete the installation on this disk is to Create a new partition and then perform the installation

<h3>How are Hands-On Projects done?</h3>

This kind of project are often  completed in the right order that they were given and it often take about three hours or less to complete it in general. This projects needs:

• A system that has Windows Server 2019 that is said to be already installed based on  Hands-On Project 1-1/1-2.

• A Windows Server 2019VM2 virtual machine  also installed based  on Hands-On Project 3-5.

Note that when one wants to install an operating system, one has to  drive or make partition available so as to copy all the files..

During the installation of Windows Server 2019 Standard Edition, you encounter a disk that is marked as Disk 0 Unallocated Space on the Windows Setup wizard.

What should you do to complete the installation on this disk?

Create a new partition and then perform the installation

Load the device drivers for the Disk

Click Next to proceed with the installation

Format the disk using the Format option

Learn more about Windows Server from

brainly.com/question/25554117

6 0
2 years ago
Suppose you are given a data set consisting of nominal attributes, such as color, which takes values such as red, blue, green et
Ratling [72]

Answer:

No, you can´t.

Explanation:

An SVM uses a binary system. In this case the data consists of nominal attributes which can´t be used directly into the SVM.

However, in order to transform this normal attribute into the binary system is necessary to order the information in two sequences, in which the colors are based into two information facts that will give the system the representation that needs.

3 0
4 years ago
Given that Marcy worked 42 hours (Hours = 42) last week and earns $10.00 an hour (Rate = 10), how much did Marcy earn last week,
serg [7]

Answer: $420

Explanation: from the question above, mercy worked 42 hours at $10 an hour. Her total pay before tax is: 42 x 10 =

$420

5 0
4 years ago
Which is the correct formula to add the values in cells A1 and B1?
arlik [135]
I'm assuming you are referring to Excel. There are a few ways to add A1 and B1.

First you could use '=SUM(A1+B1)'

You could also use '=SUM(A1:B1)' which adds the values of all the cells between A1 and B1, but since they are next to each other, this would work.

You could also use '=SUM(A1,B1)' where you list all the cells you want to add with commas in between.
7 0
4 years ago
Read 2 more answers
Write MVCTester.java. When the program starts, the initial screen displays a button labeled "add", a blank text area, and a text
Debora [2.8K]

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Explanation:

import java.awt.event.*;  

import java.awt.geom.Area;

import javax.swing.*;

class MVCTester implements ActionListener{

JButton b; //button

JTextField t1; //textfiled

JTextArea area; //text area

MVCTester(){

JFrame f=new JFrame("Button Example");

//button

b=new JButton("add");  

b.setBounds(0,0,125,27);  

f.add(b);  

b.addActionListener(this);  

//textfiled

t1=new JTextField();  

t1.setBounds(0,161,125,24);  

f.add(t1);

//textarea

area=new JTextArea();  

area.setBounds(0,28,123,130);  

f.add(area);

area.setColumns (17);

area.setLineWrap (true);

area.setWrapStyleWord (false);

f.setSize(125,225);

f.setLayout(null);  

f.setVisible(true);

}

"at"Override

public void actionPerformed(ActionEvent arg0) {

Control c=new Control(area,t1,b);

}  

}  

class Control {

Control(JTextArea area,JTextField t1,JButton b){

//simple logic getting text of text area adding text of textfiled and setting the text to text area

area.setText(area.getText()+t1.getText()+"\n");

t1.setText("");

}

}

public class Modal{

public static void main(String[] args) {  

MVCTester be=new MVCTester();

}

}

8 0
3 years ago
Read 2 more answers
Other questions:
  • A university wants to install a client-server network. Which feature do you think is important for them as they set up the netwo
    8·1 answer
  • Clep allows students to do all of thw following except which?
    9·2 answers
  • A special symbol that is used as an underlining structure to an agenda
    5·1 answer
  • The term _______ is used to refer to programs that attackers install after gaining unauthorized access to a system, ensuring tha
    15·1 answer
  • Nadia has inserted an image into a Word document and now would like to resize the image to fit the document better. What is the
    6·1 answer
  • Francis has created a new program. However, Francis used some objects from another program to run methods in the current program
    14·2 answers
  • In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all
    7·1 answer
  • Which of the following letters do the most reliable websites end in?
    12·2 answers
  • Which of the following is not an example of a cyber crime?
    8·1 answer
  • The set Canvas.PaintColor to block sets the paint color for the _____ .
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!