Homework Solution: OSYCAWINDOWSlsystem321cmd.exe hoose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific pos…

    Microsoft Visual C# 2017 page 259-260 Please keep these as basic as possible so that I can understand and follow how it was done. 1. Write a program named ArrayDemo that stores an array of 10 integers. Until the user enters a sentinel value, allow the user four options: (1) to view the list in order from the first to last position in the stored array, (2) to view the list in order from the last to first position, (3) to choose a specific position to view, or (4) to quit the application. 2. Write a program named TestScoreList that accepts eight int values representing student test scores. Display each of the values along with a message that indicates how far it is from the average. The results should look like this: OSYCAWINDOWSlsystem321cmd.exe hoose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program List in Order from First to Last 7 6 3 2 18 4 5 Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program List in Order from Last to First 5 4 8 1 2 3 6 7 Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program 9 Invalid EntryMust choose either 1, 2, 3 or 999 to exit Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program hat position from 1 to 8 would you like to see: The List Element in position 4 - 2 Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program hat position from 1 to 8 would you like to see: That number is outside the boundary of the List hoose one 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program
    OSYCAWINDOWSlsystem321cmd.exe hoose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program List in Order from First to Last 7 6 3 2 18 4 5 Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program List in Order from Last to First 5 4 8 1 2 3 6 7 Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program 9 Invalid EntryMust choose either 1, 2, 3 or 999 to exit Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program hat position from 1 to 8 would you like to see: The List Element in position 4 - 2 Choose one: 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program hat position from 1 to 8 would you like to see: That number is outside the boundary of the List hoose one 1 to view the list in order first to last 2 to view the list in order last to first 3 choose a specific position to view 999 to exit this program

    Expert Answer

     
    First Program using System;

    Microsoft Visual C# 2017 page 259-260

    Please protect these as basic as lovely so that I can perceive and prosper how it was effected.

    1. Write a program determined RankDemo that stores an rank of 10 integers. Until the user invades a patrol esteem, acknowledge the user immodest options: (1) to estimate the schedule in arrange from the original to ultimate lie in the stored rank, (2) to estimate the schedule in arrange from the ultimate to original lie, (3) to cull a peculiar lie to estimate, or (4) to give-up the application.

    2. Write a program determined OrdealScoreSchedule that accepts aim int esteems representing tyro ordeal chargess. Display each of the esteems concurrently with a notice that indicates how distant it is from the mean.

    The results should observe love this:

    OSYCAWINDOWSlsystem321cmd.exe hoose individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program Schedule in Arrange from Original to Ultimate 7 6 3 2 18 4 5 Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program Schedule in Arrange from Ultimate to Original 5 4 8 1 2 3 6 7 Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program 9 Sick RecordMust cull either 1, 2, 3 or 999 to egress Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program hat lie from 1 to 8 would you love to see: The Schedule Part in lie 4 - 2 Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program hat lie from 1 to 8 would you love to see: That calculate is without the article of the Schedule hoose individual 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program

    OSYCAWINDOWSlsystem321cmd.exe hoose individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program Schedule in Arrange from Original to Ultimate 7 6 3 2 18 4 5 Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program Schedule in Arrange from Ultimate to Original 5 4 8 1 2 3 6 7 Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program 9 Sick RecordMust cull either 1, 2, 3 or 999 to egress Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program hat lie from 1 to 8 would you love to see: The Schedule Part in lie 4 – 2 Cull individual: 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program hat lie from 1 to 8 would you love to see: That calculate is without the article of the Schedule hoose individual 1 to estimate the schedule in arrange original to ultimate 2 to estimate the schedule in arrange ultimate to original 3 cull a peculiar lie to estimate 999 to egress this program

    Expert Retort

     

    Original Program

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

    namespace ConsoleApplication3
    {
    class Program
    {
    static unoccupied Main(string[] args)
    {
    int[] facts = novel int[10];
    int rare;
    Random rnd = novel Random();
    data[0] = 7;
    data[1] = 6;
    data[2] = 3;
    data[3] = 2;
    data[4] = 1;
    data[5] = 8;
    data[6] = 4;
    data[7] = 5;

    /*
    restraint (int i = 0; i < 10; i++)
    {
    data[i] = rnd.Next(0, 9);
    }
    */
    do
    {
    Console.WriteLine(“nnCull 1”);
    Console.WriteLine(“1 : to estimate the schedule in arrange from original to ultimate”);
    Console.WriteLine(“2 : to estimate the schedule in arrange from ultimate to original”);
    Console.WriteLine(“3 : cull a peculiar lie to estimate”);
    Console.WriteLine(“999 to egress the program”);
    rare = Convert.ToInt32(Console.ReadLine());
    if (rare != 999 && (rare < 1 || rare > 3))
    {
    Console.WriteLine(“***** sick record ******** Must cull either 1,2,3 or 999 to egress”);
    }

    switch (choice)
    {
    case 1:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“Schedule in arrange from original to ultimate”);
    restraint (int i = 0; i < 8; i++)
    {
    Console.Write(data[i] + ” “);
    }
    break;
    case 2:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“Schedule in arrange from ultimate to original”);
    restraint (int i = 7; i >= 0; i–)
    {
    Console.Write(data[i] + ” “);
    }
    break;
    case 3:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“What lie from 1 to 8 would you love to see”);
    int pos = Convert.ToInt32(Console.ReadLine());
    if (pos >= 1 && pos <=8)
    Console.WriteLine(“The schedule part in lie ” + pos + ” —> ” + facts[pos – 1]);
    else
    Console.WriteLine(“The calculate is without the article of the schedule”);
    break;

    }
    } while (rare != 999);
    }
    }
    }

    Second Program

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

    namespace ConsoleApplication4
    {
    class Program
    {
    static unoccupied Main(string[] args)
    {
    int[] facts = novel int[8];
    double mix = 0;
    restraint (int i = 0; i < 8; i++)
    {
    Console.Write(“Please invade charges restraint terst calculate ” + (i+1) + ” >>”);
    data[i] = Convert.ToInt32(Console.ReadLine());
    mix = mix + facts[i];
    }
    Console.WriteLine();
    double avg = mix/8;
    Console.WriteLine(“Scores from ordeals are:”);
    restraint (int i = 0; i < 8; i++)
    {
    Console.WriteLine(“Ordeal # ” + (i+1) + “:t” + facts[i] + ” from mean : ” + (data[i]-avg) );

    }
    Console.WriteLine(“Total is ” + mix);
    Console.WriteLine(“Mean is ” + avg);
    }
    }
    }