100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS1511 Assignment 03 Semester 1 & 2 2022 R100,00
Add to cart

Exam (elaborations)

COS1511 Assignment 03 Semester 1 & 2 2022

1 review
 25 views  0 purchase

COS1511 Assignment 3 Semester 1&2 2022. 100% TRUSTED solutions with comments, +94 for assistance with other assignments.

Preview 1 out of 9  pages

  • March 3, 2022
  • 9
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (37)

1  review

review-writer-avatar

By: mmegue • 2 year ago

Awesome content

avatar-seller
MyAssignments
COS1511 - Assignment 03 – 2022
Due date
Monday, 13 June 2022

QUESTION 1
#include<iostream>
using namespace std;

void getData (double &getWeight, double &getHeight)
{
cout << "Enter your weight (in kilograms): ";
cin >> getWeight;
cout << "\nEnter your height (in Metres): ";
cin >> getHeight;
}

double calcBMI(double cWeight, double cHeight)
{
double bmi=0.0;
bmi = cWeight / (cHeight * cHeight);
return bmi;
}

void displayFitnessResults(double dBMI)
{
if(dBMI < 18.5)
cout << "Your BMI is "<< dBMI <<" You are underweight!! Eat More!!
\n\n";
else if(dBMI >= 18.5 && dBMI <= 25)
cout << "Your BMI is "<< dBMI <<" You are in optimal shape!! Good
Work! \n\n";
else if(dBMI >= 25 && dBMI <= 30)
cout <<"Youe BMI is "<< dBMI << " You are overweight!! Eat Less!!
\n\n";
else if(dBMI >30) cout <<"Youe BMI is "<< dBMI << " You are Obese!! Seek
medical assistance for dietary purposes!! \n\n";
}

//MAIN _FUNCTION

int main()
{
double weight, height, BMI;
cout << "BMI: Body Mass Index \n";
getData(weight, height);
BMI= calcBMI(weight, height);
displayFitnessResults(BMI);
return 0;
}



My Assignments 27682021794 www.myassignments.co.za

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller MyAssignments. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R100,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

50843 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R100,00
  • (1)
Add to cart
Added