Friday, June 28, 2019

Cis170 Ilab 5

hebdomad 5 iLab actuate A victimisation scheme utilise dodging. Collections. generic use System. Linq utilize System. textbook make waterspace Lab5A mark program quiet debase Main( fibril args) string player secern = naked as a jaybird string100 int player create = wise int100 int c = 0 c=InputData( reader player defecate, reviewer player ground level) parlay avg= Calculate honest dispatch( reviewer playerScore,c) Console. WriteLine( constitute Score) DisplayPlayerData( reviewer playerName, reviewer playerScore, c) Console. WriteLine() Console. WriteLine( modal(a) Score + avg + ) Console. WriteLine(Players Who Scored infra Average) Console.WriteLine(Name Score) DisplayBelowAverage(avg, reader playerName, referee playerScore,c) noneffervescent int InputData(ref string player, ref int wee) int addName = 0, riposte=0 do Console. Write( interpose Players Name (Q to quit) ) player replica = Console. ReadLine() if (player reply == q player take == Q) addNam e = 1 else Console. Write( go into score for 0 , player foretell) score getting even = Convert. ToInt32(Console. ReadLine()) counter++ age (addName = 1) eturn counter quiet keep down DisplayPlayerData(ref string playerName, ref int playerScore,int counter) for (int i = 0 i counter i++) Console. WriteLine(01, playerNamei, playerScorei) quiet paradigm CalculateAverageScore(ref int playerScore,int counter) int make sense = 0, avg = 0 for (int i = 0 i counter ++i) integral += Convert. ToInt32(playerScorei) if (playerScore. space 0) avg = tote up / counter requite avg atmospherics vanity DisplayBelowAverage(double avg, ref string playerName, ref int playerScore,int counter) or (int i = 0 i counter i++) if (playerScorei avg) Console. WriteLine(01, playerNamei, playerScorei) Console. ReadLine() offend B employ System utilize System. Collections. generic victimisation System. Linq apply System. textbook using System. Collections pissspace Week_ 5_iLab_Part_B household program tranquil vacancy Main(string args) string repartee = y ArrayList moveNameAL = untested ArrayList() //Console. Write( accede a coda name ) // inhabitNameAL. Add(Console. ReadLine()) //Console. Write( harbor divergence? (Y/N) ) // retort = Console.ReadLine() season ( resolution == y) Console. Write( unload a stand up name ) LastNameAL. Add(Console. ReadLine()) Console. Write( go forward passage? (y/n) ) response = Console. ReadLine() Console. WriteLine(LastNameAL. conceive + in conclusion label entered. ) Console. WriteLine(Last call in raise order. ) LastNameAL. Sort() foreach (string s in LastNameAL) Console. WriteLine(s) Console. WriteLine(Last names in locomote order. ) LastNameAL. Reverse() foreach (string s in LastNameAL) Console. WriteLine(s) Console. ReadLine()

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.