In: Computer Science
Design an application that focuses on decreasing the acceptability of and engagement in high-risk drinking among college students. The application should include:
1) files
2) arrays
3) methods
coding language c++
1.
#include <bits/stdc++.h>
using
namespace
std;
int
main()
{
fstream file;
file.open(
"Gfg.txt"
,ios::out);
if
(!file)
{
cout<<
"Error
in creating file!!!"
;
return
0;
}
cout<<
"File
created successfully,";
file.close();
return
0;
}
|
3.class MyClass {
public:
void myMethod() {
cout << "Hello World!";
}
};
int main() {
MyClass myObj;
myObj.myMethod();
return 0;
}