Java

Only available on StudyMode
  • Download(s) : 90
  • Published : December 3, 2012
Open Document
Text Preview
Java Problems

SEQUENCE PROBLEMS:

1. Create a Java program that will print the sum of two integers. 2. Print the sum and product of three integers.
3. Print the perimeter and area of a rectangle.
4. Given the number of a baseball team’s wins and losses, compute its winning percentage. Assume that there are no ties. 5. Input the number of a team’s wins, losses, and ties, and print its winning percentage. Assume that a tie game counts as a full game played and a half-game won. 6. Given the list price of an item and the rate of discount, print the amount of the discount and the net price. 7. Given the list and net prices of an item, find the amount of discount and the percent (rate) of discount. 8. Input the total amount of a sales and the sales tax rate, find the amount of tax and the net sale after taxes. 9. The withholding tax on a weekly salary (let us assume) is computed as follows: 14% of the difference between a person's gross pay and $13 times the number of dependents he or she claims. Read the values for the gross pay and the number of dependents; print the withholding tax. 10. Input the amount of food ordered and then output the amount to be paid when a sales tax of 4% is to be added to the cost. 11. Employees at a certain company have won a 6.5% pay increase. Input the old salary and then output his new salary. 12. Input your height in feet and then convert it to inches and centimeters. 13. Input the length of a side of a square and then output its perimeter and area. 14. Input the price of an item bought at sale. Subtract 20% from the original price and print the new price. 15. Input the price of an apple bought at a store and its rate of discount and then output the amount of discount and the net price. 16. A flower shop sells roses for P50 each, orchids for P80 each, and tulips for P90 each. Write a Java program that would input the number of roses, orchids, and tulips a customer bought and output the total cost.

Java PROBLEMS: (Selection...
tracking img