Grn Xtrm 84 Posting Pro in Training

This doesnt really have anything to do with Java or software development for that matter. Make sure your posting in the right forum next time you start a thread. This question is probably best suited for the computer science forum.

Grn Xtrm 84 Posting Pro in Training

You don't need to use the & in printf statements. It is only needed when scanning.
Also, when you try to print the variable b, you should use the format specifier for double values. The %d is used for ints. %f can be used for numbers with decimal points.

Grn Xtrm 84 Posting Pro in Training

yes I know that. but how can I make it work?

Hmm. I'm not so sure you do because you are still writing int main() with a capital 'I'. Try running the code and post the errors being reported by the compiler. Also, use code tags when posting code in the future.

Grn Xtrm 84 Posting Pro in Training

Most things in programming shouldn't start with an uppercase letter (at least in C anyway)
data types are lowercase and so is printf
Also you have redeclaration of b. And you use b and B interchangeable which you can't do.
This whole code is really a mess. You need to review the basics of declraing variables and issues relating to syntax.
Your not going to be able to write any programs if you can't understand the basics of syntax.

Grn Xtrm 84 Posting Pro in Training

Learning the basics of HTML is quite easy using a book or website. If all you need to do is create a basic web page, learn about tables and some of the more prevalent HTML tags. This should be enough to create a basic page.
I think this is a pretty good place to start.
http://www.w3schools.com/html/html_primary.asp#
Good luck. :)

Grn Xtrm 84 Posting Pro in Training

Number of the Beast by Iron Maiden. This is the next cover my band wants to do, so I gotta learn the bass line by Friday. Making good progress. :)

Ezzaral commented: Great song! +0
Grn Xtrm 84 Posting Pro in Training

I knew you would say that because that is number 2 in your list of important things. lol

LOL. Just trying to enforce the rules of the forum. ;)

Grn Xtrm 84 Posting Pro in Training

Glad to help. Please mark the thread solved if you have no further questions. Thanks. :)

Grn Xtrm 84 Posting Pro in Training

@OP
Your teacher probably meant to use only one cout statement per shape. It doesn't seem possible to print 4 different figures with only one cout statement in the entire program. But, hey I can be wrong.
You should send an email to your teacher to clarify the problem.

Grn Xtrm 84 Posting Pro in Training

In your if statement use

if(denom==0)

When using if statements you need to use the comparrison operator(==) not the assignment operator (=).
See if that works for you.

EDIT
Looks like sfuo beat me to it by a few seconds. LOL.

I'll also take this oppurtunity to suggest that you include prompts for the user before they enter a number.

Grn Xtrm 84 Posting Pro in Training

Sounds good :) I'll be starting piano lessons soon, expensive though. When I'm bored, I'll try something new, for example i've started getting into photography now, here are some I've taken fairly recently.

William, great pictures. I especially like the Lighting up the Path pic. They look very professional. Keep up the good work.
Also, good luck with piano. Learning an instrument takes lots of patience and practice.

Grn Xtrm 84 Posting Pro in Training

<snipped> Nevermind that was a bad post, sorry.

Grn Xtrm 84 Posting Pro in Training

Use an if else statement.

if(number is greater than 9)
System.out.println("Illegal entry");
else
//run code

In the else block include the code that executes the program.

Grn Xtrm 84 Posting Pro in Training

Dear, initialization means giving some starting value to the variables you declare. If we don't initialize variables, they may contain any unpredictable value. This often leads to wrong results. So if your compiler is reporting that your variable is uninitialised, just initialise them with some starting value.

This thread has already been solved. The whole point of marking a thread solved is so people don't waste their time posting in it.

Grn Xtrm 84 Posting Pro in Training

Is that so...??? I didn't know it... Thought he too is one among those guys who post their requirements and ask us to code... ;)

Well he was originally. I had to post and ask him to show effort. Then he slopped some code together and posted it.

Grn Xtrm 84 Posting Pro in Training

Do you have all the files relating to this project saved in the same file or directory? That may be causing the problem.

Grn Xtrm 84 Posting Pro in Training

the compiler does not see the isValidStudent() as a method of Student class.

Yes I understand that. There may be a syntax error in your Student class that is causing the problem. That is why I asked to see the code for the Student class. Thanks.

Grn Xtrm 84 Posting Pro in Training

I think it would be easier for us to help if you post the Student class as well. It would help if we can see how and where your methods are defined. Thanks

Grn Xtrm 84 Posting Pro in Training

Ok ... So ?

He posted his code in the Geek's Lounge for some reason. Without code tags of course. ;)

Grn Xtrm 84 Posting Pro in Training

This is not the right place for help with an assignment. Post it on the thread on the c++ forum.

Grn Xtrm 84 Posting Pro in Training

Sorry about your teacher but we can't help you until you show some effort. We can't just do your homework for you. You won't learn anything that way. Post the code you have tried and we will be glad to help make corrections and suggestions.
Remember to use code tags when posting code.

Grn Xtrm 84 Posting Pro in Training

Don't post your homework in the Geek's Lounge. I have already seen this same question posted in the c++ forum. Show some effort and look for your answers there.

Grn Xtrm 84 Posting Pro in Training

Hi there
Please, can someone help me with my Computer Science class 160?
It's about machine cycle (LOAD, ADD, JUMP...) and algorithm.

Start a new thread, this one is 7 years old. ;)

Grn Xtrm 84 Posting Pro in Training

% is the modulus operator.
Read this for more info.
http://www.cprogramming.com/tutorial/modulus.html

Grn Xtrm 84 Posting Pro in Training

The problem may be the 2 semicolons in line 5.

Grn Xtrm 84 Posting Pro in Training

Remember, I was trying to get people talking. I wanted your opinions, not to convince you I was right.

Well you definitely got people talking. This thread recieved more than 150 replies in only 9 days. I just hope you learned something useful from this experience. Hope to see you around the software dev forums in the future. (remember no outrageous personal opinions, just help for those who need it) ;)
Regards
~Tom.

Grn Xtrm 84 Posting Pro in Training

Thats what we are here for. Great working with you.

Grn Xtrm 84 Posting Pro in Training

System.out.println() goes to the next line. While print() stays on the same line. Looking over your code I see a few pint statements. Change them to println to go to the next line.

Grn Xtrm 84 Posting Pro in Training

Bible game? Sounds boring. ;)

Grn Xtrm 84 Posting Pro in Training

You already have the cases written for the operations. Just add the default.

switch (operations)
     {
         case '+':
         OperationS=" plus" ;
         Result = Num1 + Num2;
         
         case '-':
         OperationS=" minus" ;
         Result = Num1 - Num2;
         
     case '*':
         OperationS=" multiplied by " ;
         Result = Num1 * Num2;
         
     case '/':
         OperationS=" divided by " ;
         Result = Num1 / Num2;
             case '^':
         OperationS=" to the power of" ;
         Result = (int) (Math.pow(Num1, Num2));
                 
                 default: System.out.println("Illegal operation");
               break;

         operationsOK=false;

     }

This way the default will run anytime an illegal operation is input. Its always good to have defaults in switch statements to test for illegal input.

Grn Xtrm 84 Posting Pro in Training

alright, i have that, i have just one more thing left, i need to get it to say that if i input a symbol/char other then +,-,/,^,* that it outputs " Invalid Operations"
Would u put this in the operation case?

I would make that the default case in the operations switch statement.

Grn Xtrm 84 Posting Pro in Training

Alright that fixed that part, now the last thing is that the output is not the correct way, its still putting a # instead of a word. IE 6 should be Six

I think you want to print Num1S instead of Num1. Same for num2. You want the string values not the ints.

Grn Xtrm 84 Posting Pro in Training

The println() shouldn't end with a plus sign either. ;)
But that shouldn't clear up the problem regarding initialization.
Try it and post back word for word what the compiler says.

Grn Xtrm 84 Posting Pro in Training

i took those out, have been messing with this code for a few days now, still the last line, the System.out.println( + Num1 + .....); is still saying it has a illegal start of expression.

Don't start the inside of the println() with a plus sign. See if that works. And for the future, post your current code, not one from a few days ago. Thanks.

Grn Xtrm 84 Posting Pro in Training

Line 174-- you have an extra semicolon and right parenthesis at the end of the statement.
It showed up as a smiley face on your first post because you didnt use code tags. That's one of the many reasons why we stress the use of code tags so much around here. ;)

Grn Xtrm 84 Posting Pro in Training

Did you remove these braces too?

{
System.out.println(+ Num1 + OperationS + + Num2 + " is " + Result +) ;

}

Please repost your revised code using code tags to make it easier to read

Grn Xtrm 84 Posting Pro in Training

Your problem is here

System.out.print("Enter your first number ");
Num1 = scan.nextInt();
{
if (Num1 > 9 || Num1 < 0)
System.out.println(" Must be a Number between 0 and 9");
}

Why are you including this code in a block {}. Braces are not needed here. You make the same mistake a little further down as well.
One more thing. You should include break; in your switch statements.
Also, please use code tags when posting your code. Thanks.

Grn Xtrm 84 Posting Pro in Training

No one's gonna send you code. Try to do it yourself and we will try to help you with your problems.

Grn Xtrm 84 Posting Pro in Training

This line should be giving you a problem:

Scanner.out.println ("Enter larger number first : "); //request the input of the first interger

Change Scanner to System.
Also use code tags when posting code. Thanks
Also when doing switch cases there is no need to enclose the case number in parentheses.

Grn Xtrm 84 Posting Pro in Training

You gotta show effort in order for us to help. Show your code and post questions relating to the code. We won't just do your homework for you.

Grn Xtrm 84 Posting Pro in Training

You are missing an & in the third scanf. Try to make this correction. Also use code tags next time you post code. Thanks.
EDIT
You should also use int main() and set a return value of zero.

Grn Xtrm 84 Posting Pro in Training

Open up your c++ implementation program and start typing.
But seriously, show some effort and we'll be glad to help. Post your code and questions about the code.

Grn Xtrm 84 Posting Pro in Training

We really do want to help, but you have to show some effort before we do that. Post the code you have using code tags so we can make corrections and help guide you. We are not here to just do your homework for you.

Grn Xtrm 84 Posting Pro in Training

Wow where should I start with this one?
First you posted the same question twice, that's a big no-no here.
You did not show any effort.
You didn't ask any questions.
And you didn't post any code using code tags.
I dont think anyone will be helping you until you follow the rules.

Grn Xtrm 84 Posting Pro in Training

Do you have a question or are you just showing off your code? ;)
Why the double post? This code was probably meant for your other thread, yes?

Grn Xtrm 84 Posting Pro in Training

My life according to The Beatles

Are you a male or female?
Boys

Describe yourself:
I am the Walrus

How do you feel?
I Feel Fine

Describe where you currently live:
Penny Lane

If you could go anywhere, where would you go?:
Octopus's Garden

What is your favorite form of transportation:
Yellow Submarine

Your best friend[s] is[are]:
Sgt. Pepper's Lonely Hearts Club Band

You and your best friends are:
With a Little Help from My Friends

What's the weather like?:
Here Comes the Sun

Favourite time of day?
A Hard Day's Night

If your life was a TV show, what would it be called?
Something

What is life to you?
Revolution

Your current relationship?
Can't Buy Me love

Your greatest fear?
Help!

What is the best advice you have to give?
Get Back

Thought for the Day?
Come Together

How would you like to die?
When I Get Home

Your soul's present condition is:
I Want You (She'sSo Heavy)

Your motto is:
All You Need Is Love

Great game Jason. :)
I'd like to hear what others would have put for the Beatles. Maybe I could have made better choices.

Grn Xtrm 84 Posting Pro in Training

What I cannot understand is why this idiotic discussion has been allowed to continue, the OP is eithera troll or a narrow minded person who is unable to accept the views of others. Close the thread please!

Agreed, this thread stopped being entertaining about 12 pages ago.
@The Mad Hatter
This is a vast community. You should share your knowledge and help people who are having problems with their hardware or programming problems. Just don't impose your views on people there. They ask questions and you provide assistance. And bouns: you get to be mean to people who don't show effort on their work. What more can you ask for? ;)

nav33n commented: correct! +0
Grn Xtrm 84 Posting Pro in Training

I'd probably use an array to store the values. Then maybe use if statements to compare the values. Then add the values and divide by the number of elements in the array to find the average. This is just my first impression, I'm sure others will suggest better ways to go about this.

Grn Xtrm 84 Posting Pro in Training

Maybe I am misunderstanding the question, but if your gonna count 1000 pumpkins then use a for loop that goes from 1 to 1000, and read in the wieghts of the pumpkins.

Grn Xtrm 84 Posting Pro in Training

I hate it when they write the assignment word for word and don't even try to venture a guess. :@