Answer:
/*
* Program to write data to text file.
*/
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{
//Variable to name and age of a person.
string name;
int age;
cout<<"Enter your name"<<endl;
cin>>name;
cout<<"Enter your age"<<endl;
cin>>age;
//Creating object of ofstream.
ofstream file;
file.open ("outdata.txt");
//Writing data to file named outdata.txt
file<<name<<" "<<age;
file.close();
}
Output:
Enter your name
John
Enter your age
25
Content of Output.txt:
John 25
Explanation:
To write data to a file ofstream object is used. An ofstream object file is created first and then using this object a file named "outdata.txt" is created.
Finally using shift operator (<<), by means of operator overloading, name and age of person is transferred to file outdata.txt.
Answer:
please provide more details.
Answer:
a. 100%
b. 50%
c. 66.6%
Explanation:
a.
The memory references D6, 58, D8, 9A, DE and 5C all results in misses and the miss ratio is 100 (that is , 6 misses/ 6 references*100 = 100%)
b.
If fully associative cache is used, there will be a 3 cache misses with miss ratio of (3/6*100) = 50%.
c.
With a 2-way set-associative cache, 4 memory reference misses will occur, with a miss ratio of (4/6*100)= 66.6% misses.
Answer:
d
Explanation:
a report with records sorted in ascending order is the right answer