146k views
3 votes
Write a program to convert a person’s height in inches into centimetres

and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg)
Please I need help.

1 Answer

5 votes

#include <iostream>

#include <conio.h>

const double stones_into_kilograms=6.364, inches_into_centimeters=2.54;

main ()

{

std::cout<<"Weight and height converter by TheMaster999"<<std::endl;

double height, weight;

std::cout<<"Type your height in inches: ";

std::cin>>height;

std::cout<<"Type your weight in stones: ";

std::cin>>weight;

std::cout<<"Your height is "<<height*inches_into_centimeters<<" cm and your weight is "<<weight*stones_into_kilograms<<" kg."<<std::endl;

getch();

return 0;

}

User Alen S Thomas
by
5.8k points