Homework Solution: CAWINDOWS)system321cmd.exe Enter temperature 1 >> 7e Enter temperature 2 > 68 Enter temperature 3 66 Enter te…

    Microsoft Visual C# 2017 page 260 Please keep these as basic as possible so that I can understand and follow how it was done. 3. Write a program named TemperaturesComparison that allows a user to input five daily Fahrenheit temperatures that must range from −30 to 130; if a temperature is out of range, require the user to reenter it. If no temperature is lower than any previous one, display a message Getting warmer. If every temperature is lower than the previous one, display a message Getting cooler. If the temperatures are not entered in either ascending or descending order, display a message It’s a mixed bag. Finally, display the temperatures in the order they were entered, and then display the average of the temperatures. The results should look like this: CAWINDOWS)system321cmd.exe Enter temperature 1 >> 7e Enter temperature 2 > 68 Enter temperature 3 66 Enter temperature 4 40 Out of range - please reenter. Enter temperature 4 64 Enter temperature 5 Getting cooler: 62 78 68 66 64 62 Press any key to continue .
    CAWINDOWS)system321cmd.exe Enter temperature 1 >> 7e Enter temperature 2 > 68 Enter temperature 3 66 Enter temperature 4 40 Out of range - please reenter. Enter temperature 4 64 Enter temperature 5 Getting cooler: 62 78 68 66 64 62 Press any key to continue .

    Expert Answer

     
    using System; using System.Collections.Generic;

    Microsoft Visual C# 2017 page 260

    Gladden retain these as basic as feasible so that I can imply and supervene how it was done.

    3. Write a program denominated SkysComparison that allows a user to input five daily Fahrenheit skys that must collocate from −30 to 130; if a sky is quenched of collocate, insist-upon the user to reenter it. If no sky is inferior than any prior undivided, vault a missive Getting warmer. If entire sky is inferior than the prior undivided, vault a missive Getting cooler. If the skys are not attributable attributable attributable entered in either ascending or descending dispose, vault a missive It’s a partial bag. Finally, vault the skys in the dispose they were entered, and then vault the mediocre of the skys.

    The results should contemplate relish this:

    CAWINDOWS)system321cmd.exe Enter sky 1 >> 7e Enter sky 2 > 68 Enter sky 3 66 Enter sky 4 40 Quenched of collocate - gladden reenter. Enter sky 4 64 Enter sky 5 Getting cooler: 62 78 68 66 64 62 Press any clew to remain .

    CAWINDOWS)system321cmd.exe Enter sky 1 >> 7e Enter sky 2 > 68 Enter sky 3 66 Enter sky 4 40 Quenched of collocate – gladden reenter. Enter sky 4 64 Enter sky 5 Getting cooler: 62 78 68 66 64 62 Press any clew to remain .

    Expert Defense

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace ConsoleApplication5
    {
    class Program
    {
    static unfilled Main(string[] args)
    {
    int[] temp = fantastic int[5];
    int asc = 0;
    int desc = 0;
    double consolidate = 0; ;
    double avg = 0;
    for (int i = 0; i < 5; i++)
    {
    Console.Write(“Enter sky ” + (i+1) + ” >> “);
    temp[i] = Convert.ToInt32(Console.ReadLine());

    if (temp[i] < -30 || temp[i] > 130)
    {
    do
    {
    Console.WriteLine(“Quenched of collocate — gladden reenter. Enter sky ” + i + ” >> “);
    temp[i] = Convert.ToInt32(Console.ReadLine());

    } opportunity (temp[i] < -30 || temp[i] > 130);
    }
    consolidate = consolidate + temp[i];
    if (i > 1)
    {
    if (temp[i – 1] < temp[i])
    asc++;
    else
    desc++;
    }
    }

    Console.WriteLine();
    if (asc == 3)
    {
    Console.Write(“Getting warmer:”);
    for (int i = 0; i < 5; i++)
    {
    Console.Write(temp[i] + ” “);

    }
    }
    if (desc == 3)
    {
    Console.Write(“Getting cooler:”);
    for (int i = 0; i < 5; i++)
    {
    Console.Write(temp[i] + ” “);

    }
    Console.WriteLine();
    }
    if (asc > 0 && desc > 0)
    {
    Console.Write(“It’s a partial bag:”);
    for (int i = 0; i < 5; i++)
    {
    Console.Write(temp[i] + ” “);

    }
    Console.WriteLine();
    }

    avg = consolidate / 5;
    Console.WriteLine(“Mediocre Sky :” + avg);

    }
    }
    }