SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 3 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 13 Dec 2017 My Price 10.00

S14 Software Development Lab 5/ (25points)ALTERNATE LAB

Need help with this visual basics thanks! If you don't understand then lmk quickly thanks!!!!!!!!!!!

IVY TECH COMMUNITY COLLEGE

SDEV 140 / Introduction to Software Development

S14 Software Development Lab 5/ (25points)ALTERNATE LAB

 

Student’s name ______________________  Section _______  Instructor’s name _________________

 

INTRODUCTION: In this assignment, you will create the logic for the new Customer Information Form, and then code your Visual Basic project to create the new form and integrate it with the Order Input form, so that the customer information is transferred from the Customer Form to the Order Input Form.

 

There are two parts to the assignment. In Part 1, you create the logic for the enhanced project using the Algorithm Development Discussion. In Part 2, you add and modify code to your project using the DroneDogs Project Guidelines to create the new customer form and integrate it with the order form.

 

 

PRELIMINARY: Read these sections from Chapter 5 in the Visual Basic textbook on Books 24x7: Structures, and Working with ArrayLists. Create and/or run the programStructure Demo.

 

 


ASSIGNMENT PART 1:

 

Read the Algorithm Development Discussion below and answer the questions in the spaces provided.

 

ALGORITHM DEVELOPMENT DISCUSSION:In Session 13, you read the Project Enhancement Request. This discussion will determine the programming changes needed to satisfy the request. Because many of these concepts are new, this will be a guided discussion. The answers to the questions are available in the textbook.

 

1)      The project requires you to record the first name, last name and email address of existing and new customers. The first assigned section of Chapter 5 in the textbook describes a construct for storing related pieces of information, and that construct is called a: [type your answer here]

2)      The customers that are pre-loaded, as well as the customers that are added by the user, need to be stored in a data structure whose size is flexible and where new items can be easily added. The second assigned section of Chapter 5 in the textbook describes such a data structure, called an: [type your answer here]

3)      You will need to create a new form to display, enter and select customer information. This form should have the same DroneDogs heading and logo as the order form. You have already assigned names to the form components in the S13 Customer Form, including the ListBox, which will hold the information for pre-loaded customers and new customers added by the user.

4)      You will also need to put the new labels and text boxes for the customer information into the order form, so you can transfer the selected customer information from the customer form. Also, in the order form:

a.       You will need to add a Clear Form button that will clear out all text boxes when clicked.

b.      You will need to add a CheckBox that the user checks to give DroneDogs permission to use location services to find the location of the user for delivering the order. The check box will be examined when the user clicks the Submit Order button.

c.       The Submit Order button will need to be revised to check for three things: the permission check box is checked, there has been at least one item ordered, and customer information has been entered. If all these things are OK, then the message thanking the user can be displayed.

 


ASSIGNMENT PART 2:

 

1)      Use the DroneDogs Project Guidelines below, and your textbook, to create a Customer Information Form that allows a user to add and select customers, and transfer the customer information back to the order form.

2)      Test the program to make sure it produces correct output. Create and paste screen shots where instructed.

3)      Exit Visual Studio.

 

DRONEDOGS PROJECT GUIDELINES:

 

1)      Open the DroneDogs solution file. In Visual Basic, click File / Recent Projects and Solutions, and select the DroneDogs.sln solution file.

2)      Bring up the Solution Explorer window. There may be a tab for it already visible near the Properties window, or you may need to click View / Solution Explorer.

3)      You should create a structure for each customer. Structures are very similar to classes. In Solution Explorer, right click on the project name DroneDogs, and select Add / Class. Name the class Customer.vb, click Add, and in the code window, delete all the lines that are there, and create a structure by entering the following code, which defines a structure and provides a nicely formatted display for the list box.

 

PublicStructureCustomer

'Public members

PublicFirstNameAsString

PublicLastNameAsString

Public Email AsString

 

'Formats the display

PublicOverridesFunctionToString() AsString

ReturnFirstName&" "&LastName&" ("& Email &")"

EndFunction

 

EndStructure

 

4)      Click Save All. Now you need to create the customer form. Right-click the project name DroneDogs in the Solution Explorer, and select Add / Windows Form. Change the File Name of the form CustomerForm.vb, and click Add. Change the Text property of the form to your name. Use the form and control names from the S13 Lab to create the Customer Information form. Remember that the big box under the label for the heading is a ListBox control.

a.       Put labels, text boxes, buttons and a picture box onto the form in the appropriate locations. Change the Name property of each control to the name you gave it in the S13 Lab, and change the Text property of the labels and buttons.

b.      For the picture box, specify the Image as DroneDogs.png by browsing to the location where you downloaded it to and importing the file into the project.

c.       Click View / Code. We are going to use an ArrayList to keep track of all the customers in the program. Just under the top line of the code (Public Class CustomerForm), enter the comment 'Form level member, and on the next line, declare a new ArrayList member with this statement: Private objCustomers as New ArrayList

5)      Go back to the DroneDogsOrder form (in Design view), enlarge the size of the form, and add the new buttons, labels, text boxes and a check box from the S13 Lab.

a.       To code the Get Customer Info button, double-click it, enter a comment, and type this statement: CustomerForm.Show()

b.      Go to Design view, and code the Clear Form button by double-clicking it, which takes you back to Code view. Enter a comment, then set the Text property of each of the nine text boxes to an empty string. Depending on what you named the text boxes, the first statement might be:
txtBeefDogs.Text = ""

c.       In Design view, change the Read-Only property of the customer text boxes on the original Order Input form to True (these will be filled in from the Customer Information form, not the user).

d.      To modify the code for the Submit Order button, double-click it, and in Code view, use a series of IF statements to test whether: the permission check box has been checked, there is something in the total cost text box, and there is something in the customer email text box. Your code, after you enter your comments, should look similar to this:

IfchkPermission.Checked = FalseThen

MessageBox.Show("ERROR...You must check the location permission check box.")

ElseIftxtTotalCost.Text = ""Then

MessageBox.Show("ERROR...You must order at least one item.")

ElseIftxtEmail.Text = ""Then

MessageBox.Show("ERROR...Please get customer information for this order.")

Else

MessageBox.Show("Thank you for ordering from DroneDogs!")

EndIf

 

6)      Now, go back to the new CustomerForm in Design view. To code the Add New Customer button, double-click it, and the code header will appear in the code window.

a.       Enter a comment that you will be getting the new customer information from the text boxes.

b.      You need to declare string variables for the customer’s first name, last name, and email, and initialize them to the Text values in the text boxes. Use Dim statements to declare the three string variables, and use the Text properties of the corresponding text boxes to initialize each one. Depending on what you named your variables and text boxes, your first statement might be:
DimstrFirstName = txtFirstName.Text

c.       Next, you need to create a new Customer record from the information. The easiest way is to call a procedure named CreateCustomer, sending it the three string variables as arguments.(We’ll define that procedure shortly.) To call a procedure, just enter a comment, then type the procedure name, and the arguments in parentheses. Depending on what you named your variables this might be like:
CreateCustomer(strFirstName, strLastName, strEmail)

7)      Now, to define that new procedure, stay in the Code View window, but click the cursor UNDER the End Sub line for the Add Customer procedure you just finished. You will need to declare a new Customer object, assign the customer variables to its members, add the new customer to the ArrayList, and also display it in the ListBox on the form. The code is given to you here, but make sure that all names match the names you assigned (like the name of the ListBox. You will have to type or paste this code:

 

PublicSubCreateCustomer(firstNameAsString, lastNameAsString, email AsString)

'Declare a customer object

DimobjNewCustomerAsCustomer

 

'Create the new customer

objNewCustomer.FirstName = firstName

objNewCustomer.LastName = lastName

objNewCustomer.Email = email

 

'Add the new customer to the list

objCustomers.Add(objNewCustomer)

 

'Add the new customer to the ListBox control

lstCustomers.Items.Add(objNewCustomer)

EndSub

 

8)      We’re getting closer! To make things easier, we are going to pre-load three customers into the Customer Form when it is first loaded. Go back to Design view for the CustomerForm, and double-click in an open area of the form. You should go into code view for the form and into a procedure called CustomerForm_Load. Enter a comment that you are pre-loading three customers to the form, and type in these three statements, between the procedure heading and the End Sub line:

CreateCustomer("Darrel", "Hilton", "dhilton@somecompany.com")

CreateCustomer("Fran", "Peoples", "fpeoples@thisorg.org")

CreateCustomer("Bill", "Scott", "bscott@ourtown.gov")

9)      When the user highlights a customer from the ListBox, the index of that customer is stored in a variable called SelectedIndex. (If no customer is selected, the variable is set to -1.) We are going to need to provide for a way to capture the information from the highlighted customer. We can do that by creating a property. (You can read about properties for items in an ArrayList in the textbook.) As long as a customer is selected, we can convert the information in the ListBox into a Customer structure. Stay in code view, and underneath the End Sub line for the form load procedure, type this code:

PublicReadOnlyPropertySelectedCustomer() AsCustomer

Get

IflstCustomers.SelectedIndex<> -1 Then

'Return this customer

ReturnCType(objCustomers(lstCustomers.SelectedIndex), Customer)

EndIf

EndGet

EndProperty

 

10)  When the user wants to select that customer by clicking the Select Highlighted Customerbutton, the selected customer information can be used to fill the text boxes back in the order form. Go back to Design view for the form, and double-click the Select Highlighted Customer button. You should go back into code view and into a procedure called btnSelectCustomer_Click (depending on the name of your button). Enter this code, which will show an error message if no customer was selected, and fill in the blanks on the order form if there is a selected customer. Make sure this code goes between the procedure heading and the End Sub line:

'If no customer is selected, then error and exit

IflstCustomers.SelectedIndex = -1 Then

'Display error message and exit

MessageBox.Show("ERROR...no customer selected.")

Exit Sub

EndIf

 

'Get customer info and display it in the order form

DimobjCustomerSelectedAsCustomer = SelectedCustomer

DroneDogsOrder.txtFirstName.Text = objCustomerSelected.FirstName

DroneDogsOrder.txtLastName.Text = objCustomerSelected.LastName

DroneDogsOrder.txtEmail.Text = objCustomerSelected.Email

11)  You are finally ready to compile and run this program. If you have errors, read the error messages closely. You can double-click on the error message, and you will be taken to the line of code that caused the error. When the program compiles successfully, click Debug, and Start Without Debugging to run the program.

a.       Enter these numbers to order: 4 beef dogs, 5 pork dogs, and 6 turkey dogs, then click Calculate Order, and the program will correctly compute the subtotal, the amount of sales tax, and the total cost of the order.

b.      Next, click the Get Customer Info button. That should bring up the new Customer Information form. Click on one of the three existing customers, and clickSelect Highlighted Customer. That should put the name and email of the selected customer back into the first form.

c.       Now, enter YOUR name and email address as a new customer. Click Add New Customer to put that customer into the ListBox. Then, click on the new customer in the ListBox and click Select Highlighted Customer as before, and the new customer information should be placed back into the first form.

12)  There is a document in Session 14, VBProject2_SampleCode.docx, which shows some sample working program code. Use this to help debug your own program, but do not copy it directly into your code, because the names for the components, constants and variables may be different than what you are using from the S13 Lab. Also, you must include comments in your code, which are not present in the sample code. This is just a guide.

13)  Click the permission check box and click Submit Order. If the customer information was transferred correctly and you checked the permission check box, you should get a message box thanking you for placing your order. If you get an error message, you will need to find your error, save the program, rebuild it, and run it again.

14)  Note: You don’t have to close the customer form after each order, and in fact, you shouldn’t, because each time you reopen it, any new customers that you added will not reappear. (The customers are pre-loaded each time the form is opened.)

15)  When the program works correctly, quit the program by clicking the Exit button.

16)  Close Visual Basic, use Windows Explorer to find the top level folder of the project (DroneDogs), right-click the folder, and select Send To / Compressed ZIP Folder to zip the file. Submit the ZIP file along with this document for grading.

 

 

 

 

 

 

 

WHAT TO SUBMIT:

o Part 1: This document (S14_SDEV_Lab5.docx), withthe Algorithm Discussion questions filled in(5 pts), and:

o Part 2: The file (DrongDogs.zip), containing the complete DroneDogs project in Visual Basic(20pts)

 

 

INSTRUCTOR GRADING RUBRIC:

 

ITEM

POSSIBLE POINTS

ACTUAL POINTS

Algorithm Development Discussion questions answered

5

 

DroneDogs Order Form and Customer Form program:

 

 

Customer form has all controls present, totals in order form correct

5

 

Highlighted existing customer name and email appears in order form text boxes

5

 

   Highlighted student customer name and email appears in order form text boxes

10

 

TOTAL POINTS:

25

0

 

 

Attachments:

Answers

(5)
Status NEW Posted 13 Dec 2017 09:12 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)