Results 1 to 6 of 6
  1. #1
    ImMalkah's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Location
    GTA Section
    Posts
    2,779
    Reputation
    370
    Thanks
    2,699
    My Mood
    Devilish

    C# Restaurant Bill Calculator Help

    Ok, so I have this practice problem I don't know how to do. Here's what my UI looks like.



    My problem is that I need to use variables to do this. So when I press calculate bill, it will use those variables to determine all the things on the left hand side. So the appetizer total, mains total, refreshments total, subtotal, tax and the final total.

    I WILL REP WHOEVER HELPS ME BECAUSE THIS IS A VERY IMPORTANT ASSIGNMENT.
    Last edited by ImMalkah; 09-12-2014 at 11:07 AM.

    MPGH HISTORY:

    Registered Since 4-23-2013
    Editor 09-04-2013 - unknown
    Minion 10-22-2013 - 1-18-2014
    Donator 12-31-2014 - present
    Premium Seller 12-31-2016 - present
    Minion 03-15-2017 - I forgot

  2. #2
    ERGaergaergaergaergearg's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    172
    Reputation
    19
    Thanks
    30
    My Mood
    Amazed
    You could go about this by using If and Else statements.

    Example
    Code:
    float appetizer = 0; // Assign it to zero
    
                if(radioButton1.Checked) { // Check if Soup radio is checked
                    appetizer = 2.00f; // if true change value of appetizer
                }
                else if(radioButton2.Checked) {
                    appetizer = 2.50f;
                 }
    Since you can't put a float into TextBox1.Text, you need to convert float to string

    Code:
     textBox1.Text = appetizer.ToString();
    I won't give out the rest since it is an assignment.
    I am sure you can figure out the rest for yourself.

    Bai
    Last edited by ERGaergaergaergaergearg; 09-12-2014 at 04:44 PM.

  3. #3
    Jim Morrison's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Canterlot, Equestria
    Posts
    12,444
    Reputation
    1090
    Thanks
    3,336
    Added you on Skype, accept me and I'll help you out.


    MPGH Staff History:
    Minion: 02-12-2013 - 6-28-2013
    Former Staff: 6-28-2013 - 7-14-2014
    Minion: 7-14-2014 - 1-3-2015
    Minion+: 1-3-2015 - 6-1-2015
    Moderator: 6-1-2015 - 10-2-2016
    Global Moderator: 10-2-2016 - Current

    Current Sections:
    DayZ Mod & Standalone Hacks & Cheats
    BattleOn Games Hacks, Cheats & Trainers
    Minecraft Hacks
    Other Semi-Popular First Person Shooter Hacks
    Blackshot Hacks & Cheats
    Need For Speed World Hacks
    Other First Person Shooter Hacks
    CounterStrike: Global Offensive Hacks
    Garry's Mod Hacks & Cheats


    Donating:
    If you want to donate money to me I take Bitcoin & Paypal, PM me for either of these if you're interested and thanks.
    Top Donators: (Awesome People)
    FanticSteal $75.00
    smurf_master $58.00 <- Best DayZ Gear Seller
    Fujiyama $25.00
    [MPGH]Black $10.00
    [MPGH]Hova $10.00
    xJudgez $4.54
    [MPGH]Normen's Sheep $3.50
    eminemlover $1.50


    Brony?
    https://www.mpgh.net/forum/groups/1728-mpgh-bronies.html

  4. #4
    ImMalkah's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Location
    GTA Section
    Posts
    2,779
    Reputation
    370
    Thanks
    2,699
    My Mood
    Devilish
    Quote Originally Posted by gresan6 View Post
    You could go about this by using If and Else statements.

    Example
    Code:
    float appetizer = 0; // Assign it to zero
    
                if(radioButton1.Checked) { // Check if Soup radio is checked
                    appetizer = 2.00f; // if true change value of appetizer
                }
                else if(radioButton2.Checked) {
                    appetizer = 2.50f;
                 }
    Since you can't put a float into TextBox1.Text, you need to convert float to string

    Code:
     textBox1.Text = appetizer.ToString();
    I won't give out the rest since it is an assignment.
    I am sure you can figure out the rest for yourself.

    Bai
    Quote Originally Posted by NormenJaydenFBI View Post
    Added you on Skype, accept me and I'll help you out.
    Thanks guys, but the replies took so long that I had to think my ass off till I got it right. I'll rep anyways.

    MPGH HISTORY:

    Registered Since 4-23-2013
    Editor 09-04-2013 - unknown
    Minion 10-22-2013 - 1-18-2014
    Donator 12-31-2014 - present
    Premium Seller 12-31-2016 - present
    Minion 03-15-2017 - I forgot

  5. #5
    Jim Morrison's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Canterlot, Equestria
    Posts
    12,444
    Reputation
    1090
    Thanks
    3,336
    Good to see you got it right, if you ever need any future help add me on Skype.


    MPGH Staff History:
    Minion: 02-12-2013 - 6-28-2013
    Former Staff: 6-28-2013 - 7-14-2014
    Minion: 7-14-2014 - 1-3-2015
    Minion+: 1-3-2015 - 6-1-2015
    Moderator: 6-1-2015 - 10-2-2016
    Global Moderator: 10-2-2016 - Current

    Current Sections:
    DayZ Mod & Standalone Hacks & Cheats
    BattleOn Games Hacks, Cheats & Trainers
    Minecraft Hacks
    Other Semi-Popular First Person Shooter Hacks
    Blackshot Hacks & Cheats
    Need For Speed World Hacks
    Other First Person Shooter Hacks
    CounterStrike: Global Offensive Hacks
    Garry's Mod Hacks & Cheats


    Donating:
    If you want to donate money to me I take Bitcoin & Paypal, PM me for either of these if you're interested and thanks.
    Top Donators: (Awesome People)
    FanticSteal $75.00
    smurf_master $58.00 <- Best DayZ Gear Seller
    Fujiyama $25.00
    [MPGH]Black $10.00
    [MPGH]Hova $10.00
    xJudgez $4.54
    [MPGH]Normen's Sheep $3.50
    eminemlover $1.50


    Brony?
    https://www.mpgh.net/forum/groups/1728-mpgh-bronies.html

  6. #6
    ERGaergaergaergaergearg's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    172
    Reputation
    19
    Thanks
    30
    My Mood
    Amazed
    Quote Originally Posted by MaroonishBlood View Post
    Thanks guys, but the replies took so long that I had to think my ass off till I got it right. I'll rep anyways.
    Thanks for the rep man!

    Good luck with future projects

    Bai

Similar Threads

  1. [Help Request] Need help on first on first calculator
    By NoShameAlts in forum C++/C Programming
    Replies: 2
    Last Post: 02-17-2012, 05:12 AM
  2. [Help] Price calculations.
    By yair in forum Visual Basic Programming
    Replies: 3
    Last Post: 03-11-2011, 10:51 PM
  3. [help] KDR Calculator
    By pushdis15 in forum Combat Arms Coding Help & Discussion
    Replies: 7
    Last Post: 01-22-2011, 05:03 PM
  4. I need help, VB - Calculating Currency / Exp.
    By WhiteBoiNic in forum Visual Basic Programming
    Replies: 4
    Last Post: 07-16-2010, 09:06 AM

Tags for this Thread