You've been hired by Planet Pals to write a C++ console application that reads and converts planet data. Create text file PlanetsIn.txt and paste this data into it: Planet Diameter (miles) Length of Day (hours) Mercury 3032 4222.6 Venus 7521 2802.0 Earth 7926 24.0 Moon 2159 708.7 Mars 4221 24.7 Jupiter 88846 9.9 Saturn 74897 10.7 Uranus 31763 17.2 Neptune 30775 16.1 Pluto 1485 153.3 Place the file in a folder where your development tool can locate it. Read the file by scanning past the header row. Print a file-reading message, and the column headers. Each detail row in the file contains three tokens (planet, diameter, length of day) so you may do one token per read. For each detail row: Read each token from the file. Convert the diameter from miles to feet. Convert the length of day from hours to minutes. Print both the input and corresponding output tokens. Format all real numbers to one decimal place. Continue reading until the end-of-file. Print the number of lines read.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You've been hired by Planet Pals to write a C++ console application that reads and converts planet data.  Create text file PlanetsIn.txt and paste this data into it:

Planet      Diameter (miles)  Length of Day (hours)

Mercury          3032             4222.6

Venus            7521             2802.0

Earth            7926               24.0

Moon             2159              708.7

Mars             4221               24.7

Jupiter         88846                9.9

Saturn          74897               10.7

Uranus          31763               17.2

Neptune         30775               16.1

Pluto            1485              153.3

 

Place the file in a folder where your development tool can locate it.  Read the file by scanning past the header row.  Print a file-reading message, and the column headers.  Each detail row in the file contains three tokens (planet, diameter, length of day) so you may do one token per read. For each detail row:

  • Read each token from the file.
  • Convert the diameter from miles to feet.
  • Convert the length of day from hours to minutes.
  • Print both the input and corresponding output tokens.

Format all real numbers to one decimal place.  Continue reading until the end-of-file.  Print the number of lines read. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education