Friday, June 2, 2017

Yard To Feet Converter in C++

Here is a simple program that I wrote in C++ to ask the user to give a value in integer in yard and convert it to feet equivalent. I wrote this code using Dev C++ and CodeBlocks. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Program Listing

#include <iostream>
#include <iomanip>

using namespace std;

main() {
    int yards[5][1];

    cout << "\t\t    Yard To Feet Converter";
    cout << "\n";
    cout << "\t Created By: Mr. Jake R. Pomperada,MAED-IT";
    cout << "\n\n";

       for (int row=0; row < 5; row++) {
           for (int col=0; col <1; col++) {
               cout << "Enter a Value in Yard :=> ";
               cin >> yards[row][col];
           }
       }

       cout << "\n=============================";
       cout << "\n      GENERATED REPORT     ";
       cout << "\n=============================";
       cout << "\n";
       for (int row=0; row < 5; row++) {
           for (int col=0; col <1; col++) {
                 cout << "\n" <<setw(5) <<  yards[row][col] <<
                 " yard(s)" << setw(5)  << " ==> "
                 << (yards[row][col] * 3)
                 << " feet(s)";
                  }

       }
       cout << "\n\n";
       system("PAUSE");
}

No comments:

Post a Comment