Need Help ?
Live Chat
Signin / Signup
Home
|
Expert Q-A
|
Direct Order
|
How It Works
|
Who We Are
|
Reach Us
Sign In / Sign Up
Sign In
Sign Up
Home
/
Expert Answers
/
Other
/ code-in-c-please-challenge-activity-7-3-2-reading-from-a-string-write-code-that-uses-the-input-strin
(Answered): code in c++ please CHALLENGE ACTIVITY 7.3.2: Reading from a string. Write code that uses the input s ...
code in c++ please
CHALLENGE ACTIVITY 7.3.2: Reading from a string. Write code that uses the input string stream inSS to read input data from string userInput, and updates variables userMonth, userDate, and user Year. Sample output if the input is "Jan 12 1992": Month: Jan Date: 12 Year: 1992 1 test passed All tests passed 1 #include <iostream> 2 #include <sstream> 3 #include <string> 4 using namespace std; 5 6 int main() { 7 istringstream inss; 8 string userInput; 9 string userMonth; 10 int userDate; 11 int userYear; 12 13 getline(cin, userInput); 14 inss.str(userInput); 15 16 /* Your solution goes here */ 17 18 cout << "Month: " << userMonth << endl 19 << "Date: " << userDate << endl 20 << "Year: " << userYear << endl; 21 Run CHALLENGE ACTIVITY 7.3.2: Reading from a string. Write code that uses the input string stream inSS to read input data from string userlnput, and updates variables user Month, userDate, and user Year. Sample output if the input is "Jan 12 1992": Month: Jan Date: 12 Year: 1992 1 test passed All tests passed 3 #include <string> 4 using namespace std; 5 6 int main() { 7 istringstream inss; string userInput; 9 string userMonth; 10 int userDate; 11 int userYear; 12 13 getline(cin, userInput); 14 inss.str(userInput); 15 16 /* Your solution goes here */ 17 18 cout << "Month: " «< userMonth << endl 19 << "Date: << userDate << endl 20 << "Year: " << userYear << endl; 21 22 return; 23 } Run Feedback?
We have an Answer from Expert
View Expert Answer
Expert Answer
Answer to CHALLENGE ACTIVITY 7.3.2: Reading from a string. Write code that uses the input string stream inSS to read input data fr...
The Problem has Answer!
We have detailed solutions for you for more understanding.
View Answer