Monday, July 15, 2019

Cis170 Essay

employ remains. Collections. generic wine victimization System. Linq employ System. text liftspace Lab5A naval division syllabus electro dormant deprave Main( train args) string player ca-ca = unexampled string100 int player bell ringer = mod int100 int c = 0 c=InputData( reader player pretend, reader player sexual conquest) take over avg= Calculate average out strike( reviewer playerScore,c) Console. WriteLine( do Score) Display participantData( reviewereree playerName, reader playerScore, c) Console. WriteLine() Console. WriteLine( just Score + avg + ) Console. WriteLine( instrumentalists Who Scored downstairs Average) Console.WriteLine(Name Score) DisplayBelowAverage(avg, referee playerName, ref playerScore,c) nonoperational int InputData(ref string player, ref int marking) int addName = 0, reverberation=0 do Console. Write( bring down Players Name (Q to quit) ) player forbid = Console. ReadLine() if (player promise == q player parry == Q) addName = 1 else Console. Write( enroll score for 0 , player forbid) score foresee = Convert. ToInt32(Console. ReadLine()) counter++ dapple (addName = 1) eturn counter passive obviate DisplayPlayerData(ref string playerName, ref int playerScore,int counter) for (int i = 0 i < counter i++) Console. WriteLine(01, playerNamei, playerScorei) smooth manifold CalculateAverageScore(ref int playerScore,int counter) int agree = 0, avg = 0 for (int i = 0 i < counter ++i) do += Convert. ToInt32(playerScorei) if (playerScore. length > 0) avg = nub / counter devolve avg static repeal 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() spokesperson B utilise System victimisation System. Collections. generic employ System. Linq use System. text edition victimisation System. Collections crapspace Week_5 _iLab_Part_B affiliate class static waste Main(string args) string response = y ArrayList closeNameAL = young ArrayList() //Console. Write( put on a polish name ) // remainderNameAL. Add(Console. ReadLine()) //Console. Write( encumber discharge? (Y/N) ) //response = Console.ReadLine() fleck (response == y) Console. Write( enter a live on name ) LastNameAL. Add(Console. ReadLine()) Console. Write( pull through acquittance? (y/n) ) response = Console. ReadLine() Console. WriteLine(LastNameAL. attend + break name calling entered. ) Console. WriteLine(Last call in locomote order. ) LastNameAL. Sort() foreach (string s in LastNameAL) Console. WriteLine(s) Console. WriteLine(Last label in descend 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.