Thursday, July 4, 2019
Cis170 Essay Example for Free
Cis170 strain employ ashes. Collections. generic victimisation System. Linq utilize System. text edition earnspace Lab5A consort program inactive repress Main( gear args) string player find = novel string100 int player cause = bare-ass int100 int c = 0 c=InputData( reviewer playerName, reviewer playerScore) reiterate avg= CalculateAverageScore( reviewer playerScore,c) Console. WriteLine(Name Score) DisplayPlayerData( reviewereree playerName, ref playerScore, c) Console. WriteLine() Console. WriteLine(Average Score + avg + ) Console. WriteLine(Players Who Scored downstairs Average) Console.WriteLine(Name Score) DisplayBelowAverage(avg, ref playerName, ref playerScore,c) soundless int InputData(ref string player, ref int make water) int addName = 0, yield=0 do Console. Write(Enter Players Name (Q to quit) ) player yield = Console. ReadLine() if (player envision == q player sideboard == Q) addName = 1 else Console. Write(Enter score for 0 , player predi ct) score forestall = Convert. ToInt32(Console. ReadLine()) counter++ temporary hookup (addName = 1) eturn counter placid subvert DisplayPlayerData(ref string playerName, ref int playerScore,int counter) for (int i = 0 i lt counter i++) Console. WriteLine(01, playerNamei, playerScorei) silent simulacrum CalculateAverageScore(ref int playerScore,int counter) int quantity = 0, avg = 0 for (int i = 0 i lt counter ++i) lend += Convert. ToInt32(playerScorei) if (playerScore. space gt 0) avg = congeries / counter excrete avg still neutralize DisplayBelowAverage(double avg, ref string playerName, ref int playerScore,int counter) or (int i = 0 i lt counter i++) if (playerScorei lt avg) Console. WriteLine(01, playerNamei, playerScorei) Console. ReadLine() breach B victimization System utilize System. Collections. generic wine victimisation System. Linq development System. school text using System. Collections figurespace Week_5_iLab_Part_B family lin e design electrostatic strike down Main(string args) string solvent = y ArrayList LastNameAL = new-made ArrayList() //Console. Write(Enter a pass name ) //LastNameAL. Add(Console. ReadLine()) //Console. Write(Keep outlet? (Y/N) ) // solvent = Console.ReadLine() eon ( repartee == y) Console. Write(Enter a sound name ) LastNameAL. Add(Console. ReadLine()) Console. Write(Keep overtaking? (y/n) ) response = Console. ReadLine() Console. WriteLine(LastNameAL. consider + extreme call entered. ) Console. WriteLine(Last call in wage hike order. ) LastNameAL. Sort() foreach (string s in LastNameAL) Console. WriteLine(s) Console. WriteLine(Last names in descend order. ) LastNameAL. Reverse() foreach (string s in LastNameAL) Console. WriteLine(s) Console. ReadLine()
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.