Question: Help Programming Project: Comfort Zone The comfort zone temperature for the occupants of a building is higher in summer months than it is in winter


Programming Project: Comfort Zone The comfort zone temperature for the occupants of a building is higher in summer months than it is in winter months. It is also dependent on the value of the relative humidity. Write a program that reads in values for temperature and humidity as well as whether it is summer or winter. Use these values to determine if those conditions fall within the comfort zone or not. For this project, the comfort zone is defined by the values in the following table. The program you write will repeatedly do the following: 1. Prompt the user for the temperature in Celsius. 2. Recognize a negative temperature value as a sentinel or stop value. 3. Convert the Celsius temperature to its Fahrenheit equivalent. 4. Prompt the user for the relative humidity. 5. Ensure that the humidity is in the range from 0 through 100. 6. Prompt the user for whether it is summer or winter. 7. Determine whether the conditions are in the comfort zone. 8. Calculate the Comfort Zone index. 9. Display output using the following format: Echo back the converted temperature and the relative humidity using a line formatted like this: The temperature in Fahrenheit is -.The relative humidity is _8. (Where the converted temperature value and the humidity value are displayed in place of the underline symbols.) If the conditions are in the comfort zone, display a line formatted like this: These conditions are in the comfort zone for (summer I winter). Where either the word summer or the word winter is displayed. Where either the word summer or the word winter is displayed. If the conditions are not in the comfort zone, display a line for each of the conditions that fall outside of the acceptable range for that parameter: The temperature is too (high 1 low). The humidity is too (high I low). Where either the word high or the word low is displayed. The Comfort Zone Index is calculated with the user-entered values of temperature and humidity along with the ideal values for the seasonal temperature and humidity. When the user-entered temperature and humidity match the ideal values for either Summer or Winter, the Comfort Zone index is 100 . The farther and farther away the userentered temperature and humidity are from the ideal values, the lower will be the value of the Comfort Zone Index. The following formula should be used to calculate the Comfort Zone Index: Comfort Zone Index =1000.4(IdealHH)2+0.6(IdealTT)2 Where: IdealH =40 in Summer, 35 in Winter H= User-entered Humidity value IdealT =77 in Summer, 73 in Winter T= User-entered Temperature Display the value of the Comfort Zone Index using a line of output formatted like this: The Comfort zone Index is 95.2 After displaying the results for one set of values, your program should prompt the User for another set of values and determine if that set of values (temperature and humidity) are in the comfort zone. You program should continue prompting the User for values until the User enters a negative value for the Celsius temperature. (NOTES: The acceptable range of values for the relative humidity is from zero (0) to 100 inclusive. Write your program so that an input temperature value of 25.5 will be converted and processed correctly.) Refer to Section 5.3 of the textbook, "Using the while Loop for Input Validation", for an explanation and an example of validating user input. Use the following formula to convert a Celsius temperature to its Fahrenheit equivalent: Fahrenheit=59Celsius+32 To receive full credit for this programming assignment, you must: - Use the correct file name. - Submit a program that compiles and executes correctly. - Interpret valid sentinel value(s) correctly. - Interact effectively with the user. Grading Guideline: - Include a comment containing the student's full name. (5 points) - Document the program with other meaningful comments. (5 points) - Prompt the user for the Celsius temperature first. (5 points) - Respond appropriately to a sentinel value. - Correctly convert temperature from C to F. (5 points) - Prompt the user for the relative humidity. (5 points) - Validate the humidity value entered by the user. (5 points) - Correctly echo back the input parameters. ( 10 points) - Correctly indicate whether conditions are in the comfort zone. (15 points) - Identify and output exceptions to comfort zone conditions. (20 points) Correct Temperature Range Correct Relative Humidity Range - Calculate and display the Comfort Zone Index to 1 decimal place. (10 points) - Program executes repeatedly until a sentinel value is entered. (5 points) - Use prompts and messages that are clear and easy to understand. (10 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
