Tuesday, December 3, 2013

Penn Foster 037094 Object-Oriented Programming Fundamentals

Object-Oriented Programming Fundamentals

Penn Foster 037094

OVERVIEW
Since you’ve read through Chapter 12 and selections from other chapters in your textbook and completed the study guide, you have the requisite OOP knowledge to expand the GroceryApp project. This project will assess your under- standing of using classes, enumerations, and handling exceptions.

Make sure that you follow all directions completely and verify your results before submitting the project. Remember to include all required components in your solution or you won’t receive full credit.

YOUR PROJECT
In the graded project for Lesson 2, you implemented the login process for a Windows Forms application in Visual Studio. In this project, you’ll add exception handling to the login process. You’ll also create a class to represent a grocery item and a custom collection class to represent a grocery basket. The output of this project will be used in the next graded project.


INSTRUCTIONS
1.In Visual Studio, load the GroceryApp project that you completed in Lesson 2. If this isn’t available, then you’ll need to ask your instructor for the finished Lesson 2 project.

2.Add a new class to the project named LoginException.vb
(Figure 34)
Make the LoginException class a custom exception by deriving from the Exception class. See Assignment 3 for an example.
3.In the Login procedure of the Main module, replace the two  lines  that  read  MessageBox.Show(“Incorrect     password.”) with the following code:
Throw New LoginException
4.Save your work and debug the application. What hap- pens now when you type in an incorrect password for a valid username?
5.Stop debugging the application. You’ll now add exception handling code.
6.Add a Try...Catch statement for the following line in the
btnLogin_Click event handler procedure: Main.Login(txtUsername.Text,            txtPassword.Text) Add the following line to the Catch block: MessageBox.Show(“Incorrect       password.”)
7.Save your work and debug the application. It should perform the same action as before.
8.Add a new public class to the project named
GroceryItem. See Assignment 1 for help.
9.The class should contain the following public properties:
ScanNumber. Represents the unique serial code for the item on the shelf. This property should be read- only.
BrandName. The name as described on the item’s packaging
Description. A short description of the item
Price. The amount of money it costs to buy the item.
Make sure that only positive values can be assigned to this property.
Aisle. This should indicate one of the following aisles: Bakery, Canned Good, Drinks, Deli, Dry Goods, Frozen Food, and Produce. See Assignment 2 on how to create enumerations.
10.The class should contain the following public constructors:
A constructor that accepts and sets only the ScanNumber property. Remember, if a property is read-only, then you’ll need to set the variable, not use the property name.
A constructor that accepts and sets the
ScanNumber, BrandName, and Price properties.
11.Add a new public class to the project named
GroceryBasket. See Assignment 2 for help.
a.Derive from the generic Dictionary class.
b.Ensure that only String values are used as keys.
c.Ensure that only GroceryItem objects are stored as values.
12.Test your work. You can add code to the btnLogin_Click event handler procedure to instantiate the GroceryItem class and add multiple objects to the GroceryBasket class. Make sure you either remove or comment out this code after testing.

SUBMISSION GUIDELINES
To submit your project, you must provide the following five files:

Main.vb
LoginForm.vb
LoginException.vb
GroceryItem.vb
GroceryBasket.vb

To find these files, you should go to directory where you saved the GroceryApp project. To determine this path, click on GroceryApp in the Solution Explorer panel. Copy the value for the Project Folder property in the Properties panel. In Windows Explorer, paste the file path and hit  the Enter key. Copy the Main.vb, LoginForm.vb, GroceryItem.vb, and GroceryBasket.vb files to your desk- top or any other temporary location.

Use the following procedure to submit your project online:

1.Log in to view your student homepage and go to the My Courses page.
2.Click on Take Exam next to the lesson you’re working on.
3.Attach your files as follows:
a.Click on the Browse box.
b.Locate the file you wish to attach.
c.Double-click on the file.
d.Click Upload File.
e.If you have more than one file to attach, repeat steps a–d for each file.
4.Enter your e-mail address in the box provided. (Note: Your e-mail address is required for online submissions.)
5.If you wish to include comments about this project to your instructor, enter your comments in the Message box.
6.Click on Submit Files.

Grading Criteria
Remember to follow directions and follow good OOP princi- ples as described in the study guide.
Your project will be graded using the following rubric:

The GroceryItem class is
defined correctly. 30 points
The GroceryBasket class
is defined correctly. 20 points
The Login button correctly
uses a Try...Catch statement. 10 points
All source code files are included.

40 points TOTAL 100 points

Preview Solution:
Penn Foster 037094 Invalid Password
Penn Foster 037094, Invalid Password
Grocery App, Object Oriented Programming, with Inheritance.
This tutorial was purchased 1 time and rated A+ by students like you.
Posted on Feb. 26, 2013 at 08:15:09AM
Price: $20
Special Price: $15
Email: syedjahangirb@gmail.com for downloading assignment
File in Solution:
GroceryApp.zip (79K)
[
GroceryApp/GroceryApp/bin/Debug/GroceryApp.exe
GroceryApp/GroceryApp/bin/Debug/GroceryApp.pdb
GroceryApp/GroceryApp/bin/Debug/GroceryApp.vshost.exe
GroceryApp/GroceryApp/bin/Debug/GroceryApp.vshost.exe.manifest
GroceryApp/GroceryApp/bin/Debug/GroceryApp.xml
GroceryApp/GroceryApp/GroceryApp.Designer.vb
GroceryApp/GroceryApp/GroceryApp.resx
GroceryApp/GroceryApp/GroceryApp.vb
GroceryApp/GroceryApp/GroceryApp.vbproj
GroceryApp/GroceryApp/GroceryApp.vbproj.user
GroceryApp/GroceryApp/GroceryBasket.vb
GroceryApp/GroceryApp/GroceryItem.vb
GroceryApp/GroceryApp/LoginException.vb
GroceryApp/GroceryApp/Main.vb
GroceryApp/GroceryApp/My Project/Application.Designer.vb
GroceryApp/GroceryApp/My Project/Application.myapp
GroceryApp/GroceryApp/My Project/AssemblyInfo.vb
GroceryApp/GroceryApp/My Project/Resources.Designer.vb
GroceryApp/GroceryApp/My Project/Resources.resx
GroceryApp/GroceryApp/My Project/Settings.Designer.vb
GroceryApp/GroceryApp/My Project/Settings.settings
GroceryApp/GroceryApp/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
GroceryApp/GroceryApp/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
GroceryApp/GroceryApp/obj/x86/Debug/GenerateResource.read.1.tlog
GroceryApp/GroceryApp/obj/x86/Debug/GenerateResource.write.1.tlog
GroceryApp/GroceryApp/obj/x86/Debug/GroceryApp.exe
GroceryApp/GroceryApp/obj/x86/Debug/GroceryApp.LoginForm.resources
GroceryApp/GroceryApp/obj/x86/Debug/GroceryApp.pdb
GroceryApp/GroceryApp/obj/x86/Debug/GroceryApp.Resources.resources
GroceryApp/GroceryApp/obj/x86/Debug/GroceryApp.vbproj.FileListAbsolute.txt
GroceryApp/GroceryApp/obj/x86/Debug/GroceryApp.vbproj.GenerateResource.Cache
GroceryApp/GroceryApp/obj/x86/Debug/GroceryApp.xml
GroceryApp/GroceryApp/obj/x86/Debug/TempPE/My Project.Resources.Designer.vb.dll
GroceryApp/GroceryApp.sln
GroceryApp/GroceryApp.suo
]

1 comment: