Guest User

Untitled

a guest
Jan 16th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication6
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22.  
  23.  
  24. int radius = Convert.ToInt32(textBox1.Text);
  25.  
  26. int circumference = 2 * Math.PI * radius;
  27. int area = Math.PI * Math.Pow(radius, 2);
  28. int volume = (4 * Math.PI / 3) * Math.Pow(radius, 3);
  29.  
  30. Graphics paper;
  31. paper = pictureBox1.CreateGraphics();
  32. Pen pen = new Pen(Color.Red);
  33.  
  34. paper.DrawEllipse(pen, 0, circumference, area, volume);
  35. }
  36. }
  37. }
  38.  
  39. int straal = Convert.ToInt32(textBox1.Text);
  40. double omtrek = 2 * Math.PI * straal;
  41. double oppervlakte = Math.PI * Math.Pow(straal, 2);
  42. double volume = (4 * Math.PI / 3) * Math.Pow(straal, 3);
  43.  
  44. Graphics paper;
  45. paper = pictureBox1.CreateGraphics();
  46. Pen pen = new Pen(Color.Red);
  47.  
  48. paper.DrawEllipse(pen, 0, Convert.ToInt32(omtrek), Convert.ToInt32(oppervlakte), Convert.ToInt32(volume));
  49.  
  50. double myDouble = 3.211;
  51. int myInt = (int)myDouble;
  52.  
  53. int circumference = (int)(2 * Math.PI * radius);
  54. int area = (int)(Math.PI * Math.Pow(radius, 2));
  55. int volume = (int)((4 * Math.PI / 3) * Math.Pow(radius, 3));
Add Comment
Please, Sign In to add comment