Your program creates a dynamically allocated array for storing temperatures in d
ID: 3743804 • Letter: Y
Question
Your program creates a dynamically allocated array for storing temperatures in degrees celsius as follows:
So that the pointer variable temps (temperature) is pointing to the dynamically allocated array. Write code to fill this array with n numbers typed in at the keyboard. The temperature T in degrees Fahrenheit (°F) is equal to the temperature T in degrees Celsius (°C) times 9/5 plus 32.
Write additional code to take this initial values in degrees Celsius and convert the temperatures to degrees Fahrenheit and print out the values.
For example with input
Your output should be like
Note space and newline at end of output.
Explanation / Answer
#include using namespace std; int main() { double *temps; int n =1; cin >> n; temps = new double[n]; for(int i = 0; i > temps[i]; } for(int i = 0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.