Please someone help me complete the assignment below as per assignment instructi
ID: 3855090 • Letter: P
Question
Please someone help me complete the assignment below as per assignment instructions , Thank you
ASSIGNMENT 4 FILE
Assignment_4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
void Convert(int inch)
{
int feet, inches;
inches = inch % 12;
feet = inch/12;
cout << " The height in feet is" << feet << "" << inches << "" " << endl;
}
int main()
{
int htInches;
cout << " Enter height in iches";
cin >> htInches;
Convert(htInches);
cout << " ";
return 0;
}
Assignment instrustions
Now take your Assignment 4 above and modify it. You’re going to add another class for getting the users name. Inherit it. Be sure to have a print function in the base class that you can use and redefine in the derived class. You’re going to also split the project into three files. One (.h) file for the class definitions, both of them. The class implementation file which has the member function definitions. And the main project file where your main function resides. Don’t forget to display it when you display the answers.
formulas:
feet
=
cm div 30.48
inches
=
(cm mod 30.48) / 2.54
lbs
=
kg / 0.45359
cm
=
(feet * 30.48) + (inches * 2.54)
kg
=
lbs * 0.45359
Please note:
div ist the division without remainder whereas mod returns the remainder.
For instance:
7 divided by 3 equals 2 remainder 1 and therefore
7 div 3 = 2 and
7 mod 3 = 1
units:
1 foot
=
30.48 cm
1 inch
=
2.54 cm
1 lbs
=
0.45359 kg
1 cm
=
0.3937 inches
1 kg
=
2.2046 lbs
feet
=
cm div 30.48
inches
=
(cm mod 30.48) / 2.54
lbs
=
kg / 0.45359
cm
=
(feet * 30.48) + (inches * 2.54)
kg
=
lbs * 0.45359
Explanation / Answer
#include "stdafx.h"
#include <iostream>
using namespace std;
void Convert(int inch)
{
int feet, inches;
inches = inch % 12;
feet = inch/12;
cout << " The height in feet is" << feet << "" << inches << "" " << endl;
}
int main()
{
int htInches;
cout << " Enter height in iches";
cin >> htInches;
Convert(htInches);
cout << " ";
return 0;
}