Академический Документы
Профессиональный Документы
Культура Документы
1. Write an application to report time available in minutes & seconds if total no. of
seconds (e.g: 500) are given.
2. Write an application to find average of “n” elements of array and find out the count
regarding how many element are above average.
3. Write a program to create an array of float-type and size "n" (where "n" is taken as input
from user). Perform the following tasks on this array:
a) finding average of all elements and printing how many elements in array are above
average.
b) type-convert all elements of array into short-type and insert them in new array and
display the resulting array.
5. Write an application to create TV class having following features that work if TV is on:
6. Write an application that calculates and displays the weekly salary for an employee.
The main() method prompts the user for an hourly pay rate, regular hours, and
overtime hours. Create a separate method to calculate overtime pay, which is regular
hours times the pay rate plus overtime hours times 1.5 times the pay rate; return the
result to the main() method to be displayed. Save the program as Salary.java.
7. When gasoline is $100 per barrel, then the consumer’s price at the pump is between
$3.50 and $4.00 per gallon. Create a class named GasPrices. Its main() method holds
an integer variable named pricePerBarrel to which you will assign a value entered by
a user at the keyboard. Create a method to which you pass pricePerBarrel. The method
displays the range of possible prices per gallon. For example, if gas is $120 per barrel,
then the price at the pump should be between $4.20 and $4.80. Save the application
as GasPrices.java.