IT/Software career thread: Invert binary trees for dollars.

Tenks

Bronze Knight of the Realm
14,163
607
It is just outputting "Student a_skeleton_03 had a GPA of 3.4." In this Java-like syntax string outputting like that doesn't require you telling it if it will be a digit, character or anything like that. The language will automatically convert it to a String for you for your output.
 

Noodleface

A Mod Real Quick
38,244
15,025
Damn noodle showing his hacker cred with the second collect. Don't dox me bro.
I do it quite frequently, I got blasted about it on facebook. It's actually on accident. I use swiftkey and the numbers are above letters in a way that I accidentally fatfinger a number and it happens to be the leet speak for whatever letter I wanted. My phone won't autocorrect it and I just leave it.
 

a_skeleton_03

<Banned>
29,948
29,763
It is just outputting "Student a_skeleton_03 had a GPA of 3.4." In this Java-like syntax string outputting like that doesn't require you telling it if it will be a digit, character or anything like that. The language will automatically convert it to a String for you for your output.
A string like that will work on C++ though? Should I instead switch to my syntax?
 

Cad

scientia potentia est
<Bronze Donator>
25,338
48,507
A string like that will work on C++ though? Should I instead switch to my syntax?
Just print it out directly with name and GPA after you're done entering the grades, assignment doesn't specify doing it at the end. I was just being fancy.
 

Noodleface

A Mod Real Quick
38,244
15,025
I mentioned it because you said something about how strings worked in C++.

Professors love to fail people who use C++ in C
 

Tenks

Bronze Knight of the Realm
14,163
607
\n = new line. or carriage return.

I like the 0,1, infinity rule of thumb..
Same. When a product person tells you they'll ONLY EVER do it 3 ways you damn well make sure to make it flexible enough to accept an arbitrary number of ways of doing something. Because it is never just three ways.
 

a_skeleton_03

<Banned>
29,948
29,763
So with some live help from some friends I switched to C++ instead and finished it.

There is one problem with it, if you don't do a standard letter grade there is no error out of it. I am okay with that, I expect my users to be smart.
 

Deathwing

<Bronze Donator>
16,717
7,731
I expect my users to be smart.
1d8acd8c6e8e337ce31bef84a8636491.jpg


If there's anything you learn from this course, always assume the user is an idiot. Users, other programmers, even yourself a few months from now will come back use your software incorrectly.


Why did you need C++ to finish this?
 

a_skeleton_03

<Banned>
29,948
29,763
1d8acd8c6e8e337ce31bef84a8636491.jpg


If there's anything you learn from this course, always assume the user is an idiot. Users, other programmers, even yourself a few months from now will come back use your software incorrectly.


Why did you need C++ to finish this?
I know my users are morons but this is homework where the teacher is just looking to see if you got the basics done. You get an automatic 80% if you just figure out the GPA calculation part and your code is written in crayon. I just needed the assignment to be over so I could turn it in.

I switched to c++ because all my searches for help on google were all written in c++ and nobody was doing anything in c. I know a lot of it is the same but by the time I was done with this it looked quite a bit cleaner and it was really starting to click. I did find the entire switch case part on a website with someone working on a similar program and snagged it but it was because I understood how I could integrate it in.
 

Noodleface

A Mod Real Quick
38,244
15,025
In the switch statement you can do a default tag and then something about it being an unknown input, that's what I'd do anyways.

 

a_skeleton_03

<Banned>
29,948
29,763
I did that Noodle and since it was so low in the chain it was still incrementing numGrade and throwing off the math. I tried to tie into it a numGrade - 1 but that didn't work so in the meantime it gets the ax.
 

Cad

scientia potentia est
<Bronze Donator>
25,338
48,507
I don't see any reason you switched to C++ for that, but good job if he allows you to use C++.
 

Tenks

Bronze Knight of the Realm
14,163
607
I did that Noodle and since it was so low in the chain it was still incrementing numGrade and throwing off the math. I tried to tie into it a numGrade - 1 but that didn't work so in the meantime it gets the ax.
Inside each item in the switch you should have just done something like:

Remove the count++ off your for loop that way the actual logic drives the incrementing of the loop based upon valid input
 

Noodleface

A Mod Real Quick
38,244
15,025
I need to vent about the new job a little. I'm being mentored by this guy that was doing bios before I got there. He keeps coming to me with changes, so I make them, then he does some testing with them. It's very informal. We have some deadline for Wednesday or something but I have no idea. No one tells me anything. Just keep getting loads of work dumped on me but I can't even tell what's real or not.

Also the guy comes back and tells me my bios broke a whole bunch of stuff but it's like dude you told me to put those things in!!

Just frustrated after 2 weeks.

Wonder if I made a mistake..