Question
[c++] Use of the C++ Standard Template Library is prohibited in the implementation of this. using command line arguments. The first program parameter is the
[c++] Use of the C++ Standard Template Library is prohibited in the implementation of this.
using command line arguments. The first program parameter is the input file name. The second parameter is the output file name.
input file named i03.dat contains values of for code fragments 3. The program reads the input file and produces an output on an output file. The input file consists of a sequence of integers. Integers are separated by white space. White space is one or more characters from the set that includes a blank character, a newline character, or a tab character.
example of the input file: 0 1 2 3 4 5 6 7 8 9 10
example when running program:
Enter the first input file name: i03.dat
Enter the output file name: o03.dat
the program will Print your results in the output file.
1. Print a line identifying the code fragment. For example, this code fragment is identified as Code Fragment 3
2. Put your output in three columns. Label the first column n, the second column Analytical and the third column Empirical. Produce values of () for each code fragment. One line is printed for each value of read. Write the value of in the column labeled n. Write the value of () computed by the designated analytical function, af3, in the column labeled Analytical. Write the value of () computed by the selected empirical function, ef3, in the column titled Empirical. Right justify and align data produced in rows with their corresponding columns.
example output using the example fragment 0:
af3 function
int af3(int n){
return 3 * n + pow(2, n) + 4; // remember to put #include
}
ef3 function
int ef3(int n)
{
int t = 0;
int sum = 1; t++;
int i=0; t++;
while(i sum = sum * 2; t++; i++; t++; } t++; while(sum > 0){ t++; sum--; t++; } return t; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started