Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<string>
- using namespace std;
- class student{
- string first_name;
- string second_name;
- string group;
- vector <int> ball;
- public:
- bool average(){
- int size=ball.size();
- int sum=0;
- for(auto s:ball){
- sum+=s;
- }
- double aver=(sum/size);
- if(aver>3){
- return true;
- }
- return false;
- }
- void date(string name,string surname, string group_1){
- first_name=name;
- second_name=surname;
- group=group_1;
- }
- void ball_2(vector <int> size){
- ball=size;
- }
- void no_name(vector <int> ball_1){
- ball=ball_1;
- }
- void print(){
- cout<<first_name<<' '<<second_name<<' '<<group<<endl;
- }
- };
- int main(){
- student vasya;
- vasya.date("vasya","pupkin","rt");
- vector <int> nums_3={1,2,4,5};
- vasya.ball_2(nums_3);
- cout<<vasya.average()<<endl;
- vasya.print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement