Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C + + program to write the numbers from 1 0 to 8 0 into a data file NUMS . TXT . Please

Write a C++ program to write the numbers from 10 to 80 into a data fileNUMS.TXT. Please using for loop and an ofstream object.
2. Write a C++ program to count the number of letter d present in a text file named
"BLANK.TXT". Use while loop to count the number of letter d, use eof() to check
the end of the file, and use get() to read each character from the file. Finally
output your result.
Complete the following codes, write main() function.
int count =0;
while(!fin.eof())//fin is an ifstream object
{
fin.get(ch);
if(ch=='d')
count++;
}
Write a function to count number of words in a text file named "WORDS.TXT". Use while loop to read each word from the file and count the number of words. use eof() to check the end of the file. Use a string(char word[30];)to store each word that is read from the file. Finally output your result.
Complete the following codes, write main() function.
char word[30];

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions