Write a C++ program to prompt for three string variables, City, State, and Zip Code. All of them should be from separate prompts. Convert the first character of each variable to uppercase. rThen concatenate the three formatted strings, separated by a single space and print them as one string variable. Use the string functions to do so.
Hi, we are not going to do your homework since this is not what this forum is for. If you need help, please post the code you have written and point out where the problems are and what is not working. Then we can surely help you.
you can use std::cout for the prompt and the output and std::cin for the input
You can use toupper to convert a character to uppercase.
You can use operator+ to concatenate strings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
#include <string>
#include <cctype>
int main()
{
std::string city;
std::cout << "City: ";
std::cin >> city;
city[0] = (char)toupper(city[0]);
std::string data = city + " " + "some other things";
}