Explore BrainMass
Share

Explore BrainMass

    Find highest, lowest, and average temperature of the month

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    need help writing a program in C# with the output

    Please enter the average temperature for week 1 of the month: 11

    Please enter the average temperature for week 2 of the month: 22

    Please enter the average temperature for week 3 of the month: 33

    Please enter the average temperature for week 4 of the month: 44

    The lowest temperature for the month was : 11 degrees.

    The highest temperature for the month was : 44 degrees.

    The average temperature for the month was: 27.5 degrees

    © BrainMass Inc. brainmass.com October 10, 2019, 8:29 am ad1c9bdddf
    https://brainmass.com/computer-science/c-sharp/highest-lowest-average-temperature-month-628421

    Solution Preview

    using System.IO;
    using System;

    class Program
    {
    static void Main()
    {
    //get temperature from user
    Console.WriteLine("Please enter the average temperature for week 1 of the month:");
    int week1 = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("Please enter the average temperature for ...

    Solution Summary

    Easy to understand, self-explanatory code to find highest, lowest, and average temperature of the month. A simple C# code that asks users to enter average temperate for each week of the month. It then finds the lowest, highest, and average temperature values and display the result on the console. It uses Math.min and Math.max methods.

    $2.19