tony edward

Greenhorn

Posts: 1

posted 13 years ago

could someone please help me with these 3 exam questions

it would mean a lot to me.

Question 1:

The ALL-IN-ONE STORE needs to increase the price of all items by 7,5%. Prompt the user to enter the item number and also to enter the item current price. Calculate the new price and display the item number and the new price. Example:

Enter the item number:

89VF34

Enter the item price:

24.34

Answer:

Item number = 89VF34

New item price = 26.1655

[5]

Question 2:

Write a Java application that prompt the user to enter the price of fuel per liter, the distance in kilometers traveled and the distance the car travels per liter. Calculate and display the cost of the fuel for the distance traveled. Example:

Enter the price of fuel per liter:

4.51

Enter the distance in km traveled:

45

Enter the distance the car travels per liter:

13

The cost of fuel for the distance traveled = R15.6115384

[10]

Question 3:

Write a Java application that prompts the user to enter John�s gross monthly salary. The pension fund contribution is 8% of his salary. The tax takes 20% of his taxable salary (gross salary � pension) and he pays R425 for medical aid. Display his gross salary, total deductions and net salary.

[15]

it would mean a lot to me.

Question 1:

The ALL-IN-ONE STORE needs to increase the price of all items by 7,5%. Prompt the user to enter the item number and also to enter the item current price. Calculate the new price and display the item number and the new price. Example:

Enter the item number:

89VF34

Enter the item price:

24.34

Answer:

Item number = 89VF34

New item price = 26.1655

[5]

Question 2:

Write a Java application that prompt the user to enter the price of fuel per liter, the distance in kilometers traveled and the distance the car travels per liter. Calculate and display the cost of the fuel for the distance traveled. Example:

Enter the price of fuel per liter:

4.51

Enter the distance in km traveled:

45

Enter the distance the car travels per liter:

13

The cost of fuel for the distance traveled = R15.6115384

[10]

Question 3:

Write a Java application that prompts the user to enter John�s gross monthly salary. The pension fund contribution is 8% of his salary. The tax takes 20% of his taxable salary (gross salary � pension) and he pays R425 for medical aid. Display his gross salary, total deductions and net salary.

[15]

posted 13 years ago

If you have any specific questions regarding the programs that

**you**are writing to solve these, we'd be glad to help. Apart from that, we're usually not in the habit of doing people's homework for them. Sorry.*Practice only makes habit, only perfect practice makes perfect.
Practice mindfully by doing the right things and doing things right.*— Junilu

[How to Ask Questions] [How to Answer Questions]

celine mcgowan

Ranch Hand

Posts: 36

posted 13 years ago

Hi Tony,

Junilu is right - no-one will do your homework for you. But don't be too disappointed - it's a ploy they have here to make you learn Java!!! Anywho, the problems you have are simple enough - as long as you know where to start...

So, go to your local library (or maybe look at your Java course notes!) and find out how to write a very simple class in Java. Then find out how to do maths in Java. Once the maths is finished, most of your work is done. Just one more step - you'll need to know how to get input from the user & how to return output to the user. Any good java book or set of notes will cover these topics in the first couple of chapters/sections.

Build what you do up slowly but surely & you'll be amazed how quickly you get there. If you get stuck the people here are really, really helpful so post any questions you like!!!

Good luck with it!

Celine

Junilu is right - no-one will do your homework for you. But don't be too disappointed - it's a ploy they have here to make you learn Java!!! Anywho, the problems you have are simple enough - as long as you know where to start...

So, go to your local library (or maybe look at your Java course notes!) and find out how to write a very simple class in Java. Then find out how to do maths in Java. Once the maths is finished, most of your work is done. Just one more step - you'll need to know how to get input from the user & how to return output to the user. Any good java book or set of notes will cover these topics in the first couple of chapters/sections.

Build what you do up slowly but surely & you'll be amazed how quickly you get there. If you get stuck the people here are really, really helpful so post any questions you like!!!

Good luck with it!

Celine

We've heard that a million monkeys at a million keyboards would eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true.<br />- Robert Wilensky