Preview

Lab 5

Satisfactory Essays
Open Document
Open Document
463 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Lab 5
iLab5A

/* Specification: lsd Lab 5 Exercise A This program takes input from the user taking player names (up to 100) and player scores (up to 100). When the user enters Q to quit the program a summary is displayed with all the player names, player scores, the average score, then a list of players who scored below the average. */

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

namespace LAB5
{
class Program { static void Main(string[] args) { // initializing variables string[] playerNamesArray = new string[100]; int[] playerScoresArray = new int[100]; int numberOfplayers = 0; double averageScore;

// calls the various methods that supply the different functions for the program InputData(playerNamesArray, playerScoresArray, ref numberOfplayers); DisplayPlayerData(playerNamesArray, playerScoresArray, numberOfplayers); averageScore = CalculateAverageScore(playerScoresArray, numberOfplayers); DisplayBelowAverage(playerNamesArray, playerScoresArray, numberOfplayers, averageScore); }

// This method takes the input from the user. It enters the player's names and scores into different arrays. // Once the user enters a Q it will break from this method and return to Main(). static void InputData(string[] nameArray, int[] scoreArray, ref int numberOfArraySlots) { while (numberOfArraySlots < nameArray.Length) { Console.Write("Enter Player Name (Q to quit): "); nameArray[numberOfArraySlots] = Console.ReadLine();

if (nameArray[numberOfArraySlots].Substring(0).ToUpper() == "Q") { break; }

Console.Write("Enter score for {0} :

You May Also Find These Documents Helpful

  • Satisfactory Essays

    lab 4

    • 451 Words
    • 2 Pages

    Compare the portions that address Internet and e-mail access of at least three different companies.…

    • 451 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Lab 10

    • 1213 Words
    • 5 Pages

    Take a screen shot of the Devices and Printers control panel with the new printer icon you created by pressing Alt+Prt Scr, and then paste the resulting image into the lab09_worksheet file in the page provided by pressing Ctrl+V.…

    • 1213 Words
    • 5 Pages
    Better Essays
  • Good Essays

    To fully test my program, test data needs to be created that can fully push the program to its boundaries or even further by causing a crash or error during execution. This will ensure that all errors and bugs are discovered so they can then be corrected.. The whole program will be played several times to make sure it works from the start to the end without any errors or bugs being encountered and to ensure it gives the correct outputs.…

    • 1040 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Score B 1 1 2 3 4 Score A 5 6 7 8 9 10 11 12 1 1 2 3 4 6 7 8 9 10 11 12 2 1 2 3 4 4 6 7 8 9 10 11 12 3 1 2 3 4 4 6 7 8 9 10 11 12 4 2 3 3 4 5 7 8 9 10 11 11 12 5 3 4 4 5 6 8 9 10 10 11 12 12 6 3 4 5 6 7 8 9 10 10 11 12 12 7 4 5 6 7 8 9 9 10 11 11 12 12 8 5 6 7 8 8 9 10 10 11 12 12 12 9 6 6 7 8 9 10 10 10 11 12 12 12 10 7 7 8 9 9 10 11 11 12 12 12 12 11 7 7 8 9 9 10 11 11 12 12 12 12…

    • 1068 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Cis170 Ilab 5

    • 363 Words
    • 2 Pages

    0,counter=0; do { Console. Write("Enter Player's Name (Q to quit): "); player[counter] = Console. ReadLine(); if (player[counter] == "q" || player[counter] = = "Q") { addName = 1; } else…

    • 363 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Program Lovecs.Java

    • 422 Words
    • 2 Pages

    import java.util. Scanner; public class LoveCS { public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.println("Enter how many times you wish the message to be printed."); int limit = 0; limit= scan.nextInt(); int sum=0; int count=1; while (count <=limit) { System.out.println(count+" I love Computer Science!!"); sum+=count; count++; } System.out.println("Printed this message " + limit + " times."); System.out.println("The sum of the numbers from 1 to "+limit+" is "+sum); } } import java.util. Scanner; public class PowersOf2 { public static void main(String[]args) { int valuePowersOf2; int nextPowersOf2 =1; int exponent= 0; int count=0; Scanner scan = new Scanner(System.in); System.out.println("Enter A Number.");…

    • 422 Words
    • 2 Pages
    Better Essays
  • Satisfactory Essays

    It 210 Week 7

    • 286 Words
    • 2 Pages

    2. Display the contents of the file GRADES created in Problem 1. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student. For example, a line of output might be as follows:…

    • 286 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Lab 4

    • 575 Words
    • 3 Pages

    1.List four cell structures that were common to both plant and animal cells. (4 points)…

    • 575 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Lab 7

    • 928 Words
    • 3 Pages

    1. What are some common risks, threats, and vulnerabilities commonly found in the LAN-to-WAN Domain that must be mitigated through a layered security strategy?…

    • 928 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    | 10-8 points | 7-5 points | 4-3 points | 2-1 point(s) | 0 points |…

    • 1254 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Base Ball Score Template

    • 637 Words
    • 3 Pages

    It keeps track information about scorer. The scorer information will be stored separately as each team score and highest and lowest score. It will also store information about winner and name of winner. The scorer template is needed to maintain information about winner and difference between scores of each team.…

    • 637 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    It 218 Week 4 Checkpoint

    • 290 Words
    • 2 Pages

    An array is a variable that holds more than more than one value, and an array can be combined with multiple variables for a more complex structure. An array is declared much similar with any other variable. The only difference is the number of elements is shown in brackets. An example of an array will be look much like these three: calories [ min ], 30 [ 7 ], and feet [ 12 ]. Each one of these arrays can be used as long as it is appropriate for the program.…

    • 290 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Program tells user it is ready for input User enters input and it is processed…

    • 1859 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    Each contestant must also be rated according to skill. Ratings of S, E, G, F…

    • 221 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Cpt 111 - Assigment

    • 488 Words
    • 2 Pages

    Your program will display the Medals Tally based on the results of the 10 games.…

    • 488 Words
    • 2 Pages
    Satisfactory Essays