0% found this document useful (0 votes)
10 views2 pages

Class Program

The document outlines the specifications for two classes: Student and Eshop. The Student class includes member variables for name, age, marks, and allocated stream, along with methods to accept input, allocate streams based on marks, and display student information. The Eshop class includes member variables for item name and price, with methods to accept item details, calculate discounts based on price ranges, and display the net amount to be paid.

Uploaded by

tutor nag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Class Program

The document outlines the specifications for two classes: Student and Eshop. The Student class includes member variables for name, age, marks, and allocated stream, along with methods to accept input, allocate streams based on marks, and display student information. The Eshop class includes member variables for item name and price, with methods to accept item details, calculate discounts based on price ranges, and display the net amount to be paid.

Uploaded by

tutor nag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Define a class called with the following Class name: Student

specifications:
Member variables:
Class name: Eshop name — name of student
age — age of student
Member variables: mks — marks obtained
String name: name of the item purchased stream — stream allocated
double price: Price of the item purchased
(Declare the variables using appropriate data types)
Member methods:
void accept(): Accept the name and the price of the Member methods:
item using the methods of Scanner class. void accept() — Accept name, age and marks using
void calculate(): To calculate the net amount to be methods of Scanner class.
paid by a customer, based on the following criteria: void allocation() — Allocate the stream as per
following criteria:
Price Discount
1000 – 25000 5.0% mks stream
25001 – 57000 7.5 % >= 300 Science and Computer
57001 – 100000 10.0% >= 200 and < 300 Commerce and Computer
More than 100000 15.0 % >= 75 and < 200 Arts and Animation
void display(): To display the name of the item and < 75 Try Again
the net amount to be paid. void print() – Display student name, age, mks and
stream allocated.
Write the main method to create an object and call
the above methods. Call all the above methods in main method using an
object.
Define a class called with the following Class name: Student
specifications: Write the main method
Class name: Eshop
Write the main method Member variables:
name — name of student
Member variables: age — age of student
String name: name of the item purchased mks — marks obtained
double price: Price of the item purchased stream — stream allocated

Accept the name and the price of the item using the (Declare the variables using appropriate data types)
methods of Scanner class.
To calculate the net amount to be paid by a Accept name, age and marks using methods of
customer, based on the following criteria: Scanner class.
Allocate the stream as per following criteria:
Price Discount
1000 – 25000 5.0% mks stream
25001 – 57000 7.5 % >= 300 Science and Computer
57001 – 100000 10.0% >= 200 and < 300 Commerce and Computer
More than 100000 15.0 % >= 75 and < 200 Arts and Animation
To display the name of the item and the net amount < 75 Try Again
to be paid. Display student name, age, mks and stream
allocated.

You might also like