بسم الله الرحمن الرحيم
السلام عليكم ورحمة الله تعالى وبركاته ...
أقدم لكم هذا البرنامج التعليمي المتواضع والذي يندرج تحت ما يسمى بتعلم نطق الكلمات بالإنجليزية ، والتي نجد صعوبة فيها نحن المغاربة .
لذا جاءتني هذه الفكرة - برمجة برنامج تعليمي ب CPP - أنتفع به أولا ثم ينتفع به من لديه العزيمة والإرادة لتعلم اللغة الإنجليزية ...
فكرة البرنامج :
يقوم البرنامج بإنشاء ملف جديد من نوع VBS وبعد ذلك يقوم بتشغيله لكي تستمع إلى كيفية نطق الكلمة ...
صورة البرنامج :

السورس كود :
#include <cstdlib>
#include <iostream>
#include <string>
#include <windows.h>
#include <fstream>
using namespace std;
main()
{
HWND handle; // Declare the window handle
char Text[100];
begin :
system("title Listen to words In English "); // change console title
system("color c"); // changing text color
cout <<"\n\n";
cout << "\t\t # ##### ##### ##### ##### ####### \n";
cout << "\t\t # # # # # # #\n";
cout << "\t\t # # #### # ##### # # \n";
cout << "\t\t # # # # # # # \n ";
cout << "\t\t ##### ##### #### # ##### # # \n";
cout << "\t\t to words in English \n";
cout<<"\n\n Enter Your Text Here : \n\n\t";
cin.getline(Text,1000);
ofstream file("Speaker.vbs",ios::out); // create a VBS FILE & open it
file << "CreateObject(\"SAPI.SpVoice\").Speak"<<"\""<<Text<<"\""<<endl; // writing in the file
// this VBS code , it is writing for creating a new Object (SAPI.SpVoice)
file.close(); // closing the file
ShellExecute(handle,"open","Speaker.vbs",NULL,NULL,SW_SHOW); // execute the VBS file
Sleep(2000);
cout<<"\n\n\t\t Try Again ...";
getchar();
DeleteFileA("Speaker.vbs"); // delete the VBS FILE
system("cls");// clear screen
goto begin; // go up
}والآن مع تحميل البرنامج :
أتمنى أن يعجبكم البرنامج ، وعذرا على الشرح المبهم ...
إلى اللقاء ...
