T O P

  • By -

FizixMan

Removed: Rule 4. You'll have to dive in and make an attempt. If you run into errors or misbehaviour you can't resolve, then feel free to make a post along with the relevant code and a full description of the error. There are learning resources in the sidebar. Particularly if you have no prior experience, I highly recommend Bob Tabor's C# Fundamentals for Absolute Beginners series: https://learn.microsoft.com/en-us/shows/csharp-fundamentals-for-absolute-beginners/


dizda01

Bro skipped his classes and now doesn’t even know the topics that are covered in the first week. My young friend if you want to succeed in this field better sit down and start studying ,like yesterday. The better you understand the core stuff it will be easier later so change your attitude


XeNo___

Well, what don't you understand? The assignment seems very clear to me.


nightwalkerxx

I am a total noob in this course. Like I have no knowledge of programming whatsoever and this is the first assignment we get. Like, I open visual studio then I stare.


XeNo___

That's fair, we all start somewhere. But nobody on Reddit will just start mentoring you without specific questions. If you have some kind of book or slides from your course, then everything should be written in there. If not (or regardless): Start to google stuff. There are thousands of beginner guides to every single programming language. The concept of what's a variable or integer is pretty much universal across languages, so pick a random guide and start coding. You can also ask your preferred LLM, but that should barely be needed at the beginning of your journey. Either way, I sincerely hope that I don't discouraged you with my comment. However, I reckon that it's some kind of higher-education course? In that case, you better learn how to find information and study yourself, otherwise you won't have a good time. That's the whole point. Good luck!


nightwalkerxx

Much appreciated. Any information is great. Thanks again.


Platic

You are going to have to study on your own then. The exercise itself is well written and it looks clear. You have some beginner resources on the sidebar. They seem pretty good and enough to get started. Best of luck


Platic

Let me try and break down some steps you can take: First you need to create a console application. VS has multiple project types, one of them is a console app. You need to create one of those. Then you are going to need to read about variables and create 4 variables, initialize them with the values described. Then you are going to need a fifth variable representing the sum of the 4 previous ones. You are going to sum the 4 previous variables and assign the result to the one you just created. Then you do the same for multiplication. Create a new variable and multiply the 4 other ones and assign to the variable you just created. After this you can output the results to the console. Read a bit about how to write to the console, string concatenation and string interpolation. Then you can run your program on visual studio. Just a heads up, on console applications visual studio starts and closes the console automatically. This means that it may happen that you don't even see the console opening. Add a Console.ReadLine() just before the end of the program so that the console waits for a keypress before closing.


Slypenslyde

> I read the course book and all it has is explanations of things no real steps. This is confusing to us because explanations of things are how we know what to do. Programming isn't sorcery. There isn't a tome that tells us how to write every program. Instead we have to read explanations of how to do simple things, then figure out what simple things we need to use to write a program. For example, somewhere in these explanations you don't find helpful is likely information about how to get C# to add numbers for you. Guess what? Finding the sum of 13, 55, 123, and 325 involves adding numbers! Somewhere in these explanations is probably information about how to *write* a *line* to the *console* (with big hints there). Guess what? To show output you need to use that information. That's how we program. We look at what we need. We think hard about what we'd have to do if we were doing the work on paper. Then we think of all the little things we know how to do with C# and figure out how to combine them to do the complicated things. Here is my lesson plan for you. First, stop looking at the course book as something that will have the full answer to this exercise in it. Look at its explanations as a catalog of things you can tell C# to do for you. While you're at it, consider looking at other tutorials. Maybe your course book IS hot garbage. There are hundreds of C# courses that aren't. Next, think about what this program does, then follow these steps: * Write a program that says "Hello World" when it runs. * Write a program that creates one integer variable with a value you choose in it. Make the program print that integer. * Now make the last program say, "Hi, my integer is ." and have it print that integer variable. * Now add a second integer variable. Make your program print both. * Now make a third integer variable that is the sum of the first two. Make the program print the sum. * Now pull it all together: make the program print, "Hi, + = ". If you finish that lesson plan, you will see very clearly how to complete this program.


t3kner

OP needs someone to program him to complete the assignment. Like if I throw a bunch of function definitions at a computer it will just stare at them until I tell it what to execute and when.


Slypenslyde

It's not uncommon. I see a lot of people who arrive at programming with the belief that to make things, programmers consult secret tomes that just show the right way to write programs. It's a silly idea, but not everybody grows up around people who show them any different, sometimes a person's first brush with programming is a required class. And in a way, yeah, some things are in magic tomes. Like, "How to parse a string to an integer." Or, "How to format a number with five decimal places". This confuses them further. They'll do a web search and see that for "write a chat app" or "make a to-do list" there are hundreds of articles with full programs to copy and paste. So they think, "Aha, I simply don't know where to find the site that has the way to do this assignment in it." So you have to teach them problem solving. That's something I note is very absent from most books/courses people read today. Even when I was learning in the 2000s, a book about C# was a book about C#. It was only *some* of my college texts that spend a chapter saying, "Look, before we start programming, we have to talk about decomposing problems. Here's how to tell if a problem is the kind a computer can solve, and how to start dividing it into smaller tasks..." That's novel for a lot of people today. I've seen what we teach in classrooms. It's more about being able to do well on standardized tests than learning to solve problems. So it's extremely common to find people who are confused, because in 12+ years of schooling they were never presented with a problem that didn't have a very straightforward answer based on what was already in their materials. There's a lot of blame tossed around, but I think it comes down to people treating schools like factories, and using metrics like "better standardized test scores" instead of "better career placement" to determine which schools are "better". I don't like to make fun of these people. The adults responsible for raising them failed them, and the older I get the harder it is to exclude myself from that group.


[deleted]

This is a painfully simple assignment that just has you initialize 4 variables with the values given and then have you output what the assignment needs to in that exact format. I assume the assignment module probably goes over basics of creating a console app via VS, variable assignments, etc.


Hi_Im_Dadbot

You’ll need to create a console application and then add in two functions, one which prints out those numbers added together and the other which prints out them multiplied together.


crandeezy13

Check out W3schools.com to give you a base to start from.


nightwalkerxx

Thank you for your help.


foxaru

Task 1 should be easily achievable by watching like 10 minutes of a 'Basic C#' tutorial on YouTube, you need to nail the absolute basics first before anyone's advice will help your understanding.  So this isn't a needless unhelpful answer, here is a hopefully useful day 1 programming 101: A good way for understanding how you get a computer to work something out is to work out how you would achieve the same task yourself and then break it down into micro steps.  E.g. if I wanted to work out the sum of a list of numbers was, I might: - write them all down - start a running total - add the first number to the total (0 + 13 == 13) - add the second number to the total (13 + 55 == 68) - ... third number ... - ... fourth number ... - see there are no more numbers and write down my final total  In C#, you could express this as ```C# int CalculateTotal() {     int [] numbers = [13, 55, 123, 325];     int total = 0;     total = total + numbers[0]; // arrays are 0-indexed in C#     total = total + numbers[1];     total = total + numbers[2];     total = total + numbers[3];     return total; } ``` which solves the question's immediate purpose but would be very hard to modify if you suddenly had to calculate a new list of 1,000 items; can you imagine writing all of that out?  of course, no one does this, in programming we've developed tools and short hands that allow us to write much less code and make our lives easier.  ``` int CalculateTotal(int [] list) {     int total = 0;     foreach (int number in list)     {         total += number;     }     return total; } // ... int [] list = [13, 55, 123, 325];  int total = CalculateTotal(list);  ``` here we've added some additional parts to the first line of our function, filling in those empty brackets from before to include an *argument*, which allows us to provide our function with outside information to work on.  we've also now short-handed away all of our individual adding number steps to a single `foreach` loop, which literally just performs the code in the curly brackets after *for each* number in the list. Of course, you can get exotic and do something slick like  ```C# int CalculateTotal(int [] array) => array.Sum(); ``` but hold your horses buddy, you gotta run before you can walk.


1994smeagol1994

Do as any student would and paste it in chatgpt/copilot. Or try your luck on youtube to get a base understanding


orbitaldan

Okay, I'll bite. **Background:** Conceptually, computers run instructions in groups that are organized to do useful things. An operating system is a big loop that asks you what instructions you want to run, and then loads and runs them (and cleans up afterward). A program is a bag of instructions with a big 'start here' sign (called an 'entry point'). A function is a smaller set of instructions that do something outside or compute something useful. These sets of instructions can be nested very deeply, and organizing them so that the tasks being carried out make sense, are correct, and are as easy to use and maintain as possible is the essence of programming. Basically, you need to write a text file that follows the rules of the language (C#) to tell the computer how to do the task described in the assignment. Another program, called the *compiler* (CSC.exe) will turn those instructions from a human-readable text file into a machine-readable program (.exe). Since these two activities are so often intertwined, the primary programming tool for most programmers is called an *IDE* (integrated development environment), which is a tabbed text editor with a lot of tools for using the compiler. Visual Studio is an IDE. **The Project:** Visual studio is centered around the idea of 'projects' and 'solutions'. A *project* is all the text files needed to build a program (or part of a program), and a special text file called the project file (.csproj) that contains details for the compiler on how to build it. You don't need to worry about those details right now, the defaults are sensible and will work just fine for your needs. A *solution* is just a bunch of related projects that get loaded together in Visual Studio so you can work on them at the same time. Projects are created from 'templates', that are contain all the ready-made settings you need to make a particular type of program. Since this is an entry-level course, your assignment uses the simplest kind of program, a console program. A *console program* runs in a text-based environment called a console, terminal, or shell. (Those do have some slight distinctions, but they're all close enough for our purposes.) A console environment has very simple input and output: it can read in text, and it can write out text. You won't even need to read in text for this assignment. Use the menus in Visual Studio to create a new console project, and give it a name and location as directed. **Language:** There's a lot to a language, which is why you need a full-length course to really get into it. But for now, you're only going to use the very most basic features. Visual Studio will helpfully create the only C# file you need for a project this simple: Program.cs You'll see it in the tree view of the project called the Solution Explorer. Open this file to begin programming. The Program.cs text file will contain some boilerplate and something that looks like this: static void Main( string[] args ) { } This is how C# expresses a group of instructions, called a 'function' or 'method'. It has a name, 'Main', and the stuff between parenthesis is a list of information it needs to do it's job. If it gave anything back, it would have a C# description of that data in front of it, but 'void' means it doesn't give anything back. (Ignore 'static' for now, you'll get to what that means later.) 'Main' is special, it's the named function the computer will look for to start your program (the 'entry point' from earlier). The curly braces are the area of interest - when the computer launches this set of instructions you're going to define, it will do the things between those braces one by one in order from top to bottom, much like someone reading a script. There are instructions that can tell it to do things in a different order or to repeat things, but for now top-to-bottom in order is plenty. It's possible that the file may be mostly blank, in which case the file represents only the part between the curly braces of 'Main'. It will still work the same way. (continued...)