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
VikaD [51]
3 years ago
12

Write a function that reads from a file the name and the weight of each person in pounds and calculates the equivalent weight in

kilograms. Output the Name, weightLB, and weightKG in that order. Format your output to two decimal places. (1 kilogram
Computers and Technology
1 answer:
spayn [35]3 years ago
3 0

Answer:

#include <iostream>

#include <fstream>

#include <iomanip>

using namespace std;

int main(){

   string name;

   double weightKg, weightPd;

   cout<< fixed << setprecision(2);

   fstream myFile("filename.txt");

   while (getline( myFlie, name, weightPd)){

       weightKg = weight * 0.453592;

       cout<< name << weightPd <<weightKg;

   }

   myFile.close();

}

Explanation:

The C++ source code reads in the content of a file that has a name and weight value in pounds and outputs the name, weight in pounds and the weight in kilograms.

You might be interested in
A cyberbully is someone who invades another person’s privacy by
e-lub [12.9K]
Insulting or harassing them over the Internet
8 0
4 years ago
Read 2 more answers
For this lab you will write a java program that plays the game poker dice
romanna [79]
<span>All five dice show the same value thats what i think</span>
5 0
3 years ago
Define the term editing​
Harrizon [31]

Answer:

editing is a word file mean making changes in the text contain is a file. or a word file is one of the most basic ms office word operation.

8 0
3 years ago
Please please help I don’t understand this
garik1379 [7]

Answer:

It is this because yass

Explanation:

And yes

6 0
3 years ago
Read 2 more answers
Which of the following translates packets so that the node can understand them once they enter through a port?
FinnZ [79.3K]
A cluster compute server includes nodes coupled in a network ... Each VNIC typically is assigned its own MAC address by the VMM or VM, ... translation or mapping storage at the NIC of each node in the cluster ...... a wired or wireless network (e.g., network accessible storage (NAS)). .... Google Translate ...
5 0
4 years ago
Read 2 more answers
Other questions:
  • Ted is a fashion designer. Where is he most likely to work
    9·1 answer
  • When a file has been opened using the 'r' mode specifier, which method will return the file's contents as a string??
    12·1 answer
  • Commercial websites have domain names so that users can easily access the web pages by typing the domain names instead of the IP
    12·1 answer
  • If you have two tasks x and y, with y being a successor to x, if we mark x as undone (because it needs to be redone for some rea
    15·1 answer
  • Instructions:Select the correct answer.
    9·1 answer
  • Writing the E-mail:
    5·1 answer
  • A local bank has just one branch. It sets up a peer-to-peer network for all devices on the system. The bank would like to be abl
    12·1 answer
  • Who is known as the first computer programmer?​
    13·1 answer
  • How to mark a discussion as read on canvas dashboard.
    10·1 answer
  • Can anyone tell me about Microsoft some important features for partical
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!