السؤال شوي وجع لي راسي ولازم احله لأني احسه شوي في شغلات كثيرة
Write a program that counts the frequency of each letter in the alphabet (lower and upper case) in a text file named “IT.TXT”.
Define a structure that stores a letter and its frequency.
Your program should use an array of structures corresponding to the letters found in the file.
The program should then print a report showing each letter and its frequency.
وهذا الكود
# include <iostream>
# include <fstream>
# include<cctype>
using namespace std;
struct alphabet{
int frequency;
char letter;
};
void main()
{
ifstream fin;
fin.open("IT.txt");
alphabet letter[26];
for(int i=0;i<26;i++)
{
if(letter >= 'a' && letter <= 'z')
tolower++;
if(letter >= 'A' && letter <= 'Z')
toupper++;
}
}الي مو فاهمته كيف انه راح يحسب الأحرف