How do you write codes?

NobleMan045 21 Reputation points
2021-12-10T09:09:37.377+00:00

Hello to everyone,

I'm a student in first year of college in Electromechanical. So in this we're learning lot of things that I have thought about or never seen before like Visual Studio.
The professor gave us a task to do at home write a program in Visual Studio, but I have no idea how to do that. I don't how to write the codes and I don't understand the program language.
So I came here to seek for help. If someone sees my message and have knowledge of Visual Studio, please contact me. Thank you in advance!

Windows for business Windows Client for IT Pros Devices and deployment Other
0 comments No comments
{count} votes

Accepted answer
  1. Pope_Innocent_3rd 316 Reputation points
    2021-12-10T09:29:06.573+00:00

    First you need to clarify what you wanna code and in which coding language. There are several like C, C#, C++, Java, Python etc. And they are all fundamentally different.
    Take an example "Hello World" a beginner code to teach beginners the first steps.

    Hello World in Java looks like:
    *public class HelloWorld
    {

       public static void main (String[] args)
       {
             // Ausgabe Hello World!
             System.out.println("Hello World!");
       }
    

    }*

    In Python:
    print("Hello World")

    In C:
    int main() {
    printf("Hello World\n");
    return 0;
    }

    In C#:
    namespace ConsoleApp1
    {
    class Program
    {
    static void Main(string[] args)
    {
    Console.WriteLine("Hello, world!");
    Console.ReadLine();
    }
    }
    }

    In C++:
    #include <iostream>
    int main() {
    std::cout << "Hello World!";
    return 0;
    }

    As you can see they are all different but all achieve the same output which is "Hello World".*

    You should follow up on which language and which task you should code. also go through the language documentation which may be boring but very useful to understand the commands and structure.

    Good luck

    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. NobleMan045 21 Reputation points
    2021-12-10T09:36:57.297+00:00

    Hi Nick, thank you for your answer, but I don't know what you mean by language. Are those variables C, C++, C## languages that you're talking about?
    See the file I've inserted

    0 comments No comments

  2. NobleMan045 21 Reputation points
    2021-12-10T09:46:48.587+00:00

    So if you for example we're int in our programs, that means we're using the C language?

    0 comments No comments

  3. Pope_Innocent_3rd 316 Reputation points
    2021-12-10T11:45:17.867+00:00

    Programming works like a real language.
    Theres many different ways to code a program and tell a PC what it should do.
    The different styles of programming are called "languages" and are usually specified.

    For example a task might be "program a calculator in C#"

    Then you know to use the language C# in Visual Studio to make a calculator.

    Visual Studio supports many different languages.
    I for examples have 6 different languages installed on Visual Studio to perform different tasks.

    I suppose your prof or teacher has given you a task to make a program or code that does a thing and use a specific language for.
    If I look at the picture it looks like C#. But I would definitley make sure to use the right language.

    If you arent sure ask him which language you should use, because theres a major difference in what these languages do and how they perform and work out tasls.

    Just a small example:

    There are skript based and object orientated languages.

    Python for example is skript based, meaning it performs tasks the way its written from top to bottom.

    Pseudocode example:

    print("Hello World")
    1+1
    print ("1+1")

    Output:
    Hello World
    <<No output because we dont use print>>
    2

    Object orientated means basically you can tell the program a different it should work using so called classes.

    Pseudocode:

    Class Hello world
    Class Calc(1+1)

    output class Hello World
    output class calc

    output:

    Hello World
    2

    As you can see in python without classes we have to write what we want every single time
    With classes in C# i.e. we need to do that once and can reuse as often as we like

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.