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
Alex73 [517]
3 years ago
9

Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)

and returns the string with all spaces removed. Moreover, the first letter of each word is to be forced to its corresponding uppercase. For example, given "hello world" as the input, the function should return "HelloWorld". The main function should prompt the user to input a string until the user types "Q". For each string input call the function with the string and display the result. (Hint: You may need to use the toupper function defined in the header file.)
Computers and Technology
1 answer:
astraxan [27]3 years ago
8 0

Answer:

#include<iostream>

using namespace std;

//method to remove the spaces and convert the first character of each word to uppercase

string

toUpperCameICase (string str)

{

string result;

int i, j;

//loop will continue till end

for (i = 0, j = 0; str[i] != '\0'; i++)

{

 if (i == 0)       //condition to convert the first character into uppercase

  {

  if (str[i] >= 'a' && str[i] <= 'z')   //condition for lowercase

  str[i] = str[i] - 32;   //convert to uppercase

  }

if (str[i] == ' ')   //condition for space

  if (str[i + 1] >= 'a' && str[i + 1] <= 'z')   //condition to check whether the character after space is lowercase or not

  str[i + 1] = str[i + 1] - 32;   //convert into uppercase

if (str[i] != ' ')   //condition for non sppace character

  {

  result = result + str[i];   //append the non space character into string

  }

}

//return the string

return (result);

}

//driver program

int main ()

{

string str;

char ch;

//infinite loop

while (1)

{

fflush (stdin);

//cout<< endl;

getline (cin, str);   //read the string

//print the result

//cout<< endl << "Q";

// cin >> ch; //ask user to continue or not

ch = str[0];

if (ch == 'q' || ch == 'Q')   //is user will enter Q then terminatethe loop

  break;

cout << toUpperCameICase (str);

cout << endl;

}

return 0;

}

You might be interested in
Let's now use our new calculator functions to do some calculations!
Sophie [7]

Answer:

Ans1.

double calc_a;

calc_a=Math.pow(3.0,2.0)+Math.sqrt(9);

Ans2.

double calc_b;

calc_b=((12.0/3.0)-(2.0*4.0));

Ans 3.

double calc_c;

calc_c=(Math.sqrt(16.0)*(7.0+9.0));

Ans 4.

double calc_d;

calc_d=Math.pow(7.0,2.0)/Math.sqrt(49.0);

Explanation:

The expressions are done with Java in answer above.

6 0
3 years ago
Need help this is for my technology class. We are doing a city research paper but it’s the rough draft and I’m doing la. But I c
serious [3.7K]
One business is " Backwards Beekeepers," Your welcome. >,<
5 0
3 years ago
Read 2 more answers
Universal Containers uses an Auto-numbering system to uniquely identify each support request. They want customers to know this n
Nookie1986 [14]

Answer:

Following are the answers.

  • Auto-response Rules
  • Case Comment Notifications

Explanation:

They use the following system to determine that requirement for help in such a special manner. They need folks to identify the amount at the earliest opportunity. So, these Auto-response Rules and Case Comment Notifications are the functionalities that the System Admin implements to provide customers to easily obtain certain data are as follows.

8 0
2 years ago
What do you need to do before you can sort and filter data in a database?
tatuchka [14]

You need to A) format the table first.

7 0
3 years ago
you are using linux and need to perform a reverse lookup of the ip address 10.0.0.3. which command would you use to accomplish t
ollegr [7]

A command you would use to perform a reverse lookup of the IP address 10.0.0.3 on a Linux system: dig -x 10.0.0.3.

<h3>What is a Linux command?</h3>

A Linux command can be defined as a software program that is designed and developed to run on the command line, in order to enable an administrator (end user) of a Linux network perform both basic and advanced tasks by only entering a line of text.

<h3>What is IP address?</h3>

IP address is an abbreviation for Internet protocol address and it can be defined as a unique set of numbers that are assigned to a computer, website or other network devices, in order to successfully differentiate them from one another in an active network system.

In Computer Networking, a command which an administrator (end user) would use to perform a reverse lookup of the IP address 10.0.0.3 on a Linux system is dig -x 10.0.0.3.

Read more on Linux commands here: brainly.com/question/25480553

#SPJ1

3 0
1 year ago
Other questions:
  • What three characteristics of a function are described in an IPO chart? What is performed at each characteristic?
    12·1 answer
  • What is Least effective at preventing a computer virus
    10·1 answer
  • You disassemble and reassemble a desktop computer. when you first turn it on, you see no lights and hear no sounds. nothing appe
    11·2 answers
  • Mary is writing an article about the animal kingdom. She wants to place image below the text. Which menu should Mary choose for
    15·2 answers
  • To hide gridline when you display or print a worksheet
    14·1 answer
  • A network administrator has been creating a baseline of network performance. During this process, he realizes that one router is
    14·1 answer
  • Which of the following plug-ins was developed by microsoft and is a software development tool used to write and run internet app
    10·1 answer
  • What is an instruction set architecture​
    7·2 answers
  • What is TLB for? Why TLB? Given the following number, what is theeffective memory access time?
    11·1 answer
  • Write a python program to print the following series 3..10..31..94......n​<br><br>Pls answer fast..
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!