Note that there are some explanatory texts on larger screens.

plurals
  1. POHow would i manipulate an imported .text file to show only the last four numbers os an employee's SNN on the screen?
    primarykey
    data
    text
    <p>This program retrieves a file from a loction on the computer and prints it to the screen only showing the last four digits of the employee's SSN.</p> <pre><code>#include &lt;iostream&gt; #include &lt;fstream&gt; #include &lt;cstdlib&gt; // needed for exit() #include &lt;string&gt; using namespace std; int main() { double Thanks_for_your_time; string filename = "C:\\Emp\\employee_info.txt"; string line; ifstream inFile; inFile.open("C:\\Emp\\employee_info.txt"); // open the file with the // external name if (inFile.fail()) // check for a successful open { cout &lt;&lt; "\nThe file was not successfully opened" &lt;&lt; "\n Please check that the file currently exists." &lt;&lt; endl; exit(1); } cout &lt;&lt; "\nThe file has been successfully opened for reading\n" &lt;&lt; endl; while (getline(inFile,line)) cout &lt;&lt; line &lt;&lt; endl; // statements to read data from the file would be placed here do { cout &lt;&lt; "\nThanks for your time(0 to quit):"; cin &gt;&gt; Thanks_for_your_time; } /* </code></pre> <p>The file has been successfully opened for reading</p> <p>Employee Name: Harry Heck Employee SSN: 987-98-7987 (Everything but the last four need to be "x"'s or blank) Employee Hourly Pay: $20.15 Hours Worked This Week: 40.25 Gross Pay: $811.04</p> <p>Employee Name: Sally Smothers Employee SSN: 654-65-4654 (Everything but the last four need to be "x"'s or blank) Employee Hourly Pay: $50.25 Hours Worked This Week: 40.35 Gross Pay: $2027.59</p> <p>Thanks for your time(0 to quit): */</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload