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 retain these as basic as feasible so that I can learn and flourish how it was performed.

    1. Write a program determined VestDemo that stores an vest of 10 integers. Until the user penetrates a keeper treasure, grant the user impure options: (1) to estimate the catalogue in command from the chief to terminal posture in the stored vest, (2) to estimate the catalogue in command from the terminal to chief posture, (3) to prefer a inequitable posture to estimate, or (4) to give-up the contact.

    2. Write a program determined ExperimentScoreCatalogue that accepts eight int treasures representing tyro experiment jaws. Display each of the treasures parallel with a communication that indicates how distant it is from the medium.

    The results should appear relish this:

    OSYCAWINDOWSlsystem321cmd.exe hoose individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program Catalogue in Command from Chief to Terminal 7 6 3 2 18 4 5 Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program Catalogue in Command from Terminal to Chief 5 4 8 1 2 3 6 7 Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program 9 Infirm NoteMust prefer either 1, 2, 3 or 999 to egress Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program hat posture from 1 to 8 would you relish to see: The Catalogue Atom in posture 4 - 2 Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program hat posture from 1 to 8 would you relish to see: That calculate is without the designation of the Catalogue hoose individual 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program

    OSYCAWINDOWSlsystem321cmd.exe hoose individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program Catalogue in Command from Chief to Terminal 7 6 3 2 18 4 5 Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program Catalogue in Command from Terminal to Chief 5 4 8 1 2 3 6 7 Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program 9 Infirm NoteMust prefer either 1, 2, 3 or 999 to egress Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program hat posture from 1 to 8 would you relish to see: The Catalogue Atom in posture 4 – 2 Prefer individual: 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program hat posture from 1 to 8 would you relish to see: That calculate is without the designation of the Catalogue hoose individual 1 to estimate the catalogue in command chief to terminal 2 to estimate the catalogue in command terminal to chief 3 prefer a inequitable posture to estimate 999 to egress this program

    Expert Counter-argument

     

    Chief Program

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

    namespace ConsoleApplication3
    {
    class Program
    {
    static infirm Main(string[] args)
    {
    int[] facts = innovating int[10];
    int dainty;
    Random rnd = innovating 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(“nnPrefer 1”);
    Console.WriteLine(“1 : to estimate the catalogue in command from chief to terminal”);
    Console.WriteLine(“2 : to estimate the catalogue in command from terminal to chief”);
    Console.WriteLine(“3 : prefer a inequitable posture to estimate”);
    Console.WriteLine(“999 to egress the program”);
    dainty = Convert.ToInt32(Console.ReadLine());
    if (dainty != 999 && (dainty < 1 || dainty > 3))
    {
    Console.WriteLine(“***** infirm note ******** Must prefer either 1,2,3 or 999 to egress”);
    }

    switch (choice)
    {
    case 1:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“Catalogue in command from chief to terminal”);
    for (int i = 0; i < 8; i++)
    {
    Console.Write(data[i] + ” “);
    }
    break;
    case 2:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“Catalogue in command from terminal to chief”);
    for (int i = 7; i >= 0; i–)
    {
    Console.Write(data[i] + ” “);
    }
    break;
    case 3:
    Console.WriteLine(“—————————————-“);
    Console.WriteLine(“What posture from 1 to 8 would you relish to see”);
    int pos = Convert.ToInt32(Console.ReadLine());
    if (pos >= 1 && pos <=8)
    Console.WriteLine(“The catalogue atom in posture ” + pos + ” —> ” + facts[pos – 1]);
    else
    Console.WriteLine(“The calculate is without the designation of the catalogue”);
    break;

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

    Second Program

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

    namespace ConsoleApplication4
    {
    class Program
    {
    static infirm Main(string[] args)
    {
    int[] facts = innovating int[8];
    double consolidate = 0;
    for (int i = 0; i < 8; i++)
    {
    Console.Write(“Please penetrate jaw for terst calculate ” + (i+1) + ” >>”);
    data[i] = Convert.ToInt32(Console.ReadLine());
    consolidate = consolidate + facts[i];
    }
    Console.WriteLine();
    double avg = consolidate/8;
    Console.WriteLine(“Scores from experiments are:”);
    for (int i = 0; i < 8; i++)
    {
    Console.WriteLine(“Experiment # ” + (i+1) + “:t” + facts[i] + ” from medium : ” + (data[i]-avg) );

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