SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 19 Nov 2017 My Price 10.00

contractor to design program for his company.

Overview

You have just been hired by a local building contractor to design program for his company. He has been hiring a number of people to finish a job he is working on. After numerous bad cuts on woods, he realizes that some of his employees have a problem in converting feet to inches and inches to feet. He needs you to design a program that will allow his employees to do these conversions easily.

Instructions

Knowing that one foot equals 12 inches, you are to write two functions, one named feet_to_inches and the other named inches_to_feet that accept a number of feet or a number of inches as an argument and returns the appropriate number in inches or feet. For example, if the user enters 10 feet, the feet_to_inches function should return 120 inches. Or, if the user enters 60 inches, the inches_to_feet function should return 5 feet.

Use the functions in a program that prompts the user to enter the number of feet or the number of inches and then displays the number of inches in that many feet or the number of feet in that many inches.

Additional Requirements

  • Your program must have a header stating your client's company Harry's Contracting and a subtitle better describing the program.
  • Your program must have a brief statement about what the program does and directions for the user.
  • Your program must have a main function that calls other function(s)
  • Your output should not have more than two decimal places.
  • Your program must ask the user if there are additional measurements they would like to enter so that the program will automatically run again.

 

//Flor Torres
//This program is designed to help the user convert feet to inches
//and inches to feet.

#include <iostream>
#include <string>
#include <iomanip>

using namespace std;

//Function prototypes
void getInchesToFeet(double, double );
void getFeetToInches(double, double);

int main()
{
    //Introduction
    cout << "Harry's Contracting" << endl;
    cout << "-----------------------------------------" << endl;
    cout << "Feet to Inches / Inches to Feet Converter" << endl;
    cout << "-----------------------------------------" << endl << endl;

    int choice;

    //Display the menu
    cout << "Converter Options\n";
    cout << "----------------\n";
    cout << "1. Convert INCHES to feet\n";
    cout << "2. Convert FEET to inches\n";
    cout << "3. Quit\n";
    cout << "Enter your choice: ";
    cin >> choice;

    //Validate user input
    while (choice < 1 || choice > 3)
    {
        cout << "Invalid selection. Enter 1, 2, or 3: ";
        cin >> choice;
    }

    if (choice = 1)
    {
        getInchesToFeet(double inches, double totalFeet);
    }
    else if (choice = 2)
    {
        getFeetToInches(double feet, double totalInches);

    }
    else
    {
        return 0;
    }

    system("pause");
    return 0;

}

//Inches to feet conversion
void getInchesToFeet(double inches, double totalFeet)
{
    double inches;
    double totalFeet = inches / 12;

    cout << "Enter the number of inches you to convert to feet: ";
    cin >> inches;
    cout << "The total feet that you will need is: " << totalFeet << endl;
    cout << fixed << showpoint << setprecision(2);
}

//Feet to inches conversion
void getFeetToInches(double feet, double totalInches)
{
    double feet;
    double totalInches = feet * 12;

    cout << "Enter the number of FEET you want to convert to inches: ";
    cin >> feet;
    cout << "The total inches that you will need is: " << totalInches << endl;
    cout << fixed << showpoint << setprecision(2);
}





I'm having a hard time getting my functions to work. I think I'm not declaring them correctly.

Answers

(5)
Status NEW Posted 19 Nov 2017 08:11 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)