Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help to complete this assignment as per c+++ under Classes and Data Abstr

ID: 3853046 • Letter: I

Question

I need help to complete this assignment as per c+++ under Classes and Data Abstraction      

You are going to convert feet and inches or pounds in this program.  You will give the user the choice of converting feet and inches to centimeters or pounds to kilograms.  With the correct answer you will also display the number entered.  Create a menu for the user.  Give them the opportunity to convert either as many times as they want, but they must convert at least once.  Add a class and place your private data members in it as well as the member functions for conversion.  Not the menu function.  Remember the class should be focused around one thing and that is the conversion.

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 Inches ";

cin >> htInches;

Convert( htInches);

cout << " ";

return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote