CSC450 Visual Basic DATE 2/19/2014

CODING ASSIGNMENT #2 Variable Name and Report Formatting

Name______

Problem: Scoop de Jour Ice Cream Shoppe

Check List

Create Task List and define flowchart symbols
Draw flowchart and add pseudocode
Draw the user interface, place the names on the form-use the names in the problem
Fill out object property sheet
Code problem
Print code
Comments: Be sure to add as many as you think will make the code easy to update
Program Disk

The Scoop de Jour Ice Cream Shoppe would like you to write a program that will calculate and print the quantities of ice cream, sauce, nuts and cones that they use on any given day for inventory purposes. They would also like a short cash flow analysis of the day's transactions.

The ingredients required to make each of the three items they sell and pricing information for each item is shown in the following table:

Item: / Cones: / Shakes: / Sundaes:
Ice Cream (oz.) / 6 / 10 / 8
Sauce (oz.) / 1 / 2
Nuts (oz.) / 1
Cones / 1
Cost / $0.65 / $0.95 / $1.25
Sale Price / $0.95 / $1.35 / $1.75

The purpose of this programming assignment is to:

·  give you experience with variables and constants

·  let you practice the elements of good coding style, including commenting, proper indentation, and descriptive variable naming.

·  give you some experience numeric calculations

·  give you experience outputting to an object (textbox)

Write a program that uses a windows form, the INPUT will be displayed on the top of the form and the OUTPUT will occupy the bottom of the form. The input gets the quantity of each of the three items that were sold on a given day and should be similar to this:

·  The form should be centered on the screen when it loads.

·  Accept the default name form1, but give the form a meaningful title of Scoop de Jour Ice Cream Shoppe.

·  Place the following objects on your form:

Four Labels:

lblScoopsSold, lblShakesSold, lblSundaesSold, lblProgrammer

Change the properties name, text, autosize and font. Make your form appear pleasing to the user.

Three Textboxes: (for input)

txtScoopsSold, txtShakesSold, txtSundaesSold

Change the name, and text properties

One Textbox: (for the report)

txtReport

Change the properties name, multiline, and scrollbars; size the box to hold your report

Data:

Assume they sold 96 cones, 94 shakes and 104 sundaes to check your calculations. Using the pricing information in the above table, declare Constants to hold the price of cones, shakes, and sundaes. Declare constants for the cost of cones, shakes and sundaes.

Declare modular level variables to use in your calculation for the inventory report that will look something like this:

Your grade will reflect the effort taken to make your report look professional. Use headers if needed to explain the content of the report box. Use the input data to prepare the financial report.

Notes: There are 32 fluid ounces per quart for the ice cream and sauce and 16 ounces per pound for the nuts.

Create formulas for your calculation, do the calculations before you write to the textbox and store the values in variables. Use the following line of code to as an example of what to do to insert your data into the textbox

Create a: fmtString varaible

Dim fmtString as String = “{0, 30} {1, 10} {2, 10} {3, 10}”

txtReport.Text += String.Format(fmtString, "Cones Sold", txtConesSold.Text, txtConesSold.Text, sngConesTotal)) & vbNewLine

The vbNewline creates a new line in your textbox. Remember you must use all landing zones even if there is no data for that zone on that particular line.

Example for the Cones Profit line there are only two pieces of data so the line would look like this:

txtReport.Text += String.Format(fmtString, “”, “”, “Cones Profit”, sngConesProfit)) & vbNewLine

Landing zones in the format string that are not used must have empty quote symbols in them

You may want to use the formatting functions so that your output will appear as currency. (This is optional for this assignment.)

Scoring:

This assignment is worth 25 points.

10 points for all planning documents

5 points for coding style and proper use of variables, constants and object names

10 points for correct execution of all calculations, and formatted displays.