1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Keith_Richards [23]
3 years ago
14

Write a program that will read in aweight in kilograms and grams and will output the equivalent weightin pounds and ounces. Use

at least three functions: one for input,one or more for calculating, and one for output. Include a loopthat lets the user repeat this computation for new input valuesuntil the user says he or she wants to end the program. There are2.2046 pounds in a kilogram, 1,000 grams in a kilogram, and 16ounces in a pound.
Computers and Technology
1 answer:
ozzi3 years ago
6 0

<u>C++ program for converting kilograms and grams to pounds and ounces</u>

#include <iostream>

using namespace std;

void computation(double kilog, double gram, double& pon, double& oun) /*defining function for computing*/

{

pon = kilog*2.2046;/*Formula for converting*/

oun= gram*0.03527;

}

void output(double pon,double oun)/*For printing output*/

{

   cout << "Pounds are: " << pon << endl;

   cout << "Ounce are: " << oun << endl;

}

void input(double &kilog,double&gram)/*for taking output*/

{

   cout << "Enter kilograms to convert: ";

   cin >> kilog;

  cout << "Enter grams to convert: ";

   cin >> gram;

}

int main() //driver function

{

double kilog = 0.0,gram = 0.0,oun=0.0,pon=0.0;//Initializing

int choice = 0;

while (1) {  

cout << "Enter- 1 for converting kilogram and grams to pounds and ounces" << endl;

cout << "Enter-2 for exiting" << endl;

cout << "Please Enter choice: ";/*Asking choice from user*/

cin >> choice;

if (choice == 1) {

input(kilog,gram);/*Calling function for taking input*/

computation(kilog, gram, pon, oun); /*calling function for computing*/

output(pon,oun);/*calling function for output*/

}

else {

return 0;

}

}

}

<u>Output</u>

Enter- 1 for converting kilogram and grams to pounds and ounces

Enter-2 for exiting

Please Enter choice:1

Enter kilograms to convert:20

Enter grams to convert:10

Pounds are: 44.092

Ounce are: 0.3527

Enter- 1 for converting kilogram and grams to pounds and ounces

Enter-2 for exiting

Please Enter choice: 2

You might be interested in
Leah deals with several file conversions every day.
Lelechka [254]
That’s not a question but good for her
5 0
3 years ago
Draw a flow chart that accepts mass and volume as input from the user. The flow chart should compute and display the density of
TiliK225 [7]

Answer:

See attachment for flowchart

Explanation:

The flowchart is represented by the following algorithm:

1. Start

2. Input Mass

3. Input Volume

4 Density = Mass/Volume

5. Print Density

6. Stop

The flowchart is explained by the algorithm above.

It starts by accepting input for Mass

Then it accepts input for Volume

Step 4 of the flowchart/algorithm calculated the Density using the following formula: Density = Mass/Volume

Step 5 prints the calculated Density

The flowchart stops execution afterwards

Note that the flowchart assumes that the user input is of number type (integer, float, double, etc.)

6 0
3 years ago
The publisher tab in the application control allows you to manage the various certificates that are used to do what to binaries?
artcher [175]

The publisher tab in the application control allows you to manage the various certificates that are used to sign to binaries. Publisher allow executables of a particular vendor, signed by a security certificate issued to the vendor by a Certificate Authority. Also, all applications and binary files either added to or modified on an endpoint that are signed by the certificate are automatically added to the whitelist.

3 0
3 years ago
Martha is developing a software program in C++ and has a question about how to implement a particular feature. She performs an o
VLD [36.1K]

Answer:

A blog

Explanation:

A blog is a regularly updated website or web page, typically one run by an individual or small group, that is organised by posts.

7 0
3 years ago
Most GUIs provide all of the following except _____.
erma4kov [3.2K]

Hello there! Your answer would be A.

GUIs are Graphical user interfaces. Command prompts are unique to Windows operators, so your best option would be A since the question covers most GUIs.

Hope this helps, have a great day!

7 0
3 years ago
Other questions:
  • When pasting an object which has been copied from a different slide, where on the slide does the object paste, assuming nothing
    15·1 answer
  • Which of the following refers to a feature of wikis that allows the restoring of earlier work in the event of a posting error, i
    9·1 answer
  • Saving a file as a new filename can be accomplished through the Save As dialog box.
    13·1 answer
  • What is the role of the W3C? Group of answer choices oversee research and set standards for many areas of the Internet supervise
    10·1 answer
  • How do you do 3.4.5 Add parentheses for code hs? I need answers please
    15·2 answers
  • What are the peripherals of a computer ​
    12·1 answer
  • When you type in text in an image in a photo-editing software, where is it created?
    8·1 answer
  • In object-oriented analysis, an object is a member of a(n) _____, which is a collection of similar objects.
    11·1 answer
  • Which image file format is an uncompressed raster file which may contain different depths of color depths per pixel, or may be s
    5·1 answer
  • You have been asked to investigate a web server for possible intrusion. You identify a script with the following code. What lang
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!