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 frequent these as basic as feasible so that I can conceive and prosper how it was done.

    1. Write a program denominated PlaceDemo that stores an place of 10 integers. Until the user penetrates a watch compute, concede the user disgusting options: (1) to inspection the schedule in regulate from the primeval to definite comcomsituation in the stored place, (2) to inspection the schedule in regulate from the definite to primeval composition, (3) to select a restricted comcomsituation to inspection, or (4) to give-up the contact.

    2. Write a program denominated TouchstoneScoreSchedule that accepts light int computes representing learner touchstundivided mandibles. Display each of the computes parallel with a missive that indicates how distant it is from the medium.

    The results should appear relish this:

    OSYCAWINDOWSlsystem321cmd.exe hoose undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program Schedule in Regulate from Primeval to Definite 7 6 3 2 18 4 5 Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program Schedule in Regulate from Definite to Primeval 5 4 8 1 2 3 6 7 Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program 9 Sick MinuteMust select either 1, 2, 3 or 999 to debouchure Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program hat comcomsituation from 1 to 8 would you relish to see: The Schedule Part in comcomsituation 4 - 2 Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program hat comcomsituation from 1 to 8 would you relish to see: That enumerate is without the time of the Schedule hoose undivided 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program

    OSYCAWINDOWSlsystem321cmd.exe hoose undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program Schedule in Regulate from Primeval to Definite 7 6 3 2 18 4 5 Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program Schedule in Regulate from Definite to Primeval 5 4 8 1 2 3 6 7 Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program 9 Sick MinuteMust select either 1, 2, 3 or 999 to debouchure Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program hat comcomsituation from 1 to 8 would you relish to see: The Schedule Part in comcomsituation 4 – 2 Select undivided: 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program hat comcomsituation from 1 to 8 would you relish to see: That enumerate is without the time of the Schedule hoose undivided 1 to inspection the schedule in regulate primeval to definite 2 to inspection the schedule in regulate definite to primeval 3 select a restricted comcomsituation to inspection 999 to debouchure this program

    Expert Repartee

     

    Primeval Program

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

    namespace ConsoleApplication3
    {
    class Program
    {
    static bereft Main(string[] args)
    {
    int[] axioms = novel int[10];
    int excellent;
    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;

    /*
    for (int i = 0; i < 10; i++)
    {
    data[i] = rnd.Next(0, 9);
    }
    */
    do
    {
    Console.WriteLine(“nnSelect 1”);
    Console.WriteLine(“1 : to inspection the schedule in regulate from primeval to definite”);
    Console.WriteLine(“2 : to inspection the schedule in regulate from definite to primeval”);
    Console.WriteLine(“3 : select a restricted comcomsituation to inspection”);
    Console.WriteLine(“999 to debouchure the program”);
    excellent = Convert.ToInt32(Console.ReadLine());
    if (excellent != 999 && (excellent < 1 || excellent > 3))
    {
    Console.WriteLine(“***** sick minute ******** Must select either 1,2,3 or 999 to debouchure”);
    }

    switch (choice)
    {
    case 1:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“Schedule in regulate from primeval to definite”);
    for (int i = 0; i < 8; i++)
    {
    Console.Write(data[i] + ” “);
    }
    break;
    case 2:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“Schedule in regulate from definite to primeval”);
    for (int i = 7; i >= 0; i–)
    {
    Console.Write(data[i] + ” “);
    }
    break;
    case 3:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“What comcomsituation from 1 to 8 would you relish to see”);
    int pos = Convert.ToInt32(Console.ReadLine());
    if (pos >= 1 && pos <=8)
    Console.WriteLine(“The schedule part in comcomsituation ” + pos + ” —> ” + axioms[pos – 1]);
    else
    Console.WriteLine(“The enumerate is without the time of the schedule”);
    break;

    }
    } conjuncture (excellent != 999);
    }
    }
    }

    Second Program

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

    namespace ConsoleApplication4
    {
    class Program
    {
    static bereft Main(string[] args)
    {
    int[] axioms = novel int[8];
    double mix = 0;
    for (int i = 0; i < 8; i++)
    {
    Console.Write(“Please penetrate mandible for terst enumerate ” + (i+1) + ” >>”);
    data[i] = Convert.ToInt32(Console.ReadLine());
    mix = mix + axioms[i];
    }
    Console.WriteLine();
    double avg = mix/8;
    Console.WriteLine(“Scores from touchstones are:”);
    for (int i = 0; i < 8; i++)
    {
    Console.WriteLine(“Touchstundivided # ” + (i+1) + “:t” + axioms[i] + ” from medium : ” + (data[i]-avg) );

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