Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ Beginner's question on input/output text files.?
    primarykey
    data
    text
    <p>If I have an input text with the only thing written of "A" and I want a series of code that will allow me to generate the next ASCII set (B), how would I do so?</p> <pre><code>#include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { return 0; } #include iostream&gt; #include fstream&gt; #include iomanip&gt; #include string&gt; using namespace std; int main() { ifstream inFile; ofstream outFile; string firstName; string lastName; string character; int age; double rectangle, length, width, area, parameter, circle, radius, areaCircle, circumference, beginningBalance, interestRate, endBalance; inFile.open("inData.txt"); outFile.open("outData.txt"); outFile &lt;&lt; fixed &lt;&lt; showpoint; outFile &lt;&lt; setprecision(2); cout &lt;&lt; "Data is processing..." &lt;&lt; endl; inFile &gt;&gt; length &gt;&gt; width; area = length * width; parameter = (length * 2) + (width *2); outFile &lt;&lt; "Rectangle:" &lt;&lt; endl; outFile &lt;&lt; "Length = " &lt;&lt; length &lt;&lt; " " &lt;&lt; "width = " &lt;&lt; width &lt;&lt; " " &lt;&lt; "area = " &lt;&lt; area &lt;&lt; " " &lt;&lt; "parameter = " &lt;&lt; parameter &lt;&lt; endl; inFile &gt;&gt; radius; outFile &lt;&lt; " " &lt;&lt; endl; outFile &lt;&lt; "Cricle:" &lt;&lt;endl; areaCircle = 3.14159 * (radius * radius); circumference = 2 * (3.14159 * radius); outFile &lt;&lt; "Radius = " &lt;&lt; radius &lt;&lt; " " &lt;&lt; "area = " &lt;&lt; areaCircle &lt;&lt; " " &lt;&lt; "circumference = " &lt;&lt; circumference; outFile &lt;&lt; endl; outFile &lt;&lt; endl; inFile &gt;&gt; firstName &gt;&gt; lastName &gt;&gt; age; outFile &lt;&lt; "Name: " &lt;&lt; firstName &lt;&lt; " " &lt;&lt; lastName &lt;&lt; "," &lt;&lt; " " &lt;&lt; "age: " &lt;&lt; age; outFile &lt;&lt; endl; inFile &gt;&gt; beginningBalance &gt;&gt; interestRate; outFile &lt;&lt; "Beginning balance = " &lt;&lt; beginningBalance &lt;&lt; "," &lt;&lt; " " &lt;&lt; "interest rate = " &lt;&lt; interestRate &lt;&lt; endl; endBalance = ((18500 * .0350) / 12.0 ) + 18500; outFile &lt;&lt; "Balance at the end of the month = $" &lt;&lt; endBalance; outFile &lt;&lt; endl; inFile &gt;&gt; character; outFile &lt;&lt; "The character that comes after" &lt;&lt; character &lt;&lt; "in the ASCII set is" &lt;&lt; character +1; inFile.close(); outFile.close(); return 0; } </code></pre>
    singulars
    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.
    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