Your functions needed variable names as well as types.
Tip: Paste the requirements as comments in the code.
Tip: Make sure simple input and output work before trying to write data manipulation code.
Eg.
Code:
#include<iostream>
#include<iomanip>
using namespace std;
struct zoo{
int number;
char name [30];
double kg;
};
// Function animal_create by which the keyboard is entered: number, name, weight(0.5 t)
void animal_create (zoo &creature){
cout<<"Number: ";
cin>>creature.number;
cout<<"Name: ";
cin>>creature.name;
cout<<"Weight: ";
cin>>creature.kg;
}
// Function output_animal to derive animal data
void output_animal(zoo &creature){
cout<<"Number "<<setw(10)<<"Name "<<setw(10)<<"Weight "<<"\n";
cout<<creature.number<<" "<<creature.name<<" "<<creature.kg<<"\n";
}
// Function double_weight that doubles the weight of all animals
int main(){
// Declare an array with three elements of the described zoo structure
zoo myZoo[3];
for(int j=0; j<3; j++)
animal_create(myZoo[j]);
for(int j=0; j<3; j++)
output_animal(myZoo[j]);
return 0;
}