Discount CIS 170 CIS/170 CIS170 CIS170A CIS/170A All Weeks 1 2 3 4 5 6 7 - An Original And A++ Work - Using Visual Basic 2010 !!!
    CIS 170 CIS/170 CIS170 CIS170A CIS/170A All Weeks 1 2 3 4 5 6 7 - An Original And A++ Work - Using Visual Basic 2010 !!! CIS 170 CIS/170 CIS170 CIS170A CIS/170A All Weeks 1 2 3 4 5 6 7 - An Original And A++ Work - Using Visual Basic 2010 !!! CIS 170 CIS/170 CIS170 CIS170A CIS/170A All Weeks 1 2 3 4 5 6 7 - An Original And A++ Work - Using Visual Basic 2010 !!!

CIS 170 CIS/170 CIS170 CIS170A CIS/170A All Weeks 1 2 3 4 5 6 7 - An Original And A++ Work - Using Visual Basic 2010 !!!

$98.95
$131.93

Lab 2 of 7: Input and Output with Variables           

Lab Overview – Scenario / Summary:

TCO 2 - Given a set of program specifications for a simple business problem requiring the use of input and output, code and test a program that meets the specifications and employs best programming practices.

Part A:  Basic Input / Output

Step 1: Open a new project

Be sure to have gone over Part A several times before you begin your laboratory assignment.  In this part of the lab, you are asked to create a Visual Basic Windows Form application, without providing the specific instructions.

Create a new Windows Forms project in VB. Name your project CIS170A_Lab02_A

Step 2: Program Description

In this project, you will create a Windows Form application that will collect the user’s first name, last name, major, and date of graduation.  When the user selects “Display Information” a message box will be displayed that shows the input information and how many days remain before the user graduates from school. [Hint: Check section “Dates as Input and Output” (p. 87-88 in our textbook.)]

Step 3: Suggested form design

You are free to experiment with form design and object colors as you see fit, even though as to colors we strongly recommend using the default colors for the form and all objects – this allows each user to see your form in their chosen Windows color palette.

The suggested form design is as follows:

Here we show some sample data entered in the textboxes and a given date selected in the DateTimePicker.

Note that in the suggested design above we use a DateTimePicker object, which is a very handy way to obtain a date from the user. You have at least two ways to use the date selected by the user:

Use dtpGradDate.Value  within your code (that is, the Value property of the DateTimePicker object); or

Apply the Date.TryParse() method to the Text property of the DateTimePicker object: Date.TryParse(Me.dtpGradDate.Text, dtmGradDate)

To compute the number of days between dates, consider using the DateDiff() function. Doubts about this function?  Please post question in the Lab Q&A forum in class.

Once you validate all input data and compute your results, consider using a MessageBox.Show() method to display your final message, as follows:

Note that the display above is split into three lines and there are many ways to do this.  One of those ways requires inserting vbNewLine in the spot of the display string where you want the line to split. Doubts about this?  Please post questions in the Q&A discussion forum in class.

Step 4: Implement the Event Handlers

Consider using the following suggested TOE chart as guide in designing your program’s event handlers:

Task

Object

Event

Compute NumberOfDays between Today and GraduationDate

Set output string to FirstName & “ “ & LastName & “: Major = “ & Major & vbNewLine  & “Graduation date = “ & GraduationDate & vbNewLine & “Only “ & NumberOfDays & “ days away!!!”

Display output string

btnDisplay

Click

Clear all textboxes & date (today)

btnClear

Click

Close form [Hint: use “Me.close”]

btnExit

Click

Please note that beginning this Week 2 you are required to set Option Strict On for all your Labs. To do this, please include the following statement as the first executable statement in your program:

Option Strict On

In addition to this, and also beginning this Week 2 you are required to add profuse internal documentation to your program. Program internal documentation typically consists of:

Program Header:

Identification of the program

Identification of the programmer

Date written

List of modifications (including author and date)

Procedure Headers (for each module, event procedure, function, procedure, or segment of code):

Identification of the module

Overall logic (pseudocode)

Interface with the calling program (i.e., parameter list), if used

Calling procedure (event that causes its execution or statements necessary for invoking it), if used

Inline comments:

You should include comments within the code itself, for those elements that are a little obscure, or which you think require some explanation.

It is a good idea to write the internal documentation as you progress through the program’s development. Do not leave it all to the last minute or when the application is complete. If you do so, the documentation will most likely be written poorly or not at all. Please note that internal documentation is highly valued in your Labs -- don't leave home without it.

Step 5:  Deliverables

Zip up the top-level folder with your program (the complete set of project files) into a single file (please check Doc Sharing for details.)

Rename that .zip file as CIS170A_Lab02_A_LastName_FirstInitial.zip, or similar.

Place deliverables in the Dropbox.

END OF PART A

Part B:  Arithmetic Operations

Step 1:  Create a New Project

Open a new project in VB.NET. Name your project CIS170A_Lab02_B

Step 2: Program Description

In this project, you will create a program that will provide the user the option of calculating the area of a square, the area of a circle, or the volume of a sphere.  The program will accept a single input from the user (length of side or length of radius) and depending on the button clicked by the user, the program will compute either the area of a square with the length as a side; the area of a circle with that value as the radius; or the volume of a sphere with that value also as a radius.

The corresponding mathematical formulas are as follows:

Area Of Square = Length x Length (or also Length raised to the power of 2)

Area of Circle = Pi x Radius squared

Volume of Sphere = 4 / 3 x Pi x Radius raised to the power of 3

(where Pi = 3.1416)

Step 3: Suggested Form Design

You are free to experiment with form design and object colors as you see fit, even though as to colors we strongly recommend using the default colors for the form and all objects – this allows each user to see your form in their chosen Windows color palette.

 

The suggested form design is as follows:

Here we show some sample data entered in the textbox, and the result of the user having then clicked on the “Square” button.

Note that in this case we display the results in a big label located in the center of the form.  Please consider the following values for two of that label’s properties:

AutoSize = False

BorderStyle = Fixed3D

Step 4: Implement the Event Handlers

. Use the following as the design for your event handlers:

Task

Object

Event

Make sure that the textbox has a valid numeric value. [Hint: use the Double.TryParse() method.]

Assign the converted input value to dblInput

Compute AreaOfSquare

Display “The area of a square with side xxx is yyy”, where “xxx” is dblInput and “yyy” is AreaOfSquare.

btnSquare

Click

Make sure that the textbox has a valid numeric value. [Hint: use the Double.TryParse() method.]

Assign the converted input value to dblInput

Compute AreaOfCircle

Display “The area of a circle with radius xxx is yyy”, where “xxx” is dblInput and “yyy” is AreaOfCircle.

btnCircle

Click

Make sure that the textbox has a valid numeric value. [Hint: use the Double.TryParse() method.]

Assign the converted input value to dblInput

Compute VolumeOfSphere

Display “The volume of a sphere with radius xxx is yyy”, where “xxx” is dblInput and “yyy” is VolumeOfSphere.

btnSphere

Click

Clear textbox and output label.

btnClear

Click

Close form

btnExit

Click

Please be sure to convert the numeric values to the appropriate data type when displaying the results.

Step 5:  Deliverables

Zip up the top-level folder with your program (the complete set of project files) into a single file (please check Doc Sharing for details.)

Rename that .zip file as CIS170A_Lab02_B_LastName_FirstInitial.zip, or similar.

Place deliverables in the Dropbox.

END OF PART B

END OF LAB 2

Lab 3 of 7: Decisions                               

Lab Overview – Scenario / Summary:

TCOs:

1. Given a set of program specifications for a simple business problem requiring one or more decisions, code and test a program that meets the specifications and employs best programming practices.

2. Given a program with syntax and logic errors, employ the debugger and other diagnostic tools to remove or correct the errors.

This lab will familiarize students with If/Else/EndIf statements and possible Select Cast statements by calculating the amount of money a drive-in movie theater makes in a single night.

Lab Steps:

Step 1: Create a New Project

Create a new Windows Forms project in VB.NET. Name your project CIS170A_Lab03.

Step 2: Program Description

In this program you will create a Windows Form application that will calculate and display the money made by a drive-in movie theater each night. The movie theater has two types of nights. A “Regular” night is where each person in a guest car has to buy a ticket, and each ticket costs $10. A “Car” night is a special promotion where there is one price per car of $15, no matter how many guests are in the car.

In addition to the cost of entry (either Regular or Car), the theater sells popcorn and candy but the price of the items depends on the type of night.  On a Regular night popcorn costs $1.50 per box and on a special Car night popcorn costs $2.00 per box. On a Regular night candy cost $2.25 per candy box, while on a special Car night candy cost $3.00 per box.

On any night, the maximum number of cars allowed in is 500 and the maximum number of individual tickets is 3,000; the theater can produce 4,500 bags of popcorn each night and has 4,000 candy items.

Once the total revenue is calculated, the program will display a summary message with the type of night, the total number of cars, the total ticket sales, the total popcorn sales, the total candy sales, and the total sales amount.

Consider using the following pseudocode as a guide in developing the main processing algorithm of the program:

Initialize program and create variables

Accept and validate NumberOfCars

Accept and validate TypeOfNight

If TypefNight = “R” Or “r”:

a)     Accept and validate Tickets

Accept and validate Popcorn

Accept and validate Candy

If TypeOfNight = “R” or “r”:

a)     Compute TotalPopcorn = Popcorn*1.5

b)     Compute TotalCandy = Candy* 2.25

c)     Compute Total = Tickets*10 + TotalPopcorn + TotalCandy

If strTypeOfNight = “C” or “c”:

a)     Compute TotalPopcorn = Popcorn*2

b)     Compute TotalCandy = Candy*3

c)     Compute Total = NumberOfcars*15 + TotalPopcorn + TotalCandy

Display the final message (TypeOfNight; NumberOfCars; TotalPopcorn; TotalCandy; and Total.)

In all cases where validation fails, the program should terminate and return control to the user (i.e., exit the event handler immediately.)

 

Notice that this logic is a bit simple-minded and goes "straight through", without coming back to the beginning.  This is due to not yet having learned how to use the loop statements that will allow us to go back our logic to ask again for a value that was entered in error. (We cover that next week.)

Step 3: Suggested Form Design

You are free to experiment with form design and object colors as you see fit, even though as to colors we strongly recommend using the default colors for the form and all objects – this allows each user to see your form in their chosen Windows color palette.

The suggested form design is as follows:

Once the total sales are calculated, the program will display a summary message in a ListBox object with the following content:

type of night;

total number of cars;

total popcorn revenue;

total candy revenue; and

total revenue amount.

Step 4: Implement the Event Handlers

Consider using the following suggested TOE chart as guide in designing your program’s event handlers. As also noted in the pseudocode description above, the final calculation should NOT be completed unless all the input fields are validated as correct.

Task

Object

Event

Accept and validate NumberOfCars

Accept and validate TypeOfNight

If TypefNight = “R” Or “r”:

a)     Accept and validate Tickets

Accept and validate Popcorn

Accept and validate Candy

If TypeOfNight = “R” or “r”:

a)     Compute TotalPopcorn = Popcorn*1.5

b)     Compute TotalCandy = Candy* 2.25

c)     Compute Total = Tickets*10 + TotalPopcorn + TotalCandy

If strTypeOfNight = “C” or “c”:

a)     Compute TotalPopcorn = Popcorn*2

b)     Compute TotalCandy = Candy*3

c)     Compute Total = NumberOfcars*15 + TotalPopcorn + TotalCandy

Display the final message (TypeOfNight; NumberOfCars; TotalPopcorn; TotalCandy; and Total.)

 

btnCompute

Click

Clear all textboxes and listbox [Hint: use method Items.Clear()]

btnClear

Click

Close form.

btnExit

Click

[Hint: To comply with the desire to avoid computing the totals if we have some problem in validation, consider using the Exit Sub statement in suitable locations within your code.]

Programming notes:

 

To check if a textbox is empty, use the String.IsNullOrEmpty method, such as:

        If String.IsNullOrEmpty(txtName.Text) = True Then

To validate a numeric input (in the example below, intSeasons, an Integer value), consider the following suggested code:

        If Integer.TryParse(Me.txtSeasons.Text, intSeasons) = False Then

            MessageBox.Show("Seasons must be numeric", "Error", _

                            MessageBoxButtons.OK, MessageBoxIcon.Error)

            Me.txtSeasons.SelectAll()

            Me.txtSeasons.Focus()

            Exit Sub

        Else

            If intSeasons < 1 Or intSeasons > 20 Then

                MessageBox.Show("Seasons must be between 1 and 20", "Error", _

                                MessageBoxButtons.OK, MessageBoxIcon.Error)

                Me.txtSeasons.SelectAll()

                Me.txtSeasons.Focus()

                Exit Sub

            End If

        End If

Please remember to set Option Strict On and also to supply profuse internal documentation in your program.

Step 6: Deliverables

Zip up the top-level folder with your program (the complete set of project files) into a single file (please check Doc Sharing for details.)

Rename that .zip file as CIS170A_Lab03_LastName_FirstInitial.zip, or similar.

Place deliverables in the Dropbox.

END OF LAB

Lab 4 of 7:                                

Lab Overview – Scenario / Summary:

Create a program that will calculate and display the career statistics for a hockey player. The program will begin by allowing the user to enter the following information.

·         Name of the hockey player - The name must be a nonempty string.

·         Number of seasons played – The number must be at least one season and no more than 20 seasons.

Only after a valid season value is provided, processing of goals and assists can begin. The next step is to allow the user to provide additional information as follows.

·         Number of goals - A valid number of goals is between 0 and 60.

·         Number of assists - A valid number of assists is between 0 and 60.

The program will keep a running total of the following statistics.

·         Number of goals

·         Number of assists

·         Total points

A list of the each season’s data will be display after the season data are provided. Additionally, once all the season data are collected, the program shall list the summary information for the player and all the seasons.

Lab 5 of 7:  

Lab Overview – Scenario / Summary:

The following are the new requirements that the customer need to have.

The customer has decided that he or she wants to change the upper limits for goals, assists, and seasons. He or she wants the upper limit of the seasons to be 25, the upper limit for the goals is 70, and the upper limit for assists will be 75.

As with most programs that collect names of individuals, the full name shall be broken into two parts: the first name and the last name. Both the first and last name must contain nonempty-string values.

The customer wants to keep track of how old the player was when he or she started playing hockey, so the program shall provide a field to collect and validate the age of the player when he or she was a rookie. The starting age shall be at least 18 years old and no more than 30 years old, and the age shall be displayed as part of the summary output.

The user cannot begin to collect season data until after the first name, last name, seasons, and age are all provided and validated.

Consider using the following pseudocode as a guide in developing the main processing algorithms of the program:

Main program (button’s event handler, btnProcess_Click)

Initialize program and declare variables

If ValidateString(“First name”, Me.txtFirstName.Text, strFirstName) = False, return.

If ValidateString(“Last name”, Me.txtLastName.text, strLastName) = False, return.

If ValidateInteger(“Age”, Me.txtAge.Text, intAge, 18, 30) = False, return.

If ValidateInteger(“Seasons”, Me.txtSeasons.Text, intSeasons, 1, 25) = False, return.

Call ProduceOutput(strFirstName, strLastName, intAge, intSeasons)

ValidateString Function

Parameters: strText (ByVal), strInput (ByVal), strValue (ByRef)

Checks to see if strInput is empty

If it is, displays error message and returns False

If it’s OK, then

strValue = strInput

Returns True

ValidateInteger Function

Parameters: strText (ByVal), strInput (ByVal), intValue (ByRef), intLowValue (ByVal), intHighValue (ByVal)

Checks to see if strInput is empty

If it is, displays error message and returns False

If it’s OK, then

intValue = strInput (transformed into Integer)

Checks inValue is within acceptable range

If not, displays error message, returns False

If it’s OK, then Returns True

ProduceOutput Sub

Parameters: strFirst (ByVal), strLast (ByVal), intPlayerAge (ByVal), intNoSeasons (ByVal)

Initialize display in listbox

Loop from 1 to intNoSeasons

Accept Goals with InputBox() function --> strInput

If ValidateInteger(“Goals”, strInput, intGoals, 0, 70) = False, go back to 2.a

Accept Assists with InputBox() function --> strInput

If ValidateInteger(“Assists”, strInput, intAssists, 0, 75) = False, go back to 2.c

Accumulate intGoals and intAssists

Display season data in listbox

Finalize display of data in listbox

Note that we use Functions and Subs in the logic above, and also note that although most parameters are passed By Value, we have a couple passed By Reference.  As long as you comply with the new user requirements described above and you use good modularization of the program, you can use any modularization technique desired. However, please keep in mind that “good” modularization for this particular Lab means:

Using Function modules;

Using Sub modules; and

Using ByVal and ByRef parameters

Lab 6 of 7:  

Lab Overview – Scenario / Summary:

Create a program, using an array, which keeps a list of the rent rates for an apartment building. The rent rate for an apartment depends on which floor the apartment is located on and every apartment on the same floor has the same rent rate. The program shall read the name of the apartment building, how many floors the apartment building has, and get the rental rates for each of the floors. Once the rental rates are provided, the program shall list the rates. The program user shall be able to provide a floor number and the program will display the apartment building name, the total number of floors, the requested floor, and how much the rent is for the given floor.

The customer has several apartment buildings to choose from. The smallest apartment building has three floors and the largest apartment building has 20 floors. The program shall validate that the floor number is between the minimum and maximum floor values. Also, the minimum rental rate for any building is $1,000 per month, while the highest rent is $2,500. The program shall validate that the provided rental rates are within the minimum and maximum rates.

Design Requirements:

 

In Week 7, we will expand on this program and in order to easily modify it, your program will incorporate the following design features:
 

1.      The design will be modular and the event handlers shall not contain any processing logic, but only invoke reusable modules.

2.      All minimum and maximum values shall be declared as constants.

3.      The user shall not be able to input the floor he or she wants to search for until after the apartment building name, the number of floors in the building, and the rent values for each of the floors in the building have been entered and validated.

4.      Declare rentlist, numFloors, and requestedFloor as form level variables. All other variables should be declared locally as required.

Lab 7 of 7:  

Lab Overview – Scenario / Summary:

 

The following are the new requirements that need to be added to the Week 5 Hockey Player Statistics Program:

The user shall be able to input information for multiple players. After each player and the number of seasons information is input, the program shall write the summary information for the player to a file called “PlayerStats.txt”. Any previous information that is saved in the file shall be preserved and not lost.
Once a player’s summary information has been written to the file, the program shall automatically clear all the input fields and output information for the player and be ready to accept data about another player.
Create a second form titled “Player Summary” that shall have operations to open the “PlayerStats.txt” file and display all the summary records for all the saved players.
The Player Summary form shall have an operation to clear the contents of the “PlayerStats.txt” file.
Exception handling for file operations shall be included to prevent the program from crashing when the files are opened or read.
The main form (frmHockeyStats) shall contain a menu that will have two menu items: “File” and “Tools”. 
Under the “File” menu, there shall be menu items to “Clear” the fields and “Exit” the application.
Under the “Tools” menu, there shall be menu items to “Get Player Statistics” and “Summary Data” that opens the summary information forms.
Each control (except labels) will have a Tooltip with a short, user-friendly description of what the control provides.

Here is compelete solution for CIS 170A course

My solution contain Visual Basic projects - Documents and Detailed comments.

Please using Visual Studio 2010 to open this project.

If you have more question or need help, please contact me via email support@extutorials.com. I will help you any time.

Thank you

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B