This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Challenge for beginners

 
Anuttama Das
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really need your help!
As part of another certification, they presented me the following task for a very beginner java programmer. I have little time to deep into the book! even I have plan to try to understand Java but MY DEADLINE is soon! I hope I'm not being so comfortably but I suspect for some of you this is a really easy task. Not for me!
This is the task:
a. Create a class named Commission that includes three variables: a double sales figure, a double commission rate, and an int commission rate. Create two overloaded methods named computeCommission (). The first method takes two double parameters representing sales and rate, multiplies them, and then displays the results. The second method takes two parameters: a double sales figure and an integer commission rate. This method must divide the commission rate figure by 100.0 before multiplying by the sales figure and displaying the commission. Supply appropriate values for the variables, and write a main () method that tests each overloaded method. Save the file as Commission.java
b. Add a third overloaded method to the Commission application you created in Exercise 1a. The third overloaded method takes a single parameter representing sales. When this method is called, the commission rate is assumed to be 7.5% and the results are displayed. To test this method, add an appropriate call in the Commission program's main () method. Save the application as Commission2.java
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch You're not asking us to do the job for you, are you ? If so, check HowToAskQuestionsOnJavaRanch. Especially, NotACodeMill and DoYourOwnHomework. If you have a specific problem, something you don't understand, please tell us what it is.
 
Thomas Young
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Post removed - don't spoil the surprise!]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The task looks quite basic, and the description pretty much says step by step exactly what you have to do. Are there specific things in the description that you do not understand? If yes, then please tell us what exactly you do not understand. Did you already write some code yourself? If yes, post it here, and tell us where you got stuck.
 
Campbell Ritchie
Sheriff
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, always tell us what the thread is about.
 
James Elsey
Ranch Hand
Posts: 228
Android IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That should be a walk in the park for most beginners.

Post up the code that you have so far, and people will let you know if its correct, or ways of improving it etc

Ask specific questions if you get stuck, you will learn better than having someone giving you the code
 
Ninad Kuchekar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Elsey wrote:That should be a walk in the park for most beginners.


Ahhh...the honeymoon days...I wish all tasks were as lethargic as this...

What is in name, Task by any other name would be as simple in Java...

Before any one says anything, I admit,... worst quote ever...

@Anuttama : Could you at least begin writing the code, and post what you have reached up to. We could help you further.

-Ninad
 
Campbell Ritchie
Sheriff
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you know what lethargic means?
 
Ninad Kuchekar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Are you sure you know what lethargic means?


Ans: Yes, I do.

<light-bulb>It was ironic!</light-bulb>
 
Campbell Ritchie
Sheriff
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We never have lethargic tasks round here . . . only lethargic students
 
Ninad Kuchekar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:We never have lethargic tasks round here . . . only lethargic students


Hey that's a personified task...


Ninad Kuchekar wrote:I wish all tasks were as lethargic as this...

Sorry I just meant it as an irony...I thought the "thumbs up" would give away the irony....

Back to Anuttama, have had any luck in kicking off??


-Ninad
 
Campbell Ritchie
Sheriff
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree our students are tasks . . . whether they are personified, however, I am never quite sure
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic