In this exercise, you modify the Social Security Number program from the chapter. If necessary, create a
Question:
In this exercise, you modify the Social Security Number program from the chapter. If necessary, create a new project named Intermediate24 Project and save it in the Cpp8\Chap13 folder. Enter the instructions from Figure 13-22 into a source file named Intermediate24.cpp. Change the filename in the first comment. Before inserting the missing hyphens, verify that the nine characters entered by the user are numeric. Save and then run and test the program.
Transcribed Image Text:
1 //SSN.cpp - displays the Social Security number with hyphens 2 //Created/revised by
1 //SSN.cpp - displays the Social Security number with hyphens 2 //Created/revised by on 3 4 #include 5 #include 6 using namespace std; 7 8 int main) 9 { string ssn = ""; cout « "Nine-character Social Security number: "; getline(cin, ssn); 10 11 12 13 if (ssn. lengthO 9) { //insert hyphens ssn.insert(3, "-"); //xxx-xxxxxx ssn.insert(6, "-"); //xxx-xx-XXXX cout <« "Social Security number: } else cout « "The number must contain 9 characters" « endl; //end if return 0; 14 15 16 17 18 19 « ssn << endl; 20 21 22 23 24 25 } //end of main function a Social Security Number Nine-character Social Security number: 111220000 Social Security number: 111-22-e00a Press any key to continue Figure 13-22 Social Security Number program
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 80% (10 reviews)
Intermediate24cpp displays the Social Security number with hyphens Createdrevised by on include inc...View the full answer
Answered By
John Aketch
I have a 10 years tutoring experience and I have helped thousands of students to accomplish their educational endeavors globally. What interests me most is when I see my students being succeeding in their classwork. I am confident that I will bring a great change to thins organization if granted the opportunity. Thanks
5.00+
8+ Reviews
18+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
In this exercise, you modify the highest number program from the chapter. If necessary, create a new project named ModifyThis20 Project and save it in the Cpp8\Chap11 folder. Enter the C++...
-
In this exercise, you will modify the currency converter program from the chapter. If necessary, create a new project named ModifyThis19 Project and save it in the Cpp8\Chap11 folder. Enter the C++...
-
In this exercise, you modify the program from ModifyThis Exercise 19. If necessary, create a new project named Intermediate22 Project and save it in the Cpp8\Chap13 folder. Enter (or copy) the C++...
-
Shreya commutes in a CNG fitted van to school every day along with many other students. She told the van driver to get the CNG connection certified and timely checked it for any leakage or loose...
-
Check that the following could be p.d.f.'s and compute their expectations. Does anything seem odd about them? g(t)=_ for l
-
Given the field H = 20 2 a A/m: (a) Determine the current density J. (b) Integrate J over the circular surface 1, 0 < < 2, z = 0, to determine the total current passing through that surface in...
-
Which of the following statements about the single linkage method is false? a. In two dimensions, resulting clusters tend to be compact and circular. b. In two dimensions, the resulting clusters can...
-
Cars A and B move in the same direction in adjacent lanes. The position x of car A is given in Figure, from time t = 0 to t = 7 .0 s. The figure's vertical scaling is set by xs = 32.0 m. At t = 0,...
-
Ice Cool produces two different models of air conditioners. The activities, costs, and cost drivers associated with the production processes follow. Budgeted Activity Process Activity Assembly...
-
Glentech Manufacturing is considering the purchase of an automated parts handler for the assembly and test area of its Phoenix, Arizona, plant. The handler will cost $ 250,000 to purchase plus $...
-
In this exercise, you modify one of the ZIP code programs from the chapter. If necessary, create a new project named ModifyThis19 Project and save it in the Cpp8\Chap13 folder. Enter the C++...
-
Follow the instructions for starting C++ and viewing the Advanced29.cpp file, which is contained in either the Cpp8\Chap13\Advanced29 Project folder or the Cpp8\Chap13 folder. (Depending on your C++...
-
After the DNA from type S bacteria is exposed to type R bacteria, list all of the steps that you think must occur for the bacteria to start making a capsule.
-
What three practical concepts have you learned from listening to the Borrowed Future Episode 1 Podcast" what no one told you about student loan"?
-
Summarize this information below. Introduction: The Croc Your World Enterprise (CYW) company founded by the charismatic and socially responsible businessman, Mr. Victor Diego. CYW's mission is to...
-
Discuss TWO (2) factors used by underwriters in the selection and classification of risks in order to achieve equity among policyholders using your own word.
-
Briefly explain the legal framework that regulates public sector financial Operations in Kenya by giving a minimum of five examples.
-
A tank contains mercury up to a height of 0.3 m over which water stands to a depth of 1 m and oil of specific gravity 0.8 stands to a depth of 0.5 m over water. Determine the pressure the interfaces...
-
Brinpool plc has been invited to build a factory in the small state of Gehell by the government of that country. The local currency is the Ked (K) and data on current and expected exchange rates are...
-
Evenflow Power Co. is considering a new project that is a little riskier than the current operations of the company. Thus, management has decided to add an additional 1.5% to the company's overall...
-
The intCounters array contains five elements. Which of the following assigns the number 1 to each element? a. For intSub As Integer = 0 To 4 intCounters(intSub) = 1 Next intSub b. Dim intSub As...
-
The intNums array is declared as follows: Dim intNums() As Integer = {10, 5, 7, 2}. Which of the following blocks of code correctly calculates the average value stored in the array? The intTotal...
-
The strNames array contains 100 elements. Which of the following statements assigns the number 99 to the intLastSub variable? a. intLastSub = strNames.Length b. intLastSub = strNames.GetUpperBound(0)...
-
sked byChina699 BEMIDJI STATE UNIVERSITY Department of Technology, Art & Design TADT 3217 : Materials Science & Metallurgy Hardness Testing [A continued look at the Heat Treatment of Steel] ...
-
1. Advocate Aurora Sheboygan Memorial Hospital health care product or service to be marketed in your community. 2. Conduct appropriate market research in your community to determine the demographics...
-
How do ethical leaders integrate ethical considerations into strategic decision-making processes, balancing short-term business objectives with long-term ethical imperatives to ensure sustainable...
Study smarter with the SolutionInn App