d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Help Me With Simple Application > Tipping Fg
12Next
Add Reply New Topic New Poll
Member
Posts: 4,851
Joined: Sep 22 2008
Gold: 5,272.00
Aug 18 2015 04:47pm
Its a pizza ordering application in c#. Will tip a decent amount. Its got 4 kinds of pizzas each w/ a textbox to say how many of that kind the customer is ordering. Then a radio button w/ takeout and delivery. theres also a tax. Will pay some fg to who helps me. I'm new to c#

This post was edited by bioll2 on Aug 18 2015 04:48pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Aug 18 2015 05:45pm
don't make multiple threads.

post what your problem is.
Member
Posts: 27,086
Joined: Mar 7 2008
Gold: 685.00
Aug 18 2015 08:12pm
so the problem is?
Member
Posts: 2,832
Joined: Aug 17 2015
Gold: 1.00
Aug 18 2015 11:23pm
Quote (eric838 @ Aug 19 2015 04:12am)
so the problem is?


i guess his problem is to formulate the question :lol:

This post was edited by TragischerEinzelfall on Aug 18 2015 11:23pm
Member
Posts: 4,851
Joined: Sep 22 2008
Gold: 5,272.00
Aug 19 2015 12:03am
Quote (TragischerEinzelfall @ Aug 19 2015 05:23am)
i guess his problem is to formulate the question :lol:


haha i just pmd someone who commented on the post.
Member
Posts: 15,717
Joined: Aug 20 2007
Gold: 481.00
Aug 19 2015 07:29am
So is this supposed to act like it works or actually work i dont get it

you want an application that you can order pizzas on?

100k fg
Member
Posts: 2,757
Joined: Nov 26 2007
Gold: 1,214.81
Aug 19 2015 10:43am
Code
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 Pizza
{
public partial class Form1 : Form
{
private const double COST_PEPPERONI = 10;
private const double COST_CHEESE = 8;
private const double COST_VEGGIE = 12;
private const double TAX = 1.15;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void pepperoniCountField_TextChanged(object sender, EventArgs e)
{
orderChanged();
}

private void cheeseCountField_TextChanged(object sender, EventArgs e)
{
orderChanged();
}

private void veggieCountField_TextChanged(object sender, EventArgs e)
{
orderChanged();
}

private void deliveryField_CheckedChanged(object sender, EventArgs e)
{
orderChanged();
}
private void orderChanged()
{
double totalCost = 0;
int pepperoniCount = 0;
int cheeseCount = 0;
int veggieCount = 0;
int.TryParse(pepperoniCountField.Text, out pepperoniCount);
int.TryParse(cheeseCountField.Text, out cheeseCount);
int.TryParse(veggieCountField.Text, out veggieCount);
totalCost += pepperoniCount * COST_PEPPERONI;
totalCost += cheeseCount * COST_CHEESE;
totalCost += veggieCount * COST_VEGGIE;
totalCost += (deliveryField.Checked ? 5 : 0);
orderDetailsLabel.Text = String.Format("Order total: {0:C}", totalCost * TAX);
}


}
}
Member
Posts: 4,851
Joined: Sep 22 2008
Gold: 5,272.00
Aug 19 2015 05:37pm
Quote (labatymo @ Aug 19 2015 04:43pm)
Code
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 Pizza
{
public partial class Form1 : Form
{
private const double COST_PEPPERONI = 10;
private const double COST_CHEESE = 8;
private const double COST_VEGGIE = 12;
private const double TAX = 1.15;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void pepperoniCountField_TextChanged(object sender, EventArgs e)
{
orderChanged();
}

private void cheeseCountField_TextChanged(object sender, EventArgs e)
{
orderChanged();
}

private void veggieCountField_TextChanged(object sender, EventArgs e)
{
orderChanged();
}

private void deliveryField_CheckedChanged(object sender, EventArgs e)
{
orderChanged();
}
private void orderChanged()
{
double totalCost = 0;
int pepperoniCount = 0;
int cheeseCount = 0;
int veggieCount = 0;
int.TryParse(pepperoniCountField.Text, out pepperoniCount);
int.TryParse(cheeseCountField.Text, out cheeseCount);
int.TryParse(veggieCountField.Text, out veggieCount);
totalCost += pepperoniCount * COST_PEPPERONI;
totalCost += cheeseCount * COST_CHEESE;
totalCost += veggieCount * COST_VEGGIE;
totalCost += (deliveryField.Checked ? 5 : 0);
orderDetailsLabel.Text = String.Format("Order total: {0:C}", totalCost * TAX);
}


}
}


This helped a lot! Wasn't quite what I was looking for but I was able to extrapolate the info that I needed to make my own code.
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Aug 19 2015 05:40pm
Code
from giant_fucking_library import pizza_ordering_application



actual python solution
Member
Posts: 44,911
Joined: Feb 28 2012
Gold: 5.39
Sep 17 2015 11:21am
Quote (Eep @ Aug 19 2015 03:40pm)
Code
from giant_fucking_library import pizza_ordering_application



actual python solution


Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from giant_fucking_library import pizza_ordering_application
ImportError: No module named giant_fucking_library



fuuuuuuuuuuuuuuuuuuuu
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll