Java Programming Problems Worth Solving, Questions and Answers
- The manager of a basketball stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets – box, sideline, premium, and general admission. After each game, data is stored …
- Draw a table of base-class member accessibility in a derived class. Discuss the ways in which inheritance saves time during program development and helps prevent errors.
- Draw an inheritance hierarchy for students at a university similar to the hierarchy shown in above fig. use student as the superclass of the hierarchy, then extend Student with classes undergraduateStudent and graduateStudent. Cont…
- Implement the shape hierarchy show in the figure below. Each twoDimensionalShape should contain method getArea to calculate the area of the two-dimensional shape. Each threeDimensionalShape should have methods getArea and getVolume…
- A company pays its employees on a weekly basis. The employees are of four types: Salaried employees are paid a fixed weekly salary regardless of the number of hours worked, hourly employees are paid by the hour and receive “time-and-a…
- Create a class Saving Account. Use a static variable annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance indicating the amount the …
- Implement the Shape hierarchy shown in Figure below. Each TwoDimensionalShape should contain method getArea to calculate the area of the two-dimensional shape. Each ThreeDimensionalShape should have methods getArea and getVolume to ca…
- a) Define the class bankAccount to store a bank customer’s account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide the following operations: set the a…
- Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market, to attract customers as well as meet with their specific needs. Two of the most commonly used accounts are savings and checki…