Program that prompts the user to enter the weight of person

Assignment Help C/C++ Programming
Reference no: EM13340049

1. Write a program that prompts the user to enter the weight of a person in kilograms and outputs the equivalent weight in pounds. Output both the weights rounded to two decimal places. (Note that 1 kilogram = 2.2 pounds.) Format your output with two decimal places.

2. During each summer, John and Jessica grow vegetables in their back yard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly.

//Logic errors.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double cost;
double area;
double bagSize;
cout << fixed << showpoint << setprecision(2);
cout << "Enter the amount of fertilizer, in pounds, "
<< "in one bag: ";
cin >> bagSize;
cout << endl;
cout << "Enter the cost of the " << bagSize
<< " pound fertilizer bag: ";
cin >> cost;
cout << endl;
cout << "Enter the area, in square feet, that can be "
<< "fertilized by one bag: ";
cin >> area;
cout << endl;
cout << "The cost of the fertilizer per pound is: tiny_mce_markerquot;
<< bagSize / cost << endl;
cout << "The cost of fertilizing per square foot is: tiny_mce_markerquot;
<< area / cost << endl;
return 0;
}

Reference no: EM13340049

Questions Cloud

Design an algorithm to find the selling price of item sold : To make a profit, the prices of the items sold in a furniture store are marked up by 60%. Design an algorithm to find the selling price of an item sold at the furniture store. What information do you need to find the selling price?
Cost to purchase inventory : Method of inventory cost do you believe is superior to the others in providing information to potential investors? Explain and the costs to purchase inventory had been falling instead of rising.
What inferences should be drawn from this analysis : If FCI raised rents at one complex by $100, what would you expect to happen to the number of units rented? If FCI raised rents at an average apartment building, what would happen to FCI’s total revenues?
Two significant trading countries in the apbr : Select two significant trading countries in the APBR.  Compare these countries from the point of view of their relative size, population, natural resources, social structure and politic and business practices.
Program that prompts the user to enter the weight of person : The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly.
What is lf to find the latent heat of fusion : If you want to find the latent heat of fusion, you take a cup with 0.755 kg of water at 30.00 C and drop 0.0850 kg of ice initially at 0.000 C and it all reaches an equilibrium temperature of 19.00 C,
What will the final temperature be after all the solid form : If an piece of Iron (c = 450 J/kg C) at 65.00 C is dropped into .250 kg of ethyl alcohol at 25.00 C and the final temperature of the two comes to 35.00 C what was the mass of the piece of iron
By what means can managers use to assess political risk : By what means can managers use to assess political risk?
How to simulate : Here, each line is a process. First int is ID, second integer is CPU time. CPUunitQ is a queue that stores the index # for available cpu units. How to simulate?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd