Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8724059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:45:08+00:00 2026-06-13T07:45:08+00:00

I have this windows app Cafe that allows the user to make their selection

  • 0

I have this windows app Cafe that allows the user to make their selection and then it displays the cost of the items chosen, subtotal, tax, total, number of transactions made that day, and I need it to display the total sales tax collected as well. I figured calculating this would be similar to how I calculated # of transactions, but I have yet to figure it out. Any ideas?

public partial class Form1 : Form
{
    int clicks = 0;
    double totalSalesTaxCollected = 0;

    public Form1()
    {
        InitializeComponent();
        InitializeControls();

    }
    private void button1_Click(object sender, EventArgs e)
    {

        clicks++;
        displayBill();

    }

    private void displayBill()
    {

      // int[] listArray = listBox1.getSelectedIndices();
      // SelectedIndexCollection listArray = listBox1.SelectedIndices;
        double localTax = 0.01;
        double stateTax = 0.06;
        double tax;
        double subTotal = 0;
        double total;

        //Set the text area to non-edit mode and start
        //with an empty string.
        textBox1.ReadOnly = true;
        textBox1.Text = "";
        textBox1.AppendText("           C# KIOSK A LA CARTE\n\n");
        textBox1.AppendText("--------------- Welcome ----------------\n\n");


        //Calculate the cost of the items ordered.
        for (int index = 0; index < listBox1.SelectedIndices.Count; index++)
        {
            subTotal = subTotal + yourChoicesPrices[listBox1.SelectedIndices[index]];

        }

              tax = (localTax + stateTax) * subTotal;
              total = subTotal + tax;

                  //Display the costs.
              for (int index = 0; index < listBox1.SelectedIndices.Count; index++)
              {
                 textBox1.AppendText(yourChoicesItems[listBox1.SelectedIndices[index]] +"\n");
              }

            textBox1.AppendText("\n");
            textBox1.AppendText("SUB TOTAL\t\t" + String.Format("{0:C}", subTotal) + "\n");
            textBox1.AppendText("TAX           \t\t"+ String.Format("{0:C}" , tax) + "\n");
            textBox1.AppendText("TOTAL     \t\t"+ String.Format("{0:C}" , total) + "\n\n");
            textBox1.AppendText("\n");
            textBox1.AppendText("Thank you - Have a Nice Day\n\n");
            textBox1.AppendText("\n");
            textBox1.AppendText("Total sales: \t\t" + clicks + "\n" );
            textBox1.AppendText("Total sales tax collected: \t\t" + totalSalesTaxCollected);

                  //Reset list array.
            listBox1.ClearSelected();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:45:09+00:00Added an answer on June 13, 2026 at 7:45 am

    After
    tax = (localTax + stateTax) * subTotal;
    total = subTotal + tax;

    Add totalSalesTaxCollected += tax;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the situation. I have a windows form app that uses an access
I have a .NET application that contains a checkbox (System.Windows.Forms.Checkbox). This component (WindowsForms10.BUTTON.app.0.378734a1) is
I have this web app created using MVC3 and need to make a Windows
I have this Metro App project that I just tried building for the Windows
I am building an app for Windows Phone, and in this app I have
I have a web application running on Windows IIS. This app has a database
I have this method in App Delegate that makes a window and content view
I am building an installer for my windows app and have done this through
I have a native C++ windows app that i would like to edit. Are
I have this windows mobile application. I'd like to launch an updater.exe that will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.