-
Aug 1st, 2013, 01:15 PM
#1
Thread Starter
New Member
MainPage.xaml.cs and creating another class.cs
I have an assignment to display area and circumference of a circle. Write a circle class that calculates and instantiates circle object of user entered radius. I have created the UI (mainpage) with textblock, textbox and a button. Double click button and have the event, I also created a circle.cs class. I need help with where to code the calculate circle method. Have the following code, it works but not what professor asked:
namespace mobilecpt7ex1circle
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void Calculate_Click(object sender, RoutedEventArgs e)
{
double r = Convert.ToDouble(Radius.Text);
Area.Text = (Math.PI * r * r).ToString();
Circumference.Text = (Math.PI * 2 * r).ToString();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|