All pastes #185026 Raw Edit

Stuff

public cpp v1 · immutable
#185026 ·published 2006-09-28 15:25 UTC
rendered paste body
#include "stdafx.h"#include <iostream>#include <math.h>int main(){	float totalounce = 0.0f;	float totalpound = 0.0f;	int poundone = 0;	int poundtwo = 0;	int ounceone = 0;	int ouncetwo = 0;	for( int i = 0; i < 10; i++ )	{		std::cout << "Please enter your first weight in pounds followed by ounces "; 		std::cin >> poundone;		std::cout << "lb's and ";		std::cin >> ounceone; 		std::cout << "Oz's";		std::cout << std::endl;		std::cout << std::endl;		std::cout << "Please enter your second weight in pounds followed by ounces "; 		std::cin >> poundtwo;		std::cout << "lb's and ";		std::cin >> ouncetwo; 		std::cout << "Oz's";		std::cout << std::endl;		std::cout << std::endl;		totalounce += ( ounceone + ouncetwo );		totalpound += ( poundone + poundtwo );		if( totalounce > 16.0f )		{			totalounce = fmod( totalounce, 16.0f );		}		totalpound = fabs( totalounce / 16.0f );		std::cout << "The total Amount of pounds indicated in the forementioned weights totals ";		std::cout << totalpound;		std::cout << std::endl;		std::cout << std::endl;		std::cout << "The total Amount of ounces indicated in the forementioned weights totals ";		std::cout << totalounce;		std::cout << std::endl;		std::cout << std::endl;		std::cout << "The overall weight indicated is " ;		std::cout << totalpound;		std::cout << "lb's, and ";		std::cout << totalounce;		std::cout << "Oz's";		std::cout << std::endl;		std::cout << std::endl;	}	return 0;};