Toronto 47 Lima 66 Istanbul 57 Lagos 81 Shanghai 61 Sydney 64 In this assignment, you are presented with a text document that includes six cities and their average yearly temperature in Fahrenheit. Your goal is to read that data, convert it to Celsius using the provided formula, and then write that new data to its own file. To begin your work, open Visual Studio and create a new C++ project. Save the provided FahrenheitTemperature.txt document in a location where you will easily be able to access it while you work in Visual Studio. For this assignment, you will be submitting only your C++ (.cpp) file. You do not need to submit the final converted data; the C++ code you create just needs to be able to generate that file. Specifically, you must address the following rubric criteria: • Develop code to read data from a text file. Your work should be completed using C++. Read the provided document, FahrenheitTemperature.txt, which includes data on the average yearly temperature for six different cities in degrees Fahrenheit. Note that a space separates each city from its temperature. Assume the city's name does not include any spaces or special characters (the name should consist of only a single word). Also assume the provided temperature is presented as an integer. Consider the following steps as you work: • Open the provided file so it is ready to be read. Remember the file is named FahrenheitTemperature.txt. Watch out for the class you use, and make sure it is for reading a file and not writing to a file. • Read data from the provided file. Remember, to read this file you will need to declare a variable. Begin by reading the first value and putting it in the first variable. Then read the next value and put it in the second variable. • Once this is complete, be sure to close the file. This releases the file so it can be used again. • Develop code to write data to a text file. Your work should be completed using C++. Title the new document you are creating CelsiusTemperature.txt. The name of the output file needs to be different from the name of the input file so you do not overwrite and erase the input file. Consider the following steps as you work: • Declare a variable to point to the file that will be written to. Watch out for the class you use, and make sure it is for writing to a file and not reading a file. • Create the code instructions for writing data to the new output file. In this new file, include space for both the name of the city and the temperature in Celsius for each city included in the original input file. You will need to complete the Fahrenheit-to-Celsius conversion calculation before you write to the new file. Use the following formula to make this conversion. Note that °F represents the temperature in degrees Fahrenheit while °C represents the temperature in degrees Celsius. (°F - 32) × = °C 5 9

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
Toronto 47
Lima 66
Istanbul 57
Lagos 81
Shanghai 61
Sydney 64
Transcribed Image Text:Toronto 47 Lima 66 Istanbul 57 Lagos 81 Shanghai 61 Sydney 64
In this assignment, you are presented with a text document that includes six cities and their average yearly temperature in Fahrenheit. Your goal is
to read that data, convert it to Celsius using the provided formula, and then write that new data to its own file.
To begin your work, open Visual Studio and create a new C++ project. Save the provided FahrenheitTemperature.txt document in a location where
you will easily be able to access it while you work in Visual Studio. For this assignment, you will be submitting only your C++ (.cpp) file. You do not
need to submit the final converted data; the C++ code you create just needs to be able to generate that file.
Specifically, you must address the following rubric criteria:
• Develop code to read data from a text file. Your work should be completed using C++. Read the provided document,
FahrenheitTemperature.txt, which includes data on the average yearly temperature for six different cities in degrees Fahrenheit. Note that a
space separates each city from its temperature. Assume the city's name does not include any spaces or special characters (the name should
consist of only a single word). Also assume the provided temperature is presented as an integer. Consider the following steps as you work:
• Open the provided file so it is ready to be read. Remember the file is named FahrenheitTemperature.txt. Watch out for the class you use,
and make sure it is for reading a file and not writing to a file.
• Read data from the provided file. Remember, to read this file you will need to declare a variable. Begin by reading the first value and
putting it in the first variable. Then read the next value and put it in the second variable.
• Once this is complete, be sure to close the file. This releases the file so it can be used again.
• Develop code to write data to a text file. Your work should be completed using C++. Title the new document you are creating
CelsiusTemperature.txt. The name of the output file needs to be different from the name of the input file so you do not overwrite and erase
the input file. Consider the following steps as you work:
• Declare a variable to point to the file that will be written to. Watch out for the class you use, and make sure it is for writing to a file and
not reading a file.
• Create the code instructions for writing data to the new output file. In this new file, include space for both the name of the city and the
temperature in Celsius for each city included in the original input file. You will need to complete the Fahrenheit-to-Celsius conversion
calculation before you write to the new file. Use the following formula to make this conversion. Note that °F represents the temperature
in degrees Fahrenheit while °C represents the temperature in degrees Celsius.
(°F - 32) × = °C
5
9
Transcribed Image Text:In this assignment, you are presented with a text document that includes six cities and their average yearly temperature in Fahrenheit. Your goal is to read that data, convert it to Celsius using the provided formula, and then write that new data to its own file. To begin your work, open Visual Studio and create a new C++ project. Save the provided FahrenheitTemperature.txt document in a location where you will easily be able to access it while you work in Visual Studio. For this assignment, you will be submitting only your C++ (.cpp) file. You do not need to submit the final converted data; the C++ code you create just needs to be able to generate that file. Specifically, you must address the following rubric criteria: • Develop code to read data from a text file. Your work should be completed using C++. Read the provided document, FahrenheitTemperature.txt, which includes data on the average yearly temperature for six different cities in degrees Fahrenheit. Note that a space separates each city from its temperature. Assume the city's name does not include any spaces or special characters (the name should consist of only a single word). Also assume the provided temperature is presented as an integer. Consider the following steps as you work: • Open the provided file so it is ready to be read. Remember the file is named FahrenheitTemperature.txt. Watch out for the class you use, and make sure it is for reading a file and not writing to a file. • Read data from the provided file. Remember, to read this file you will need to declare a variable. Begin by reading the first value and putting it in the first variable. Then read the next value and put it in the second variable. • Once this is complete, be sure to close the file. This releases the file so it can be used again. • Develop code to write data to a text file. Your work should be completed using C++. Title the new document you are creating CelsiusTemperature.txt. The name of the output file needs to be different from the name of the input file so you do not overwrite and erase the input file. Consider the following steps as you work: • Declare a variable to point to the file that will be written to. Watch out for the class you use, and make sure it is for writing to a file and not reading a file. • Create the code instructions for writing data to the new output file. In this new file, include space for both the name of the city and the temperature in Celsius for each city included in the original input file. You will need to complete the Fahrenheit-to-Celsius conversion calculation before you write to the new file. Use the following formula to make this conversion. Note that °F represents the temperature in degrees Fahrenheit while °C represents the temperature in degrees Celsius. (°F - 32) × = °C 5 9
Expert Solution
Introduction

This question is from the subject c++ where we are going to learn to read the data from file1 and perform some calculation (temperature conversion) on the data and again store the calculated data into another file.

 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Block Comments
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