Code Monkey home page Code Monkey logo

james-helps-friends-code's People

Contributors

jamesmatchett avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

james-helps-friends-code's Issues

Confusion Basic Concepts

Why does this vvv

print('print("print")')

Become this vvv

print("print")

also uh
how to create a concatenation?

c# speed of light issue: some equations work and some don't. (windows form app)

`using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _3WayDistanceCalculator
{
public partial class Form1 : Form
{
decimal time;
decimal speedOfLight = 299792458;
decimal distance;
string var1;
string var2;
string var3;
decimal tb1;
decimal tb2;
decimal tb3;
int distance2;

    public Form1()

    {
        InitializeComponent();
        comboBox2.SelectedIndex = 0;
        comboBox1.SelectedIndex = 1;
        comboBox3.SelectedIndex = 3;
        comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox2.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox3.DropDownStyle = ComboBoxStyle.DropDownList;
    }

    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        
        if (comboBox1.SelectedItem.ToString() == "Distance" &&
           comboBox2.SelectedItem.ToString() == "Speed of light" ||
           comboBox1.SelectedItem.ToString() == "Speed of light" &&
           comboBox2.SelectedItem.ToString() == "Distance")
        {
            comboBox3.SelectedIndex = 2;
            comboBox3.Enabled = false;
        }
        else
        {
            comboBox3.Enabled = true;
        }
        if (comboBox1.SelectedItem.ToString() == "Distance" &&
           comboBox3.SelectedItem.ToString() == "Speed of light")
        {
            comboBox2.SelectedIndex = 2;
            comboBox2.Enabled = false;
        }
        else
        {
            comboBox2.Enabled = true;
        }
        if (comboBox1.SelectedItem.ToString() == "Speed of light")
        {
            textBox1.Enabled = false;
            textBox1.Text = "299792458";
        }
        else
        {
            textBox1.Enabled = true;
            textBox1.Text = "";
        }

        if (comboBox1.SelectedItem.ToString() == "Distance" && comboBox2.SelectedItem.ToString() == "Distance")
        {
            comboBox2.SelectedIndex = 0;
        }

            if (comboBox1.SelectedItem.ToString() == "Distance")
        {
            label1.Text = "Distance";
        }

        if (comboBox1.SelectedItem.ToString() == "Speed of light")
        {
            label1.Text = "Speed of light";
        }

        if (comboBox1.SelectedItem.ToString() == "Time")
        {
            label1.Text = "Time";
        }

    }
    
    private void button1_Click(object sender, EventArgs e)
    {
        //tb1 = Convert.ToDecimal(textBox1.Text);
        //tb2 = Convert.ToDecimal(textBox2.Text);
        //tb3 = Convert.ToDecimal(textBox3.Text);
        if (tb1 != speedOfLight)
        {

        }

        if (comboBox1.SelectedItem.ToString() == "Distance" && comboBox2.SelectedItem.ToString() == "Speed of light")
           
        {
            var1 = textBox1.Text;
            distance = Convert.ToDecimal(var1);
            time = distance / speedOfLight;

            if (time == 1)
            {
                var3 = time.ToString() + " Second";
            }
            else
            {
                var3 = time.ToString() + " Seconds";
            }
            label4.Text = var3;
            distance = 0;
        }
            if (comboBox2.SelectedItem.ToString() == "Distance" && comboBox1.SelectedItem.ToString() == "Speed of light")
            {
                label4.Text = "Working";

                var1 = textBox2.Text;
                distance = Convert.ToDecimal(var1);
                time = distance / speedOfLight;
                if (time == 1)
                {
                    var3 = time.ToString() + " Second";
                }
                else
                {
                    var3 = time.ToString() + " Seconds";
                }
                label4.Text = var3;
                distance = 0;
            }
                if (comboBox1.SelectedItem.ToString() == "Distance" && comboBox3.SelectedItem.ToString() == "Speed of light")
                {
                    var1 = textBox1.Text;
                    distance = Convert.ToDecimal(var1);
                    time = distance / speedOfLight;
                    if (time == 1)
                    {
                        var3 = time.ToString() + " Second";
                    }
                    else
                    {
                        var3 = time.ToString() + " Seconds";
                    }
                }
                if (comboBox3.SelectedItem.ToString() == "Distance" && comboBox1.SelectedItem.ToString() == "Speed of light")
                {
                    var3 = textBox3.Text;
                    distance = Convert.ToDecimal(var1);
                    time = distance / speedOfLight;
                    if (time == 1)
                    {
                        var3 = time.ToString() + " Second";
                    }
                    else
                    {
                        var3 = time.ToString() + " Seconds";
                    }
                }
                if (comboBox2.SelectedItem.ToString() == "Distance" && comboBox3.SelectedItem.ToString() == "Speed of light")
                {
                    var3 = textBox3.Text;
                    distance = Convert.ToDecimal(var1);
                    time = distance / speedOfLight;
                    if (time == 1)
                    {
                        var3 = time.ToString() + " Second";
                    }
                    else
                    {
                        var3 = time.ToString() + " Seconds";
                    }
                }
        if (comboBox3.SelectedItem.ToString() == "Distance" && comboBox2.SelectedItem.ToString() == "Speed of light")
        {
            var3 = textBox3.Text;

            distance = Convert.ToDecimal(var1);
              
            time = distance / speedOfLight;
            var3 = time.ToString();
            label4.Text = var3;
            /*if (time == 1)
            {
                var3 = time.ToString() + " Second";
            }
            else
            {
                var3 = time.ToString() + " Seconds";
            }*/
        }



    }

    private void textBox2_TextChanged(object sender, EventArgs e)
    {

    }

    private void textBox3_TextChanged(object sender, EventArgs e)
    {

    }

    private void label3_Click(object sender, EventArgs e)
    {

    }

    private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (comboBox1.SelectedItem.ToString() == "Distance" &&
            comboBox3.SelectedItem.ToString() == "Speed of light" ||
           comboBox1.SelectedItem.ToString() == "Speed of light" &&
           comboBox3.SelectedItem.ToString() == "Distance")
        {
            comboBox2.SelectedIndex = 2;
            comboBox2.Enabled = false;
        }
        else
        {
            comboBox2.Enabled = true;
        }
        if (comboBox2.SelectedItem.ToString() == "Distance" &&
           comboBox3.SelectedItem.ToString() == "Speed of light" ||
           comboBox2.SelectedItem.ToString() == "Speed of light" &&
           comboBox3.SelectedItem.ToString() == "Distance")
        {
            comboBox1.SelectedIndex = 2;
            comboBox1.Enabled = false;
        }
        else
        {
            comboBox1.Enabled = true;
        }

        if (comboBox3.SelectedItem.ToString() == "Distance" && comboBox2.SelectedItem.ToString() == "Distance")
        {
            comboBox2.SelectedIndex = 0;
        }

        if (comboBox3.SelectedItem.ToString() == "Distance" && comboBox1.SelectedItem.ToString() == "Distance")
        {
            comboBox1.SelectedIndex = 0;
        }
            if (comboBox3.SelectedItem.ToString() == "Speed of light")
        {
            textBox3.Enabled = false;
            textBox3.Text = "299792458";
        }
        else
        {
            textBox3.Enabled = true;
            textBox3.Text = "";
        }



        if (comboBox3.SelectedItem.ToString() == "Distance")
        {
            label3.Text = "Distance";
        }

        if (comboBox3.SelectedItem.ToString() == "Speed of light")
        {
            label3.Text = "Speed of light";
        }

        if (comboBox3.SelectedItem.ToString() == "Time")
        {
            label3.Text = "Time";
        }
        
        
    }

    private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
    {
        
        if (comboBox2.SelectedItem.ToString() == "Distance" &&
           comboBox3.SelectedItem.ToString() == "Speed of light" /*||
           comboBox2.SelectedItem.ToString() == "Speed of light" &&
           comboBox3.SelectedItem.ToString() == "Distance"*/)
        {
            comboBox1.SelectedIndex = 2;
            comboBox1.Enabled = false;
            
        }
        else
        {
            comboBox2.Enabled = true;
        }
        if (comboBox2.SelectedItem.ToString() == "Distance" &&
           comboBox1.SelectedItem.ToString() == "Speed of light")
        {
            comboBox3.SelectedIndex = 2;
            comboBox3.Enabled = false;
        }
        else
        {
            comboBox3.Enabled = true;
        }



        if (comboBox2.SelectedItem.ToString() == "Speed of light")
        {
            textBox2.Enabled = false;
            textBox2.Text = "299792458";
        }
        else
        {
            textBox2.Enabled = true;
            textBox2.Text = "";
        }



        if (comboBox2.SelectedItem.ToString() == "Speed of light")
        {

        }
        if (comboBox2.SelectedItem.ToString() == "Distance")
        {
            label2.Text = "Distance";
        }

        if (comboBox2.SelectedItem.ToString() == "Speed of light")
        {
            label2.Text = "Speed of light";
        }

        if (comboBox2.SelectedItem.ToString() == "Time")
        {
            label2.Text = "Time";
        }
    }
}

}
`

Hello World

I just want to write my first program in python

pls help

i want to pick up roblox girlfriends using cā™­

speed of light calculator

`using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _3WayDistanceCalculator
{
public partial class Form1 : Form
{
decimal time;
decimal speedOfLight = 299792458;
decimal distance;
string var1;
string var2;

    public Form1()

    {
        InitializeComponent();
        comboBox2.SelectedIndex = 0;
        comboBox1.SelectedIndex = 1;
        comboBox3.SelectedIndex = 3;
        comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox2.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox3.DropDownStyle = ComboBoxStyle.DropDownList;
    }

    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        
        if (comboBox1.SelectedItem.ToString() == "Distance" &&
           comboBox2.SelectedItem.ToString() == "Speed of light" ||
           comboBox1.SelectedItem.ToString() == "Speed of light" &&
           comboBox2.SelectedItem.ToString() == "Distance")
        {
            comboBox3.SelectedIndex = 2;
            comboBox3.Enabled = false;
        }
        else
        {
            comboBox3.Enabled = true;
        }
        if (comboBox1.SelectedItem.ToString() == "Distance" &&
           comboBox3.SelectedItem.ToString() == "Speed of light")
        {
            comboBox2.SelectedIndex = 2;
            comboBox2.Enabled = false;
        }
        else
        {
            comboBox2.Enabled = true;
        }
        
        if (comboBox1.SelectedItem.ToString() == "Distance")
        {
            label1.Text = "Distance";
        }

        if (comboBox1.SelectedItem.ToString() == "Speed of light")
        {
            label1.Text = "Speed of light";
        }

        if (comboBox1.SelectedItem.ToString() == "Time")
        {
            label1.Text = "Time";
        }

    }

    private void button1_Click(object sender, EventArgs e)
    {
        //string comb1 = Convert.ToString(comboBox1);
        //string comb2 = Convert.ToString(comboBox2);
        //if (comb1 == "Distance" && comb2 == "Speed of light")
        if (comboBox1.SelectedItem.ToString() == "Distance" && comboBox2.SelectedItem.ToString() == "Speed of light")
        {
            var1 = textBox1.Text;
            var2 = textBox2.Text;
            distance = Convert.ToDecimal(var1);
            speedOfLight = Convert.ToInt32(var2);
            time = distance / speedOfLight;
            string var3 = time.ToString() + " Seconds";
            label4.Text = var3;
        }
    }

    private void textBox2_TextChanged(object sender, EventArgs e)
    {

    }

    private void textBox3_TextChanged(object sender, EventArgs e)
    {

    }

    private void label3_Click(object sender, EventArgs e)
    {

    }

    private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (comboBox1.SelectedItem.ToString() == "Distance" &&
            comboBox3.SelectedItem.ToString() == "Speed of light" ||
           comboBox1.SelectedItem.ToString() == "Speed of light" &&
           comboBox3.SelectedItem.ToString() == "Distance")
        {
            comboBox2.SelectedIndex = 2;
            comboBox2.Enabled = false;
        }
        else
        {
            comboBox2.Enabled = true;
        }
        if (comboBox2.SelectedItem.ToString() == "Distance" &&
           comboBox3.SelectedItem.ToString() == "Speed of light")
        {
            comboBox1.SelectedIndex = 2;
            comboBox1.Enabled = false;
        }
        else
        {
            comboBox1.Enabled = true;
        }
        



        if (comboBox3.SelectedItem.ToString() == "Distance")
        {
            label3.Text = "Distance";
        }

        if (comboBox3.SelectedItem.ToString() == "Speed of light")
        {
            label3.Text = "Speed of light";
        }

        if (comboBox3.SelectedItem.ToString() == "Time")
        {
            label3.Text = "Time";
        }
        
        
    }

    private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
    {
        
        if (comboBox2.SelectedItem.ToString() == "Distance" &&
           comboBox3.SelectedItem.ToString() == "Speed of light" ||
           comboBox2.SelectedItem.ToString() == "Speed of light" &&
           comboBox3.SelectedItem.ToString() == "Distance")
        {
            comboBox1.SelectedIndex = 2;
            comboBox1.Enabled = false;
        }
        else
        {
            comboBox2.Enabled = true;
        }
        if (comboBox2.SelectedItem.ToString() == "Distance" &&
           comboBox1.SelectedItem.ToString() == "Speed of light")
        {
            comboBox3.SelectedIndex = 2;
            comboBox3.Enabled = false;
        }
        else
        {
            comboBox3.Enabled = true;
        }
        


        if (comboBox2.SelectedItem.ToString() == "Speed of light")
        {

        }
        if (comboBox2.SelectedItem.ToString() == "Distance")
        {
            label2.Text = "Distance";
        }

        if (comboBox2.SelectedItem.ToString() == "Speed of light")
        {
            label2.Text = "Speed of light";
        }

        if (comboBox2.SelectedItem.ToString() == "Time")
        {
            label2.Text = "Time";
        }
    }
}

}
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.