Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Java Programmers?
#21
Binary all the way!
Reply
#22
Amen, brutha!
[SIGPIC][/SIGPIC]
[Image: Viper-Adjusted-Mini-Sig.png]
[Image: Trixie-Mini-Sig-Fixed.png]

Fighting to the bitter end is an advantage when your opponent does not wish to perish.
Reply
#23
Here is my sweet pseudocode for calculating wages.
Code:
float hourWork, hourOver, regPay, overPay, empWage, payCheck

print "Please enter the amount of hours worked: "
hourWork<-readInput
Print "Please enter the wage of the employee per hour: "
wage<-readInput

If(hourWork > 40)
    hourOver<-(hourWork-40)
    payCheck<-(hourWork*empWage)+(hourOver*(2*empWage))
else
    payCheck<-(hourWork*empWage)

print "The employee's paycheck this week is: $" paycheck
Reply
#24
Yeah, that was a daily occurrence two quarters ago back in March.
[SIGPIC][/SIGPIC]
[Image: Viper-Adjusted-Mini-Sig.png]
[Image: Trixie-Mini-Sig-Fixed.png]

Fighting to the bitter end is an advantage when your opponent does not wish to perish.
Reply
#25
Vad Wrote:Yeah, that was a daily occurrence two quarters ago back in March.

Yeah they really love that pseudocode, and there doesn't seem to be a standardized format.
Reply
#26
We nearly killed the instructor and forced her to just teach us the code.
[SIGPIC][/SIGPIC]
[Image: Viper-Adjusted-Mini-Sig.png]
[Image: Trixie-Mini-Sig-Fixed.png]

Fighting to the bitter end is an advantage when your opponent does not wish to perish.
Reply
#27
Vad Wrote:We nearly killed the instructor and forced her to just teach us the code.

Well it's so tedious to use it and it's essentially useless, it's not compilable code.
Reply
#28
Yeah. We weren't learning any of the Python (which is what they taught) and learning just psuedocode and Flow charts. It was agonizing. I liked python, it was a break from C++ and my expedition into C#.
[SIGPIC][/SIGPIC]
[Image: Viper-Adjusted-Mini-Sig.png]
[Image: Trixie-Mini-Sig-Fixed.png]

Fighting to the bitter end is an advantage when your opponent does not wish to perish.
Reply
#29
Vad Wrote:Yeah. We weren't learning any of the Python (which is what they taught) and learning just psuedocode and Flow charts. It was agonizing. I liked python, it was a break from C++ and my expedition into C#.

I'm doing C++ right now, it's not too bad. I took a class of Java once but I didn't like it very much.
Reply
#30
I'm attempting to teach myself C++ at the moment. The only issue I've had in the past, when I was avid with it more than I am now, was that the smallest error can mask like thirty others.
[SIGPIC][/SIGPIC]
[Image: Viper-Adjusted-Mini-Sig.png]
[Image: Trixie-Mini-Sig-Fixed.png]

Fighting to the bitter end is an advantage when your opponent does not wish to perish.
Reply
#31
I solved the issue I was dealing with.

I suppose I'll hit you up when I inevitably run into new problems. Thanks, though, Josh. I appreciate the offer.
[Image: Sage.jpg]
Reply
#32
Code:
#include <iostream>
#include <stdlib.h>
#include <string>

using namespace std;

int main()
{
        //Set variables for Character Stat Sheet
        
        string charaFirstName, charaLastName, charaClass, enemyClass;
    int charaStr, charaDex, charaInt, charaAgi, charaVit, charaChoice;
        
    //Introduction and offering user to name their character
    
    cout << "Welcome to The Simple Character Battle Simulator!!\n" << endl;
    cout << "Please enter the first name of your character: ";
    cin >> charaFirstName;
    cout << "Please enter the last name of your character: ";
    cin >> charaLastName;
    
    //Providing list for classes, and allowing user to choose a class

    cout << "\nHere is a list of classes for your character to choose from:\n" << endl;
    cout << "1. Swordmaster" << endl;
    cout << "2. Warlock" << endl;
    cout << "3. Exorcist" << endl;
    cout << "4. Rouge" << endl;
    cout << "5. Sniper\n" << endl;
    cout << "Please choose a class, and then enter the number of your chosen class: ";
    cin >> charaChoice;

    //Setting character stats based on class, and class name

    if (charaChoice == 1)
    {
        charaClass = "Swordmaster";
        charaStr = 10;
        charaDex = 6;
        charaInt = 4;
        charaAgi = 6;
        charaVit = 4;
    }
    else if (charaChoice == 2)
    {
        charaClass = "Warlock";
        charaStr = 1;
        charaDex = 10;
        charaInt = 14;
        charaAgi = 3;
        charaVit = 2;
    }
    else if (charaChoice == 3)
    {
        charaClass = "Exorcist";
        charaStr = 1;
        charaDex = 7;
        charaInt = 10;
        charaAgi = 4;
        charaVit = 8;
    }
    else if (charaChoice == 4)
    {
        charaClass = "Rouge";
        charaStr = 3;
        charaDex = 10;
        charaInt = 4;
        charaAgi = 12;
        charaVit = 1;
    }
    else
    {
        charaClass = "Sniper";
        charaStr = 1;
        charaDex = 12;
        charaInt = 4;
        charaAgi = 12;
        charaVit = 1;
    }

    //Print out the character sheet for the user to see

    cout << "\nHere is your Character Sheet!\n" << endl;
    cout << "Characters Name: " << charaFirstName << " " << charaLastName << endl;
    cout << "Class: " << charaClass << endl;
    cout << "Strength: " << charaStr << endl;
    cout << "Dexterity: " << charaDex << endl;
    cout << "Intelligence: " << charaInt << endl;
    cout << "Agility: " << charaAgi << endl;
    cout << "Vitality: " << charaVit << endl;

    //Present user with enemies to test out there character against

    cout << "\nNow that you have created your own character, it's time to test them out!\n" << endl;
    cout << "Choose from one of the enemies below to pit your character against them:\n" << endl;
    cout << "1. Grue" << endl;
    cout << "2. Mind Flayer" << endl;
    cout << "3. Giant" << endl;
    cout << "4. Golem" << endl;
    cout << "5. Drow\n" << endl;
    cout << "Please choose an enemy, and then enter the number of your chosen enemy: ";
    cin >> charaChoice;
    cout << "\n";

    //Calculate whether or not the character wins against said monster and print output

    if (charaChoice == 1)
    {
        if (charaStr > 2)
        {
            cout << "You have eaten the Grue!";
        }
        else    
        {
            cout << "The Grue has eaten you...";
        }
    }
    else if (charaChoice == 2)
    {
        if (charaInt > 5)
        {
            cout << "You roasted the Mindflayers brain!";
        }
        else
        {
            cout << "You were served with a nice Chianti and some fava beans...";
        }
    }
    else if (charaChoice == 3)
    {
        if (charaDex > 6)
        {
            cout << "You were able to topple the Giant!";
        }
        else
        {
            cout << "Fi, fie, fo, fum you're on the bottom of a Giant's shoe, next to some gum...";
        }
    }
    else if (charaChoice == 4)
    {
        if (charaVit > 5)
        {
            cout << "Looks like you smashed the Golem to pieces!";
        }
        else
        {
            cout << "Unfortunately the Golem put you six feet under...";
        }
    }
    else
    {
        if (charaAgi > 5)
        {
            cout << "The lame Drow was easily sliced and diced by your superior speed!";
        }
        else
        {
            cout << "Looks like you were too slow, Drizzt wins this day...";
        }
    }

    return 0;
}

Here is the awesome part 3 of my assignment XD.

I had to use two different types of variables, and chained as well as nested if else statements.
Reply
#33
Rouge..?!
[SIGPIC][/SIGPIC]
Reply
#34
Cerion Wrote:Rouge..?!

Yes, the rouge class...

It's a red ninja...

Yah >.>
Reply
#35
Well done. I didn't know any of you guys knew any C++, I thought you were all PHP and shit.
Quote: "for a quarter million a year growing weed, i'd fucking be gay. with dick on the side." - Laura, on mairjuana
Reply
#36
Bil Baer Jaxx Wrote:Well done. I didn't know any of you guys knew any C++, I thought you were all PHP and shit.

You make it sound as if C++ is the only good language :x.
Reply
#37
Josh Wrote:You make it sound as if C++ is the only good language :x.

*facepalm*

You just gave the lion some meat. Brace for impact.
[SIGPIC][/SIGPIC]
[Image: Viper-Adjusted-Mini-Sig.png]
[Image: Trixie-Mini-Sig-Fixed.png]

Fighting to the bitter end is an advantage when your opponent does not wish to perish.
Reply
#38
Vad Wrote:*facepalm*

You just gave the lion some meat. Brace for impact.

Uh... not really. Thanks, though.
Quote: "for a quarter million a year growing weed, i'd fucking be gay. with dick on the side." - Laura, on mairjuana
Reply
#39
Josh Wrote:You make it sound as if C++ is the only good language :x.

We all know that English is the only good language.
[Image: Teemer2003.png]
Reply
#40
Metal Teemer Wrote:We all know that English is the only good language.

:o SWAHILI IS THE SHIT!
[Image: Ashe.jpg]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)