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

  Your main function will still prompt the user

Your main function will still prompt the user for the account number and service code. Based on the service code, main will ask for the correct number of minutes, then call your functions above as needed to finish the job. In addition you must.

  Insert the missing code in the c program

You are to insert the missing code in the C program given for combinational equivalence checking. This program will interface with the CUDD package and will parse netlist files in ISCAS85 circuit format. Next, BDDs will be created for each circuit an..

  Write in c++. read an inputfile.txt

write in C++.  read an inputFile.txt which contains integers that are virutal addresses, and I am suppossed to translate that into physical addresses using a page table and a transition lookaside buffer

  Function odd_fill() that fills all integers between two poin

write a function odd_fill() that fills all integers between two pointers, first and last, with a sequence of odd integers: 1,3,5,7

  Write a program that will read in 5 numbers

Write a program that will read in 5 numbers and add 10 to the first number, 20 to the second number, and 30 to the third number, 40 to the fourth and 50 to the 50th.

  Create the roman.h and implement roman class in roman.cpp

Create the roman.h and implement the Roman class in roman.cpp. Make sure that you put in measures to prevent multiple inclusion of the header file. Test your implementation using task2a.cpp.

  The program will read integers values

Write a C++ program to do the following. The program will read integers values one at a time from standard input (cin) until you read the value 150. assume that the number of values read in is at least 1 and less than or equal to 100

  Use a switch statement

Use a switch statement to write a program that prompts user to enter an character.

  Write c++ programs

Write a C++ program to accept distance in kilometers, coverts it to meters and then displays the result. Write a C++ program to find area and circumference of a circle.

  Write equivalent compound statements

What action must be taken before a variable can be used in a program?

  Write a c++ program which will calculate the monthly balance

Write a C++ program which will calculate the monthly balance of a debt. Each month a payment is made on the balance, and interest is added to the balance using a fixed percentage rate.

  Stores a series of numbers in a binary tree.

Queue Converter, Write a program that stores a series of numbers in a binary tree. Then have the program insert the values into a queue in ascending order. Dequeue the values and display them on the screen to confirm that they were stored in the prop..

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