Rental Total
Displays The DvD and Bluray
Subtotal
Is the total of the Rental Amount with the New Release but without the discount
Discount displays the %10
Amt Due is everything including the discount
I did some of the calculations
But the problem is I can't call the arguments with the Method and the compiler returns this error:
No overload for method 'Calculate' takes '4' arguments
Any Advice on how I could fix this Calculate method would be greatly appreciated.
//
//Matt Iwan
//CSC-236001
// Movie Rental Program 2
// Add A Store Summary and Rental Summary to calculate the
// Amount Due Tax, After Discount Income and # of Customers Served
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MattIwanRentalStore
{
public partial class FrmMovieRental3 : Form
{
public FrmMovieRental3()
{
InitializeComponent();
}
//Constants
const double CDISCOUNT = .10d;
const double CMOVDVD = 4.50;
const double CMOVBD = 5.00d;
const double CNEWRELEASE = 1.00d;
//Variables
int vCustServd = 0;
double vAmtDue;
double vStoreIncome;
double vRentalTotal;
int vMovieQuant = 0;
double vDiscount;
//Project3 Variables
double vSubTotal;
bool BDMovietype = true;
bool Member = true;
bool NewRelease = true;
bool DVDMovietype = true;
private void btnSubmit_Click(object sender, EventArgs e)
{
if (txtSearch.Text == string.Empty)
{
MessageBox.Show("You need to enter a movie title", "Missing Characters");
}
else
{
vMovieQuant += 1;
lblMovieQuant.Text = vMovieQuant.ToString();
MessageBox.Show("Request Accepted");
txtSearch.Text = string.Empty;
}
}
private void btnAbout_Click(object sender, EventArgs e)
{
MessageBox.Show("Matt Iwan CSC 236-001 Movie Rental Project");
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
int vcount = 0;
private void counter(int vcount)
{
vcount += 1;
if (vcount == 5)
{
MessageBox.Show("Congrats you are Customer # 5!");
}
if (vcount == 25)
{
MessageBox.Show("Your'e customer # 25!");
}
}
private void btnCalculate_Click(object sender, EventArgs e)
{
Calculate(rbDVD.Checked, rbBluRay.Checked, cbIsMember.Checked, cbNewRelease.Checked);
}
private void Calculate(double CMOVDVD,
double CDISCOUNT,
double CMOVBD,
double CNEWRELEASE)
{
if (rbDVD.Checked == true)
vRentalTotal = CMOVDVD;
else if (rbBluRay.Checked == true)
vRentalTotal = CMOVBD;
if (cbIsMember.Checked == true)
vAmtDue = vRentalTotal * .10;
double vSubTotal = vRentalTotal + CNEWRELEASE;
double vTotal = vAmtDue - vDiscount;
//Display the rental fee.
lblDiscount.Text = vAmtDue.ToString();
lblSubTotal.Text = vSubTotal.ToString();
lblTotal.Text = vTotal.ToString();
//Display the order.
lblRentalAmt.Text = vRentalTotal.ToString();
// lblTotal.Text = vRentalTotal.ToString("C");
}
private void StoreIncome(double vStoreIncome)
{
vStoreIncome = vRentalTotal;
lblStoreIncome.Text = vStoreIncome.ToString("C");
}
private void btnSumClear_Click(object sender, EventArgs e)
{
lblMovieQuant.Text = null;
lblDiscount.Text = null;
lblRentalAmt.Text = null;
lblTotal.Text = null;
lblStoreIncome.Text = null;
lblTotCust.Text = null;
lblSubTotal.Text = null;
}
private void btnOrdCom_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Confirm", "Confirm") == DialogResult.OK)
{
}
//If btnOrdCom is clicked then cbIsMember enabled and unchecked
if (cbIsMember.Enabled == false)
{
cbIsMember.Enabled = true;
cbIsMember.Checked = false;
lblMovieQuant.Text = null;
lblDiscount.Text = null;
lblRentalAmt.Text = null;
lblTotal.Text = null;
lblStoreIncome.Text = null;
lblTotCust.Text = null;
lblSubTotal.Text = null;
txtSearch.Text = string.Empty;
cbNewRelease.Checked = false;
rbDVD.Checked = false;
rbBluRay.Checked = false;
}
}
private void BtnClrNxt_Click(object sender, EventArgs e)
{
txtSearch.Text = string.Empty;
cbNewRelease.Checked = false;
rbDVD.Checked = false;
rbBluRay.Checked = false;
}
}
}

New Topic/Question
Reply




MultiQuote




|