Advertisements
Advertisements
Question
Identify the literal given below:
0.5
Solution
Real Literal
APPEARS IN
RELATED QUESTIONS
What are the values stored in variables r1 and r2:
(i) double r1=Math.abs(Math.min(-2.83,-5.83));
(ii) double r2=Math.sqrt(Math.floor(16.3));
Define a class named ParkingLot with the following description :
Instance variables/data members:
int vno — To store the vehicle number
int hours — To store the number of hours the vehicle is parked in the parking lot
double bill — Tb store the bill amount
Member methods:
void input( ) — To input and store the vno and hours.
void calculate( ) — To compute the parking charge at the rate of Rs.3 for the first hours or part thereof, and Rs. 1.50 for each additional hour or part thereof.
void display ( ) — To display the detail
Write a main method to create an object of the class and call the above methods.
Identify the statement given below as assignment, increment, method invocation or object creation statement.
System.out.println(“Java”);
Design a class with the following specifications:
Class name: | Student |
Member variables: | name - name of student age - age of student mks - marks obtained stream - stream allocated (Declare,the, variables using appropriate data types) |
Member methods:
void accept() - | Accept name, age and marks using methods of Scanner class. |
void allocation() - | Allocate the stream as per following criteria: |
" mks | stream |
>=300 | Science and Computer |
>=200 and <300 | Commerce and Computer |
>=75 and 200 | Arts and Animation |
<75 | Try Again |
void print() Display student name, age, mks and stream allocated.
Call all the above methods in main method using an object.