The following warnings occurred:
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.5.12 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/printthread.php(287) : eval()'d code 2 errorHandler->error_callback
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



CDBZ Archive
Java Programmers? - Printable Version

+- CDBZ Archive (http://alex.zulenka.com)
+-- Forum: Out of Character Forums (http://alex.zulenka.com/forumdisplay.php?fid=8)
+--- Forum: The Legendary Asylum (http://alex.zulenka.com/forumdisplay.php?fid=133)
+--- Thread: Java Programmers? (/showthread.php?tid=14735)

Pages: 1 2 3


Java Programmers? - Josh - 10-05-2009

Binary all the way!


Java Programmers? - Vad - 10-05-2009

Amen, brutha!


Java Programmers? - Josh - 10-06-2009

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



Java Programmers? - Vad - 10-06-2009

Yeah, that was a daily occurrence two quarters ago back in March.


Java Programmers? - Josh - 10-06-2009

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.


Java Programmers? - Vad - 10-06-2009

We nearly killed the instructor and forced her to just teach us the code.


Java Programmers? - Josh - 10-06-2009

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.


Java Programmers? - Vad - 10-06-2009

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#.


Java Programmers? - Josh - 10-06-2009

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.


Java Programmers? - Vad - 10-06-2009

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.


Java Programmers? - Sage - 10-06-2009

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.


Java Programmers? - Josh - 10-06-2009

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.


Java Programmers? - Tyr - 10-06-2009

Rouge..?!


Java Programmers? - Josh - 10-06-2009

Cerion Wrote:Rouge..?!

Yes, the rouge class...

It's a red ninja...

Yah >.>


Java Programmers? - Jack - 10-06-2009

Well done. I didn't know any of you guys knew any C++, I thought you were all PHP and shit.


Java Programmers? - Josh - 10-06-2009

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.


Java Programmers? - Vad - 10-06-2009

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.


Java Programmers? - Jack - 10-06-2009

Vad Wrote:*facepalm*

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

Uh... not really. Thanks, though.


Java Programmers? - Kole T. Merr - 10-08-2009

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.


Java Programmers? - Ashe - 10-08-2009

Metal Teemer Wrote:We all know that English is the only good language.

:o SWAHILI IS THE SHIT!