0

// プログラムを実行すると、拡張価格、15% 割引、および割引価格が表示されますが、残りは空のままで、「メソッドまたは操作が実装されていません」というエラー メッセージが表示されます... 何が間違っていますか?

Public Class bookSalesForm
    'Dimension Constants
    Const DISCOUNT_RATE_Decimal As Decimal = 0.15D


    'Dimension Modular Variables
    Private Quantitysuminteger, SaleCountInteger As Integer
    Private DiscountSumDecimal, DiscountedPriceSumDecimal As Decimal





    Private Sub printButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles printButton.Click
        PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
        PrintForm1.Print()
    End Sub

    Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click
        'Dimension Local Variables
        Dim QuantityInteger As Integer
        Dim PriceDecimal, ExtendedPriceDecimal, DiscountDecimal, DiscountedPriceDecimal, AverageDiscountDecimal As Decimal




        Try
            'convert quantity to numeric
            QuantityInteger = Integer.Parse(QuantityTextBox.text)


            Try
                'convert price to numeric
                PriceDecimal = Decimal.Parse(priceTextBox.Text)



                'calculate values for single sale
                ExtendedPriceDecimal = QuantityInteger * PriceDecimal
                DiscountDecimal = Decimal.Round(
                    (ExtendedPriceDecimal * DISCOUNT_RATE_Decimal), 2)
                DiscountedPriceDecimal = ExtendedPriceDecimal - DiscountDecimal


                'display formatted single sale values

                ExtendedPriceLabel.Text = ExtendedPriceDecimal.ToString("C")
                DiscountLabel.Text = DiscountDecimal.ToString("N")
                DiscountedPriceLabel.Text = DiscountedPriceDecimal.ToString("C")
                quantitysumlabel.text = DiscountSuminteger.ToString()
                Discountsumlabel.text = DiscountSumDecimal.ToString("C")
                averageDiscountLabel.Text = AverageDiscountDecimal.ToString("C")



                'accumulate (add to ) summary values

                Quantitysuminteger += QuantityInteger
                DiscountSumDecimal += DiscountDecimal
                SaleCountInteger += 1
                DiscountedPriceSumDecimal += DiscountedPriceSumDecimal / SaleCountInteger





                'display formatted summary values

                ExtendedPriceLabel.Text = Quantitysuminteger.ToString("C")
                DiscountLabel.Text = DiscountDecimal.ToString("n")
                DiscountedPriceLabel.Text = DiscountedPriceDecimal.ToString("C")







            Catch PriceException As FormatException

            End Try

        Catch QuantityExceptioin As FormatException
            'Format Exception for quantity conversion
            MessageBox.Show("price must be numeric. ", "data entry error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
            With priceTextBox
                .Focus()
                .SelectAll()

            End With

        Catch anException As Exception
            'Any other exception
            MessageBox.Show("Error: " & anException.Message)
        End Try

    End Sub

    Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click
        titleTextBox.Clear()
        priceTextBox.Clear()
        QuantityTextBox.Clear()






    End Sub

    Private Sub exitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitButton.Click
        Me.Close()
    End Sub

    Private Sub bookSalesForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Function DiscountSuminteger() As Object
        Throw New NotImplementedException
    End Function

    Private Function Quantitysumlabel() As Object
        Throw New NotImplementedException
    End Function

    Private Function Discountsumlabel() As Object
        Throw New NotImplementedException
    End Function

End Class
4

1 に答える 1

2

それは実際には非常に簡単です。この行:

quantitysumlabel.text = DiscountSuminteger.ToString()

この関数を呼び出します:

Private Function DiscountSuminteger() As Object
    Throw New NotImplementedException
End Function

つまり、NotImplementedException がスローされます:)

于 2013-09-25T11:17:02.613 に答える