CS10L - Laboratory Exercise #1 - 2nd Term - 20122013

Pasado o Dehado? 
CODE:

/**
    Laboratory Exercise #1
    CS10-B5

    @author Red Berroy
*/

#include <iostream.h>

int main()
{
    int object, w100, w50, w10, w5, w1;
    //Variable names

    cout<<"Enter an object:";
    cin>>object;
    //Enter object
    
    w100=object/100;
    w50=(object-(w100*100))/50;
    w10=(object-(w100*100)-(w50*50))/10;
    w5=(object-(w100*100)-(w50*50)-(w10*10))/5;
    w1=(object-(w100*100)-(w50*50)-(w10*10)-(w5*5))/1;
    //Formulas

    cout<<"100 lb = "<<w100<<endl;
    cout<<"50 lb = "<<w50<<endl;
    cout<<"10 lb = "<<w10<<endl;
    cout<<"5 lb = "<<w5<<endl;
    cout<<"1 lb = "<<w1<<endl;
    //Display results

return 0;
}



--

Mapúa Institute of Technology - Old Testaments

http://mit-ot.blogspot.com

0 comments:

Post a Comment

ADVERTISEMENT