100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Otro

COS1511 Assignment 3 2022 Solutions

Puntuación
-
Vendido
-
Páginas
13
Subido en
01-07-2022
Escrito en
2021/2022

*****Here you will find all the solutions for COS1511 Assignment 3. Semester 1&2.

Institución
Grado









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
1 de julio de 2022
Número de páginas
13
Escrito en
2021/2022
Tipo
Otro
Personaje
Desconocido

Temas

Vista previa del contenido

COS1511 ASSIGNMENT 03
UNIQUE NUMBER: 830235


Question 1.

#include <iostream>

#include <iomanip>

using namespace std;

void getData(float& weight, float& height);

float calcBMI(float weight, float height);

void displayFitnessResults(float bmi);

int main()

{

float height, weight, bmi;

getData(weight, height);

bmi = calcBMI(weight, height);

displayFitnessResults(bmi);

return 0;

}

void getData(float& weight, float& height)

{

cout << "Enter your weight and height respectively (followed by enter for each variable)" << endl;

cin >> weight;

cin >> height;

}

float calcBMI(float weight, float height)

{

return weight/(height*height);

}

void displayFitnessResults(float bmi)

{

if (bmi < 18.5)

cout << "Your BMI is " << bmi << " and your weight status is Underweight" << endl;

, else if (bmi >= 18.5 && bmi <= 24.9)

cout << "Your BMI is " << bmi << " and your weight status is Healthy" << endl;

else if (bmi >= 25.0 && bmi <= 29.9)

cout << "Your BMI is " << bmi << " and your weight status is Overweight" << endl;

else if (bmi >= 30)

cout << "Your BMI is " << bmi << " and your weight status is Obese" << endl;

}




Question 2.

#include <iostream>

#include <iomanip>

using namespace std;

void studentDetails(string& name, string& surname, string& schoolName);

void getMarks(float& mark1, float& mark2, float& mark3, float& mark4, float& mark5, float&
mark6);

float calcAverageYearMark(float mark1, float mark2, float mark3, float mark4, float mark5, float
mark6);

void minMax(float mark1, float mark2, float mark3, float mark4, float mark5, float mark6);

bool passOrFail(float mark1, float mark2, float mark3, float mark4, float mark5, float mark6);

void awardDistinction(float mark1, float mark2, float mark3, float mark4, float mark5, float mark6);

void codeSymbol(float mark1, float mark2, float mark3, float mark4, float mark5, float mark6);

void displayReport(string name, string surname, string schoolName, float mark1, float mark2, float
mark3, float mark4, float mark5, float mark6);

int main()

{

string name, surname, schoolName;

float mark1, mark2, mark3, mark4, mark5, mark6;

studentDetails(name, surname, schoolName);
$3.65
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
segodithabang

Conoce al vendedor

Seller avatar
segodithabang University Of South Africa
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
4 año
Número de seguidores
1
Documentos
5
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes