The BMI is calculated as: BMI = weight in kg / height in meter X height in meter. %3D Table 4 shows the BMI measurement and the BMI categories. Table 4 BMI(kg/m) Category 0- 18.5 Underweight >18.5 and...


can you check my code the wrong part based on the question below


#include
using namespace std;

struct Student


{
    string name;
    double weight;
    double height;

};




int main ()


{
    Student studentList [100];
    //declare
    ofstream myfile;

    myfile.open ("studentData.txt");
    ifstream infile;
    infile.open("studentData.txt");

    //write into text file
    myfile<"test>

    //close file
    my file.close ();

    return 0;

}



The BMI is calculated as: BMI = weight in kg / height in meter X height in meter.<br>%3D<br>Table 4 shows the BMI measurement and the BMI categories.<br>Table 4<br>BMI(kg/m)<br>Category<br>0- 18.5<br>Underweight<br>>18.5 and <=23<br>Normal<br>>23 and <=25<br>Overweight- At Risk<br>>25 and <=30<br>Overweight- Moderately Obese<br>More than 30<br>Overweight- Severely Obese<br>The student data should be stored in a struct variable of type Student which has 3<br>components: name of type string, weight of type double and height of type double.<br>a) Write the definition of struct Student.<br>b) Write a complete C++ statements to do the following tasks:<br>i) Declare an array of type student of size 100.<br>ii) Write statements to read and write to file 1/O.<br>iii) Read all data from file student Data.txt.<br>

Extracted text: The BMI is calculated as: BMI = weight in kg / height in meter X height in meter. %3D Table 4 shows the BMI measurement and the BMI categories. Table 4 BMI(kg/m) Category 0- 18.5 Underweight >18.5 and <=23 normal="">23 and <=25 overweight-="" at="" risk="">25 and <=30 overweight-="" moderately="" obese="" more="" than="" 30="" overweight-="" severely="" obese="" the="" student="" data="" should="" be="" stored="" in="" a="" struct="" variable="" of="" type="" student="" which="" has="" 3="" components:="" name="" of="" type="" string,="" weight="" of="" type="" double="" and="" height="" of="" type="" double.="" a)="" write="" the="" definition="" of="" struct="" student.="" b)="" write="" a="" complete="" c++="" statements="" to="" do="" the="" following="" tasks:="" i)="" declare="" an="" array="" of="" type="" student="" of="" size="" 100.="" ii)="" write="" statements="" to="" read="" and="" write="" to="" file="" 1/o.="" iii)="" read="" all="" data="" from="" file="" student="">

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here