Fantasy Game

hi. i am doing some exercise problems on this charlotte website.

http://chortle.ccsu.edu/java5/cs151java.html#13

Very good website for a newbie who wants to learn java. and hopefully i am confident That after working all the exercise problems and reading the chapters i will be good in java as a matter of fact i am doing very good. anyways i dont understand what the author is trying to ask in the question.

Q) In a new role-playing fantasy game players must design their character by picking a point value for each of three characteristics:

Strength, from 1 to 10

Health, from 1 to 10

Luck, from 1 to 10

Write a program that asks for a name for the character and asks for the point value of for each of the three characteristics. However, the total points must be less than 15. If the total exceeds 15, then 5 points are assigned to each characteristic

output :

Welcome to Yertle's Quest

Enter the name of your character:

Chortle

Enter strength (1-10):

8

Enter health (1-10):

4

Enter luck (1-10):

6

You have give your character too many points! Default values have been assigned:

Chortle, strength: 5, health: 5, luck: 5

p.s: (This user interface could get much more complicated. You might want to implement some of your own ideas.)

i know i need to use if and else statement. i need a variable by the name of total and set a condition that if total is greater than 15 then just print the output as you see above. but he dont say anything about the total < 15. do i need to just print the total for charlotte or what ?

i had my interview today for a software developer position. The employer ask me all kind of statements for loops methods and all that stuff which i was able to answer but then she ask me definition about (ENcapsulation, inheritance, java sql and java applet). i just had Java programming in my resume. Y the employer thought that i knew about java sql or java applet or java swing. That is totally wrong i was so pissed off. i did'nt knew what to say and i can assume that i will fail my interview but this ridiculous.

[2217 byte] By [fastmikea] at [2007-11-26 12:22:28]
# 1

> i had my interview today for a software developer

> position. The employer ask me all kind of statements

> for loops methods and all that stuff which i was able

> to answer but then she ask me definition about

> (ENcapsulation, inheritance, java sql and java

> applet). i just had Java programming in my resume. Y

> the employer thought that i knew about java sql or

> java applet or java swing. That is totally wrong i

> was so pissed off. i did'nt knew what to say and i

> can assume that i will fail my interview but this

> ridiculous.

yep. this > (ENcapsulation, inheritance, java sql and java applet). are very important if you are to apply for a Java Developer.

=)

Redxxiva at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 2

import java.util.Scanner;

class fantasyGame {

public static void main(String args[]) {

Scanner scan = new Scanner(System.in);

String name;

int strength;

int health;

int luck;

int total;

System.out.println("Welcome to Yertle's Quest");

System.out.println("Enter the name of your character");

name = scan.nextLine();

System.out.println("Enter Strength: (0 to 10) ");

strength = scan.nextInt();

System.out.println("Enter Health: (0 to 10) ");

health = scan.nextInt();

System.out.println("Enter Luck: (0 to 10) ");

luck = scan.nextInt();

total = strength + health + luck;

if(total >15){

System.out.println("You have give your character too many points! Default values have been assigned:");

System.out.println(name);

System.out.print("strength: 5, health: 5, luck: 5");

}

else {

System.out.println("The total for your game is " +total);

}

}

}

Is this what he wants?

fastmikea at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 3

>>yep. this > (ENcapsulation, inheritance, java sql and java applet). are very important if you are to apply for a Java Developer.

I know how the methods work and what is OO programming but that does not mean i need to remember encapsulation and inheritance and you are wrong if i just have msaccess in my resume the employer should never think that i will know how to design a database in ORACLE

fastmikea at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 4
> I know how the methods work and what is OO> programming but that does not mean i need to remember> encapsulation and inheritance and you are wrongWhy would you forget in the first place?=)
Redxxiva at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 5

> Is this what he wants?

The question as you posted it doesn't actually say, but I would guess he wants

you to add an else part to that for statement.if(total > 15) {

// what you have

} else {

// print the name and the values that were entered

// for health strength and luck.

}

pbrockway2a at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 6

>>Why would you forget in the first place?

True i guess i have not been writing programs in 2 years since i took all my majors computer classes first and then all of those theory subjects now. and we write all our programs in c++ but now recently like 4 months ago i started reading about java i like it. but most of the authors did not tell you what an encapsulation is or inheritance they will tell you about parameters boolean expression and all that stuff but i knew i read in my programming language class about encapsulation and inheritance. she could have simply ask me OO Methadology? or OO design? grrr anyways its over so now i have all the **** definitions which is necessary for software developer job. + y java sql y java applet? y java swing ? oh and yes since she asked me all these sql, applet, and swing she could have asked me about java networking, 3d grrr i am just pissed of that how an employer think that if you know java u know j2ee or everything in java. may be she was not that much qualified i told her that it would be good if she can ask me more about programming questions like array, vectors rather than definitions and she said oh Thanks alot i will forward your resume to my supervisor dont know what that means but i am sure she will fail me. :(

fastmikea at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 7
Thanks pb just wanted to make sure .
fastmikea at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 8

> >>Why would you forget in the first place?

> True i guess i have not been writing programs in 2

> years since i took all my majors computer classes

> first and then all of those theory subjects now. and

> we write all our programs in c++ but now recently

> like 4 months ago i started reading about java i like

> it. but most of the authors did not tell you what an

> encapsulation is or inheritance they will tell you

> about parameters boolean expression and all that

> stuff but i knew i read in my programming language

> class about encapsulation and inheritance. she could

> have simply ask me OO Methadology? or OO design? grrr

> anyways its over so now i have all the ****

> definitions which is necessary for software developer

> job. + y java sql y java applet? y java swing ? oh

> and yes since she asked me all these sql, applet, and

> swing she could have asked me about java networking,

> 3d grrr i am just pissed of that how an employer

> think that if you know java u know j2ee or everything

> in java. may be she was not that much qualified i

> told her that it would be good if she can ask me more

> about programming questions like array, vectors

> rather than definitions and she said oh Thanks alot i

> will forward your resume to my supervisor dont know

> what that means but i am sure she will fail me. :(

That's ok. "Maybe" they'll be needing those skills.

Java is really broad and all.

My First Job as a Java Developer, we were also given so much of a task ranging from (Swing, Applets, Networking, J2EE, J2ME).

But it doesn't look fair.

(As to Job Description is concerned)

=)

...

Redxxiva at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 9

hmm That makes alot of sense but the problem was she contacted me by looking at my resume on monster.com and she called me and told me they were looking for software developer and she would like to set an interview with me. Thats it. This means that i got to learn more and more within 6 months before i graduate. classes, swing, j2ee applet. oh wow no more movies just learning and learning .

Thanks

fastmikea at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 10
go get her!hehe..=)
Redxxiva at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 11

You seem to be under the false assumption that programming is easy. Even people who have been programming for years might have trouble with some areas they haven't used. You just have to learn as much as possible about the things you assume you'll need.

Also could you start writing your native language (assumedly) properly, I'm sure you can manage to write out "why" instead of shortening it to "y". It reduces legibility when you write like that...

-Kayaman-a at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 12

> I know how the methods work and what is OO

> programming but that does not mean i need to remember

> encapsulation and inheritance and you are wrong if i

> just have msaccess in my resume the employer should

> never think that i will know how to design a database

> in ORACLE

The point is that almost all Java programming in the industry involves web servers, databases etc.. I'm affraid that you won't be of much use to many employers until you get your head arround them.

As to encapsulation and inheritance, understanding such things is the difference between a object oriented programmer and just a programmer. You can write Java without much understanding of OOP, and you can program in OOP in languages that provide little or no support for it. It's a way of thinking more than a language feature.

malcolmmca at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 13

They have the right to ask you about your knowledge of ORACLE if that's what they are looking for. If they contact you based on java and MSAccess, you probably won't have to have full DBA skills, but they probably want to know if you can create a table if you have to. I do agree though that you have to know a lot to call yourself a good Java programmer! But do not fear, there is always an employer that will give you the chance to your first get experience. After that it's just a matter of picking up every little thing you can use in the future.

I have to agree with previous poster that OOP is a way of thinking. It's not a programming language feature! C++ also allows you to program object oriented! In my first year at university, OOP was drilled into my mind. We used a language called Oberon! Since you say you know what OO programming is, you should really know what encapsulation and inheritance are. They're some of the key features of OOP!

Peetzorea at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 14

> >>yep. this > (ENcapsulation, inheritance, java sql

> and java applet). are very important if you are to

> apply for a Java Developer.

> I know how the methods work and what is OO

> programming but that does not mean i need to remember

> encapsulation and inheritance and you are wrong

No, you are wrong. If you are going to write quality OO software, you must know whant encapsulation and inheritance are and how to use them.

jverda at 2007-7-7 15:15:49 > top of Java-index,Archived Forums,Socket Programming...
# 15

> told her that it would be good if she can ask me more

> about programming questions like array, vectors

Knowing about arrays and vectors and the like is important, but it's very basic, and much easier to learn quickly than the OO stuff that you're complaining about.

> what that means but i am sure she will fail me. :(

Based on your attitude, that sounds like a wise decision.

jverda at 2007-7-7 15:15:51 > top of Java-index,Archived Forums,Socket Programming...
# 16
?
Redxxiva at 2007-7-7 15:15:51 > top of Java-index,Archived Forums,Socket Programming...