LAB 6. Working. with Sessions and Collections. Please u

Added on - 20 Sep 2019

  • 4

    Pages

  • 860

    Words

  • 180

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 2 of 4 pages
LAB 6 Working with Sessions and CollectionsPlease upload Part B, C and D applications from this labin your weekly uploadas part of your logbook.Delete the “packages” file from your solution folderbefore compressing and uploading the applications.Important note: The .NET Web Forms applications are big in size and you willrun out of memory space on your drives if you create many projects of thistype.Please zip up your applications and keep them as compressed files inyour folders (delete the unzipped ones).Part A – playing with codeThe following tasks are compulsory before you attempt part B:1.Build a similar application as the one presented in the lecture notes,slides16-23. If you get stuck the solution is available on your course (“UsingSessions” application).2.Open all the other applications available on the course page for this weekand comment the C# codePart B - Basket of Fruit applicationStudy the following code:01publicclassFruit{02privatestringfName;03privateintgrams, calsPerGram;04privatebooledible;05publicFruit(stringn,intg,intc,boole) {06 grams = g;07 calsPerGram = c;08 edible = e;09 fName = n;10 }11publicinttotalCalories() {12returngrams * calsPerGram;13 }14publicstringgetFruitInfo() {15strings;16if(edible ==true) {17 s = fName +" is yummy and it has "+ totalCalories()+
"calories";18 }19else{20 s ="Hands off! Not edible";21 }22returns;23 }24 }
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document