programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Jeanne Boyarsky
• Ron McLeod
• Paul Clapham
• Liutauras Vilda
Sheriffs:
• paul wheaton
• Rob Spoor
• Devaka Cooray
Saloon Keepers:
• Stephan van Hulst
• Tim Holloway
• Carey Brown
• Frits Walraven
• Tim Moores
Bartenders:
• Mikalai Zaikin

# help needed with questions

Greenhorn
Posts: 1
• Number of slices to send:
Optional 'thank-you' note:

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
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]

Sheriff
Posts: 17652
300
• Number of slices to send:
Optional 'thank-you' note:
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.

Ranch Hand
Posts: 36
• Number of slices to send:
Optional 'thank-you' note:
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

Ranch Hand
Posts: 1272
• Number of slices to send:
Optional 'thank-you' note:
You said that these were exam questions.

The teachers must be pretty liberal down there (you do realize that they read this board too).

 Aaaaaand ... we're on the march. Stylin. Get with it tiny ad. a bit of art, as a gift, that will fit in a stocking https://gardener-gift.com