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: 77% (9 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
-
Using the curves of Fig. 1.48a, what level of temperature coefficient would you expect for a 20-V diode? Repeat for a 5-V diode. Assume a linear scale between nominal voltage levels and a current...
-
a. Find the Laplace transform of the given function. Use Table 2.2 when applicable. b. Confirm the result of (a) in MATLAB. \(t \cosh t\) TABLE 2.2 Laplace Transform Pairs No. f(t) F(s) 1 Unit...
-
For the week ended January 15, 2009, the bullish sentiment of individual investors was 27.6% (AAII Journal, February 2009). The bullish sentiment was reported to be 48.7% one week earlier and 39.7%...
-
using Google slides - create colourfull and immersive, comparison chart (complete with examples) that examines the similarities as well as differences, between short-term, and long-term financing!
-
A particle moves in a circular orbit in a force field given by Show that, if k suddenly decreases to half its original value, the particles orbit becomes parabolic. %3D F(r) = -k/r?
-
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++...
-
A director of alumni affairs at a small college wants to determine whether there is a linear relationship between the number of years alumni have been out of school and their annual contributions (in...
-
A -20kg child slides down a playground slide with a constant acceleration of a=2.9 m/s^2 parallel to the surface of the slide. The child starts sliding with an initial speed of v0. Enter an...
-
The accounts clerk for Fincorp Ltd a public company that uses the accruals basis for returning its income provides the following analysis of the debtors for the year ended 30 June 2022: Debtors at...
-
Starting from a location with position vector rx = -13.5 m and ry = 28.5 m, a rabbit hops around for 13.1 seconds with average velocity Vav,x = -2.07 m/s and Uav.y = 1.09 m/s. Determine the...
-
There is a mysterious undiscovered planet called Endor that is orbiting Sirius A ( temperature 9 9 3 6 . 5 K ) at a distance of 3 6 3 . 2 million km . Find the Solar constant at Endor and use to find...
-
For the following systems, determine if they are i) linear or non linear, ii) causal or non causal, iii) stable or unstable, iv) time invariant or time variant. Justify your answer with a proof or a...
-
On January 1, 20X4, JetBlue purchased an airplane for $25,000,000. JetBlue expects the plane to remain useful for 5 years and to have a residual value of $5,000,000. JetBlue uses the straight-line...
-
What are the 5 Cs of marketing channel structure?
-
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)...
-
Garnet Company's most popular product has a unit variable cost of $40 and a unit sales price of $70.40. Fixed manufacturing costs are $192,000 when the company produces and sells 10,000 units. Garnet...
-
Delta Supplies Corp produces a small appliance device. Its fixed cost is $3,000 and variable cost is $2.00 per unit. If Delta manufactures 1,000 units, what is the total cost of this production?
-
Find the equation of the total cost function and the average cost of a firm, if the marginal cost is MC = MC = 1.5 Q2-4 Q+12, while the total fixed cost is 20 The marginal cost of a firm is given by:...
Study smarter with the SolutionInn App