CIS 115 – Programming Project 1 – Chapter 3 ***Warning – output on sample form below does not show the correct totals or correct invoice number ***See correct output example on last page to check your...

1 answer below »
CIS 115 – Programming Project 1 – Chapter 3 ***Warning – output on sample form below does not show the correct totals or correct invoice number ***See correct output example on last page to check your program Write a program that will take orders for upcoming football game tickets and will let the user know the total cost of their order. The fan is to be prompted (using textboxes) to enter their name (in lastName,(space)firstName format), number of sideline tickets, and number of end zone tickets. Both number of ticket textboxes should contain 0 initially. Your program should display (using a listbox) the name (in firstName(space)lastName format), invoice number, sideline ticket subtotal, endzone ticket subtotal, and total order cost. The subtotals and total should formatted to currency. Tickets prices are set as follows: - Sideline tickets - $25 - End Zone tickets - $15 In addition to the above ticket cost, the fan has to pay a $1.00 service charge per ticket. For each order (each time Calculate Cost is clicked), an invoice number needs to be generated. The format of this number is: - First two letters of the first name (Upper Case) - First two letters of the last name (Upper Case) - Hyphen (dash/minus) “-“ - Current order number o (Note: Order number should be set as a class variable. The initial value should be 1000. After successfully processing an order, the order number should be incremented by 1.) - Hyphen (dash/minus) “-“ - Total number of tickets Your program should have three button events. These should perform the following tasks: - Calculate Cost (perform the calculations and display the output). - Clear Form (clear the name, reset tickets to 0, clear the listbox, and set the focus to the first textbox). - Exit (end the program). Steps required for planning and completing Programming Project 1: 1. Analyze: Make sure you understand the problem and ask questions if you don’t. a. Identify Inputs, Outputs, and Processes b. The analysis can be typed in Word. Name the file PP1_.docx 2. Design: a. Generate the pseudocode for the program. b. You should type the pseudocode in a Word document (use the same file as analysis) 3. Design the interface: a. Name the project PP1_ b. Create the controls on the form c. Set the properties for a nice interface (see given sample form – problem statement page) d. Give each control as well as the form meaningful names using proper prefixes. e. Tab order should be set from top to down for fields that need to have focus. f. Name textbox should have appropriate mask. g. Textboxes for Sideline and End Zone tickets should have an initial value of zero (0). h. Make sure the form ‘looks good’; all controls are lined up. i. The text properties should have appropriate values when needed. 4. Code: a. Following your pseudocode, translate into VB code. b. Use camel casing and meaningful names for all variables. c. Select appropriate data types as needed. d. Before you submit your program, you must remove any empty stubs and unused variables. e. Make the spacing consistent. Blank lines can be used within the code to make it more readable, but don’t leave gaps in the program where you inserted too many blank lines accidentally. f. The program should include a general comment section just after the Public Class statement. Include: i. Programmed by: Your full name ii. CIS 115 and your section number and class time iii. Programming Project 1 g. Comments (again) – Each event procedure should begin with a comment just after the header that states the purpose of that event. h. Other comments may be included if you feel they are needed. 5. Test and Debug: a. Find and correct syntax, execution, and logic errors. b. Test your program with a variety of input to be sure it works properly. 6. Complete the documentation: Your Word doc file from above that contains: a. A cover page – consisting of your name, JagID, class and section, current (submitted on) date and assignment title. b. Problem analysis c. Psuedocode d. A copy of the code listing e. Screen shots of your programs executing You need to submit the following files as attachments to the Program 1 Assignment in SAKAI: Your Word doc file from above that contains:  A cover page –your name, JagID, class and section, current (submitted on) date and assignment title.  Problem analysis  Pseudocode  A copy of the code listing  Screen shots of your programs executing Your compressed(zipped) VB Project folder containing your VB program: To compress the folder - right-click the project folder, then select send to compressed folder. This will create a compressed copy of the project folder that you can attach to the assignment. Correct Output Example Sample 1st run: Input: Name: Smith, John Sideline #: 2 End Zone #: 2 Output: Customer Name: John Smith Invoice Number: JOSM-1000-4 Sideline Tickets: $50.00 End Zone Tickets: $30.00 Total Cost: $84.00 Sample 2nd run: Input: Name: West, Sally Sideline #: 10 End Zone #: 0 Output: Customer Name: Sally West Invoice Number: SAWE-1001-10 Sideline Tickets: $250.00 End Zone Tickets: $0.00 Total Cost: $260.00 *note: the first order number is 1000 and increases by 1 for each successful order. Order number should not increase until order is calculated and output to the user
Answered Same DayFeb 23, 2021

Answer To: CIS 115 – Programming Project 1 – Chapter 3 ***Warning – output on sample form below does not show...

Aditya answered on Feb 24 2021
130 Votes
SeatingCostCalculator/.vs/SeatingCostCalculator/v16/.suo
SeatingCostCalculator/App.config




SeatingCostCalculator/bin/Debug/SeatingCostCalculator.exe
SeatingCostCalculator/bin/Debug/SeatingCostCalculator.exe.config




SeatingCostCalculator/bin/Debug/SeatingCostCalculator.pdb
SeatingCostCalculator/Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SeatingCostCalculator
{
public partial class Form1 : Form
{
int ticketNumber = 1000; // this is the ticket number initial
value 1000
public Form1()
{
InitializeComponent();
}
//This function is d when exit button is clicked
private void exit_Click(object sender, EventArgs e)
{
Close();
}
// this funtion is called when clear form button is clicked
private void clear_Click(object sender, EventArgs e)
{
// resetting all the text value to initial values
customerNameTextBox.ResetText();
sideLineTextBox.Text = "0";
endZoneTicketTextBox.Text = "0";
invoiceListBox.Items.Clear();
customerNameTextBox.Focus();
}
// this function is called when a calculate cost is clicked
private void calculate_Click(object sender, EventArgs e)
{
if (customerNameTextBox.Text == string.Empty) // if customer name is empty
{
MessageBox.Show("Please enter customer name");
}
else if (!stringToInt(sideLineTextBox.Text))// if int values in entered in sideline tickets
{
MessageBox.Show("Please enter integer values in side line tickets");
}
else if (!stringToInt(endZoneTicketTextBox.Text))
{
MessageBox.Show("Please enter integer values in end line tickets");
}
else
{
string []arr = customerNameTextBox.Text.Split(',');
int sideLineTickets = Int32.Parse(sideLineTextBox.Text);
int endZoneTickets = Int32.Parse(endZoneTicketTextBox.Text);
if (arr.Length != 2)
{
MessageBox.Show("Please enter both last name and first name");
}
else
{
if (sideLineTickets < 0) // if negative value is entered for side zone ticket
{
MessageBox.Show("Number of tickes for side line should be positive");
}
else if (endZoneTickets < 0) // if negative value is enterd for end zone tickets
{
MessageBox.Show("Number of tickets for end zone tickets should be positive");
}
else
{
// calulating and printing invoice
string firstName = arr[1].Trim();
string lastName = arr[0];
int totalTickets = sideLineTickets + endZoneTickets;
string invoiceNumber = firstName.Substring(0, 2).ToUpper() + lastName.Substring(0, 2).ToUpper() + "-" + ticketNumber + "-" + totalTickets;
float sidelineTicketCost = sideLineTickets * 25;
float endlineTicketCost = endZoneTickets * 15;
float totalTicketCost = sidelineTicketCost + endlineTicketCost + totalTickets;
string invoice = "Customer Name:\t" + firstName + " " + lastName;
invoiceListBox.Items.Add(invoice);
invoice = "Invoice Number:\t" + invoiceNumber;
invoiceListBox.Items.Add(invoice);
invoiceListBox.Items.Add("");
invoice ="Sideline Tickets:\t$" + sidelineTicketCost;
invoiceListBox.Items.Add(invoice);
invoice = "End Zone Tickets:\t$" + endlineTicketCost;
invoiceListBox.Items.Add(invoice);
invoiceListBox.Items.Add("");
invoice = "Ticket Cost:\t$"+totalTicketCost;
invoiceListBox.Items.Add(invoice);
ticketNumber++;
}
}
}
}
// this functiopn checks wheather string can be converted to int or not
private bool stringToInt(string text)
{
int number;
bool check = Int32.TryParse(text, out number);
return check;
}
}
}
SeatingCostCalculator/Form1.Designer.cs
namespace SeatingCostCalculator
{
partial class Form1
{
///
/// Required designer variable.
///

private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
///

/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.customerNameTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.endZoneTicketTextBox = new System.Windows.Forms.TextBox();
this.calculate = new System.Windows.Forms.Button();
this.clear = new System.Windows.Forms.Button();
this.exit = new System.Windows.Forms.Button();
this.invoiceListBox = new System.Windows.Forms.ListBox();
this.sideLineTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(70, 78);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(203, 17);
this.label1.TabIndex = 0;
this.label1.Text = "Customer\'s Name (Last, First): ";
//
// customerNameTextBox
//
this.customerNameTextBox.Location = new System.Drawing.Point(302, 75);
this.customerNameTextBox.Name = "customerNameTextBox";
this.customerNameTextBox.Size = new System.Drawing.Size(246, 22);
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here