Categories > Coding > C# >

API Selection Issue

Posts: 31

Threads: 11

Joined: Jun, 2022

Reputation: -4

Posted

https://ibb.co/MZwDFWv

In that link you can see that I'm trying to make a execute button switch api's when pressed but.... what would I type in the code so it's when you select and option it will change api's with execute and attach and how would I add my specific options in the combo box.

  • 0

Added

Like do I do like some select command to pick the options in the combo box I have?? if yes, tell me what

  • 0

Added

https://ibb.co/W5yZTZH

Here an image of what I tried to do. Like do I do some select command?????  and like how would I insert my option into the C# code???

  • 0

Posts: 1316

Threads: 54

Joined: Jul, 2021

Reputation: 64

Replied

Please learn how if statements work in c#... Those images only prove you don't know a single bit about what you're doing

  • 0

Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).

pepsi

PePsIDeveloper

vip

Posts: 309

Threads: 6

Joined: Apr, 2021

Reputation: 16

Replied


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


static void WhatAreYou()
{
    Console.WriteLine("Are you a student, teacher, parent, admin, teacher and parent, teacher and admin?");
    string answer = Console.ReadLine();
    if (answer == "student")
    {
        Console.WriteLine("You are a student");
    }
    else if (answer == "teacher")
    {
        Console.WriteLine("You are a teacher");
    }
    else if (answer == "parent")
    {
        Console.WriteLine("You are a parent");
    }
    else if (answer == "admin")
    {
        Console.WriteLine("You are an admin");
    }
    else if (answer == "teacher and parent")
    {
        Console.WriteLine("You are a teacher and a parent");
    }
    else if (answer == "teacher and admin")
    {
        Console.WriteLine("You are a teacher and an admin");
    }
    else
    {
        Console.WriteLine("You are not a student, teacher, parent, admin, teacher and parent, teacher and admin");
    }
}
/*No switch statements cause one particular person does not like it*/
/*No spoonfeeding anymore. This code gives you an example on if statements*/
  • 0

https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif

Posts: 1316

Threads: 54

Joined: Jul, 2021

Reputation: 64

Replied

@pepsi nested if statements... use a switch please

https://media.discordapp.net/attachments/808361089292304404/986764143380008960/yandere-dev-controversy-1594767971608.png

  • 0

Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).

pepsi

PePsIDeveloper

vip

Posts: 309

Threads: 6

Joined: Apr, 2021

Reputation: 16

Replied

@68804bro "Beginners Its Ok For Them To Nest If Statements"

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


static void WhatAreYou()
{
    Console.WriteLine("Are you a student, teacher, parent, admin, teacher and parent, teacher and admin?");
    string answer = Console.ReadLine();
    switch (answer)
    {
        case "student":
            Console.WriteLine("You are a student");
            break;
        case "teacher":
            Console.WriteLine("You are a teacher");
            break;
        case "parent":
            Console.WriteLine("You are a parent");
            break;
        case "admin":
            Console.WriteLine("You are an admin");
            break;
        case "teacher and parent":
            Console.WriteLine("You are a teacher and a parent");
            break;
        case "teacher and admin":
            Console.WriteLine("You are a teacher and an admin");
            break;
        default:
            Console.WriteLine("You are not a student, teacher, parent, admin, teacher and parent, teacher and admin");
            break;
    }
}
  • 1

https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif

Posts: 1316

Threads: 54

Joined: Jul, 2021

Reputation: 64

Replied

@pepsi it's just better to learn it the efficient way from the start, switches are not the hardest thing to understand

  • 0

Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).

Posts: 1479

Threads: 95

Joined: Oct, 2019

Reputation: 103

Replied

@pepsi Someone Seems Mad Still Lol.

  • 0

pepsi

PePsIDeveloper

vip

Posts: 309

Threads: 6

Joined: Apr, 2021

Reputation: 16

Replied

@SirWeeb Just wrote it refresh your page

  • 0

Added

@50127You again..☠☠☠☠☠

  • 0

https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif

Posts: 1316

Threads: 54

Joined: Jul, 2021

Reputation: 64

Replied

@pepsi ok nice way better now. We avoided another person pasting YandereDev code

  • 0

Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).

pepsi

PePsIDeveloper

vip

Posts: 309

Threads: 6

Joined: Apr, 2021

Reputation: 16

Replied

@SirWeeb if (yourfat) else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if 

  • 0

Added

@ImmuneLion318 look at my siggy 

  • 0

https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif

Posts: 1479

Threads: 95

Joined: Oct, 2019

Reputation: 103

Replied

@pepsi Ok Tell Me What Lie Did You Tell Him Now.

  • 0

Next >>>

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )