Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need this centimeter conversion program to round up to the nearest inch. #include 2 using namespace std; 4 51 const double CENTIMETERS PER INCH

I need this centimeter conversion program to round up to the nearest inch.

image text in transcribed

#include 2 using namespace std; 4 51 const double CENTIMETERS PER INCH = 2.54; 6 const int INCHES PER FOOT 12, INCHES PER YARD 36 7 Eint main () 9 10 double centimeters; int inches, feet, yards, totalInches; 12 13 14 15 16 17 18 19 20 21 cout > centimeters; total1nches = centimeters / CENTIMETERS PER.INCH; //converts centimeters to inches yards = total1nches / INCHES PER YARD; //converts total Inches to yards feet = (totalInches- (INCHES. PER-YARD * yards)) / 12; //converts inches to feet inches = (tota!Inches % (INCHES PER YARD * yards)) - INCHES PER FOOT ; //calculates inches 23 24 25 26 27 28 29 30 31 32 cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago