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
-
Consider two thin, conducting, spherical shells as shown in Figure P25.66. The inner shell has a radius r1 = 15.0 cm and a charge of 10.0 nC. The outer shell has a radius r2 = 30.0 cm and a charge of...
-
7. ADMINISTRATIVE AGENCIES Congress creates federal administrative agencies with enabling legislation. The Administrative Procedure Act controls how agencies do their work. (p. 90)
-
Accounting for Goodwill On July 1, 2010, Brandon Corporation purchased Mills Company by paying $250,000 cash and issuing a $150,000 note payable. At July 1, 2010, the balance sheet of Mills Company...
-
The price of Ervin Corp. stock will either be $62 or $85 at the end of the year. Call options are available with one year until expiration. Continuously compounded T-bills currently yield 2.86 %....
-
1. The double-declining balance rate for calculating depreciation expense is determined by doubling the straight-line rate. Assuming that an asset has a useful life of 25 years, determine the rate to...
-
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++...
-
What is a family of funds? How is it related to shareholder exchanges?
-
Describe how postpartum confinement centers in Asia differ from postpartum care and experiences offered in the United States. 2. Would you market postpartum confinement experiences as a luxury...
-
Disruptive Innovation explains how firms may fail even if management are acting rationally. Critically discuss whether this is the case using the Netflix and Blockbuster case studies.
-
Describe one "real world" example that supports (or negates) one of the power models. Based on your viewing of the videos and attached sources, which model seems to have the most supportive evidence...
-
A useful quantity for our purposes is the reproductive distance rate F of a geothermal vent. This measures how much the extremophiles reproduce per metre from the centre of the geothermal vent and...
-
A purchasing and supply chain performance measurement and management system should directly support corporate goals and objectives. A measurement system that directs behavior and activity away from...
-
A plane flying at an altitude of 7 miles above a radar antenna passes directly over the radar antenna (see figure). Let d be the ground distance from the antenna to the point directly under the plane...
-
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)...
-
The status of _______________ organizations are held in trust, rather than owned; there are many hospitals that fit into this tax status. Group of answer choices for-profit not-for-profit All of...
-
hich of the following is not considered an equity-based compensation for executive management? a. Stock options b. Restricted stock units (RSUs) c. Restricted stock awards d. Deferred compensation...
-
The objective of effective financial reporting is to provide information in a(n) ____________ manner that will assist in making decisions regarding the allocation of resources for the organization....
Study smarter with the SolutionInn App