Categories > Coding > C# >
API Selection Issue
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.
Added
Like do I do like some select command to pick the options in the combo box I have?? if yes, tell me what
Cancel
Post
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???
Cancel
Post
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
Cancel
Post
Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).
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*/
Cancel
Post
https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif
Replied
@pepsi nested if statements... use a switch please
https://media.discordapp.net/attachments/808361089292304404/986764143380008960/yandere-dev-controversy-1594767971608.png
Cancel
Post
Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).
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;
}
}
Cancel
Post
https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif
Replied
@pepsi it's just better to learn it the efficient way from the start, switches are not the hardest thing to understand
Cancel
Post
Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).
Added
@50127You again..☠☠☠☠â˜
Cancel
Post
https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif
Replied
@pepsi ok nice way better now. We avoided another person pasting YandereDev code
Cancel
Post
Mail me at sirweebdev@protonmail.com if you have any questions or you want to say anything to me, I'll reply (maybe).
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
Cancel
Post
https://cdn.discordapp.com/attachments/661621789591470090/1013919752294498314/Untitled_1366_768_px_1546_202_px_2.gif
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post