I need you to write this program for me

A dancing group with 10 dancers wish to increase the numbers of dancers they have by recruiting. The new dancers need to be grouped into weight category basge on the following:
*underweight if weight is < height/2.5,
*normal if height/2.5 <=weight<=height/2.3
*overweight if height/2.3 < weight
Where height is measured in centimeter and weight is measured in kilogram.
Use the criteria to implement a program solution. The program should have:
1. A function to colect the weight and height of any one dancer.
2. A function to compute the weight category of any one dancer.
3. A function to display the names of all the dancers whose name have been collected
NOTE: the list of the new dancers should be noted in ascending/descending order.
What have you written so far? We can help you with problems you run into along the way, but we're not going to write the whole thing for you :)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <string>

struct Dancer // contain dancer information
{
int Height;
int Width;
std::string Name;
int WeightClass;
};

void SetDancer(std::string n, int h, int w); // set a dancer struct
void SetClass(Dancer* d); // set dancer weight class based on funtion
void GetDancer(int dancer); // displayer a dancer object;

int main()
{
        return 0;
}


Base code. Use what you have learned and fill it in.
#include <iostream>
#include <stdlib.h>
#include <string>
#include <stdio.h>
using namespace std;
string compute()
{
double weight, height;
if (weight<(static_cast<double>(height)/(static_cast<double>(2.5)))){
return ("underweight");
}
else
if (((static_cast<double>(height))/(static_cast<double>(2.5)<=weight))){
return ("Normal");
}
else
if (((static_cast<double>(height)/(static_cast<double>(2.3))))<weight)
return ("overweight");
return 0;
}
int collectdata(double weight[], double height[], int n)
{
double weight1, height1; int n1, i, name;
for (i=0; i<=n1; i++)
cout<<"Enter weight of"<<name;
cin>>weight[i];
cout<<"Enter height of"<<name;
cin>>height[i];
cout<<name<<"is"<<compute;
cout<<endl;
return 0;
}
string information(string name[], int n)
{
string name1; int i;
for (i=0; i<=n; i++)
cout<<"Enter name of Dancer";
cin>>name[i];
cout<<collectdata;
return 0;
}
//main program
int main()
{
int n;
cout<<"How many Dancers are here?";
cin>>n;
cout<<information;
cout<<endl<<endl;
return 0;
}
thatz what i wrote but is not wroking properly
please help edit
Use functname() to call a function,
Last edited on
Topic archived. No new replies allowed.