CyberCodes
convert weight to pounds Welcome

Reminders sa mga rehistradong myembro:

•ang lengwahe na gagamitin ay pawang english at tagalog lamang

•Bawal po dito ang pakikipag away

•Bawal ang mga shorcut na mga words
Example: txt, Pwd, at iba pa

•Bawal mababastos at masasakit na salita o anu mang makakasakit
ng damdamin ng isang myembro ng forum na ito

•use the "like" button if the post of the following user you think are usefull



Join the forum, it's quick and easy

CyberCodes
convert weight to pounds Welcome

Reminders sa mga rehistradong myembro:

•ang lengwahe na gagamitin ay pawang english at tagalog lamang

•Bawal po dito ang pakikipag away

•Bawal ang mga shorcut na mga words
Example: txt, Pwd, at iba pa

•Bawal mababastos at masasakit na salita o anu mang makakasakit
ng damdamin ng isang myembro ng forum na ito

•use the "like" button if the post of the following user you think are usefull

CyberCodes
Would you like to react to this message? Create an account in a few clicks or log in to continue.

convert weight to pounds

Go down

convert weight to pounds Empty convert weight to pounds

Post by sandbox.exe Sun Dec 02, 2012 6:34 pm

Create a program that will ask the user to enter the name of your father and mother and the weight of he/she mother and father then it well calculate the average weight and converted to pounds.

Code:
#include<iostream.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>

int main()
{
top:
system("cls");
        char fname[50],mname[50],ans;
        int fwt, mwt;
        double ave, lbs;

        cout<<"Enter your father's name: ";
        cin>>fname;
       
        cout<<"Enter your father's weight(kg): ";
        cin>>fwt;
       
        cout<<"\nEnter your mother's name: ";
        cin>>mname;
       
        cout<<"Enter your mother's weight(kg): ";
        cin>>mwt;

        ave = (fwt + mwt)*0.5;
        lbs = ave*2.2;

        cout<<"\nTotal weight average is: "<<lbs<< " lbs.\n\n";

        cout<<"\n\nEnter another data? [Y]Yes or [N] No: ";
        cin>>ans;
        cout<<endl<<endl<<endl;

        if (ans == 'n'|| ans == 'N'){ 
                return 0;}

        else if (ans == 'y' || ans == 'Y'){
                goto top;}

        else
        {
                cout<<"Invalid input"<<endl;
        }
}
sandbox.exe
sandbox.exe
Code Casters
Code Casters

Posts : 36
Credits : 134
Fame : 13
Join date : 2012-11-03
Age : 32

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum