Write a program (C++) to read the date and average from the temps.txt file. Use a string data type for the date and a doub e average. The program should then convert the average (Fahrenheit) to Celsius. The conversion formula is subtract 32 from the average (Fahrenheit) and then multiply by five and divide by nine, e. 32) * 5/9. Output the date, the average temperature (Fahrenheit) and the Celsius temperature to a file named celsi Use the manipulators you have learned about in this chapter to format the output as shown in the sample be low and print each number value to one decimal space. 1. Identify the following parameters to complete the specification above. Input parameters? Output parameters? Constant parameters? 2. Attach the input and
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Step by step
Solved in 3 steps with 4 images