Design and write a c++ program that inputs a series of 24 hourly temperature fro
ID: 3653138 • Letter: D
Question
Design and write a c++ program that inputs a series of 24 hourly temperature from a file, and outputs a bar chart (using stars) of the temperature for the day. The Temperature should be printed to the left of the corresponding bar and there should be heading that gives the scale of the chart. The range of temperatures should be from -30 to -120. Because it is hard to display 150 characters on the screen , you should have each star represent a range of 3 degrees. That way the bars will be at most 50 characters wide. Here is partial example, showing the heading, the output for a negative temperature and the output for the various positive temperatures.
Explanation / Answer
#include #include //This is for input and output of the file #include using namespace std; const string stars = "*"; const string line = "|"; int main() { int count; float temperature; string fileName; float negative; float positive; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.