Answer:
/*C++ program that prompts user to enter the name of input file(input.txt in this example) and print the sum of the values in the file to console. If file dosnot exist, then close the program */
//header files
#include <fstream>
#include<string>
#include <iostream>
#include <cstdlib> //needed for exit function
using namespace std;
//function prototype
int fileSum(string filename);
int main()
{
string filename;
cout << "Enter the name of the input file: ";
cin >> filename;
cout << "Sum: " << fileSum(filename) << endl;
system("pause");
return 0;
}
/*The function fileSum that takes the string filename and
count the sum of the values and returns the sum of the values*/
int fileSum(string filename)
{
//Create a ifstream object
ifstream fin;
//Open a file
fin.open(filename);
//Initialize sum to zero
int sum=0;
//Check if file exist
if(!fin)
{
cout<<"File does not exist ."<<endl;
system("pause");
exit(1);
}
else
{
int value;
//read file until end of file exist
while(fin>>value)
{
sum+=value;
}
}
return sum;
}//end of the fileSum
Explanation:
This is a C++ program that prompts user to enter the name of input file(input.txt in this example) and print the sum of the values in the file to console. If file dosnot exist, then close the program.
Check attachment for sample output screenshot.
Answer:
i think its new
Explanation:
if this is incorrect i apologize
Answer:
See explanation below.
Explanation:
File organization is very important especially when one is working with numerous files from different applications.
When you are working with spreadsheets, word processing documents, presentation slides, images and sound files, it is important to create folders and sub-folders to make locating your files a lot easier.
- Make sure you have all your files saved with names that are relevant to your school project.
- Create a sub-folder to store all spreadsheets files, create a sub-folder to store all word processing files, create a sub-folder to store all presentation slides and create another folder to store images and sound files. You do this to make it easy for you to locate whichever file you want.
- You create the sub-folder by right clicking on your documents section and clicking on new folder. Type in the name of the folder and save.
- After creating sub-folders, create a general folder for all your folders by using the same method in step 3. Copy all your sub-folders into this major folder. You can name this folder the name of your school project.
This way, you never have to look for any files for your school project.
<span>(news doctors, consultants) said people should be young, attractive, smile and look happy.</span>
Answer:
brainlest please
Answer:
Intranet
Explanation:
According to my research on information technology and hardware, I can say that based on the information provided within the question the term being described is called an Intranet. This (like mentioned in the question) is a local or restricted communications network,usually made as a private network within an organization and is created using Internet Protocol Technology.
I hope this answered your question. If you have any more questions feel free to ask away at Brainly.
Explanation: