The Students Allotted With The Is Available at The End of The Document

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

CSE 1007 - Programming in JAVA

Assessment - 2 .
L 31+L32 - Time : 2.00 - 3.30 pm Date : 06/09/2021
Faculty : Prof. A. Anitha
General Instructions

The students allotted with the question number is available at the


end of the document.
1. Write your Name, Regno, Course code, Course Title, Slot on the top of the word
document.

2. Copy the allotted question along with the question number and paste on the word
document, which you are about to submit.

3. Compile both the source (.java) program and (output) files in the same word
document and make it as a single PDF file and upload as a single program. The
program should be followed by its output.

Please follow the deadline and the time. ie. The students have to upload their pdf
before their Lab session or can take at the maximum five minutes after the Lab
session gets over. The Assessment cannot be submitted after the deadline. The Vtop
doesn’t have the option for late submission, so if the student fails to submit the
assignment, the mark for the assignment will be provided as ZERO.

1. Write an abstract class with an abstract method double Pizza (double size, double
beverage). Create a subclass Offer and calculate the bill amount. Create another
subclass Tax to get the CGST,SGSTrates and print the bill as below.
2. Create a super class Point with two instance variable x and y which indicate the x-y
coordinates of the point. It contains a default constructor which initializes a point
in origin and a parameterized constructor which initializes a user-specified point.

Create a sub class Line that extends Point class. The constructor of Line class,
should create a new Point object to denote the end point of the line The starting
point of the line is automatically created when it extends the Point class.

A new class Triangle inherits the Line class.


Write a program to create the triangle from the origin and another triangle which
takes input from the user. Now change the Point class to abstract class. Call the
methods using the object of triangle class.

3. Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram,


Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Create and
use a Point class to represent the points in each shape. Make the hierarchy as deep
(i.e., as many levels) as possible. Specify the instance variables and methods for each
class. The private instance variables of Quadrilateral should be the x-y coordinate
pairs for the four endpoints of the Quadrilateral. Write a program that instantiates
objects of your classes and outputs each object’s area (except Quadrilateral).

4. Create a new class Car with the following methods:


 public void start()
 public void stop()
 public int drive(int howlong)

a) The method drive() has to return the total distance driven


by the car for the specified time. Use the following formula to
calculate the distance:
Distance = howlong* 60;
b) Write another class CarOwner and that creates an
instance of the object Car and call its methods. The result of
each method call has to be printed using System. out.println().
c) Create a subclass of Car named JamesBondCar and
override the method drive() there. Use the following formula to
calculate the distance:
Distance = howlong* 180;
d) Be creative, print some funny messages!!!

Sl.no REGISTER Question Faculty Marks


NO Name of the student number incharge /10
1 REGISTER 1 Anitha
NO NAME
2 16BIT0042 SOHIT BAGGA 2 Anitha
3 18BIT0290 HIMANSHU MISHRA 3 Anitha
4 18BIT0292 TUSHAR MADHWANI 4 Anitha
5 18BIT0355 SOUMAK PODDAR 1 Anitha
6 THIPPAREDDY RAJA SATYA 2 Anitha
19BIT0013 VARDHANA REDDY
7 19BIT0029 KULAKARNI RISHITEJ RAO 3 Anitha
8 19BIT0173 RAAVI SHIVA SESHI REDDY 4 Anitha
9 19BIT0230 JAI CHAUDHURY 1 Anitha
10 19BIT0243 VIHAAN SIRUPURAPU 2 Anitha
11 19BIT0258 DHIREN RAJESH 3 Anitha
12 19BIT0358 TUSHAR KUMAR B P 4 Anitha
13 20BIT0035 ANMOL GUGLANI 1 Anitha
14 20BIT0056 DHRUV CHAWLA 2 Anitha
15 20BIT0057 PENDHARI SANIYA SWAPNIL 3 Anitha
16 20BIT0117 SAUDAMINI SHAIL 4 Anitha
17 20BIT0134 ABHISHEK RAJ 1 Anitha
18 20BIT0140 PARTH SUNIL DHORE 2 Anitha
19 20BIT0150 SANJAY NITHIN S 3 Anitha
20 20BIT0153 HANEET ARYA 4 Anitha
21 20BIT0160 CHARVI GARG 1 Anitha
22 20BIT0164 HARSH SINGH 2 Anitha
23 20BIT0168 SHARON DHAWAN 3 Anitha
24 20BIT0175 ISHANI CHOWDHURY 4 Anitha
25 20BIT0176 ANANYA GROVER 1 Anitha
26 20BIT0188 ADIT WANI 2 Anitha
27 20BIT0193 DHAKSHANA MOORTHI G 3 Anitha
28 GUVVALA RAMA DHEERAJ 4 Anitha
20BIT0209 REDDY
29 20BIT0214 SANCHIT SAH 1 Anitha
30 20BIT0215 BHAVYA NAGPAL 2 Anitha
31 20BIT0236 AANCHAL PATEL 3 Anitha
32 20BIT0244 AMARNATH A 4 Anitha
33 20BIT0249 ADITYA RAJ 1 Anitha
34 20BIT0252 AKSHAT VERMA 2 Anitha
35 20BIT0255 ANUSHA GARG 3 Anitha
36 20BIT0257 SUYASH RAJU PATIL 4 Jayashree
37 20BIT0263 MANSI GUJRAL 1 Jayashree
38 20BIT0268 ASTHA JHA 2 Jayashree
39 20BIT0269 AKSHAT AGARWAL 3 Jayashree
40 20BIT0271 NEHA SINGH 4 Jayashree
41 20BIT0273 SANSKAR SINHA 1 Jayashree
42 20BIT0276 HARDEK S KAPIL 2 Jayashree
43 20BIT0277 VANSH MAKADIA 3 Jayashree
44 20BIT0291 KARAN PANDYA 4 Jayashree
45 20BIT0339 RAHUL AGNIHOTRI 1 Jayashree
46 20BIT0348 R H SANJAY 2 Jayashree
47 20BIT0350 SHRUTI KIRTI 3 Jayashree
48 20BIT0353 SHRIYANSH SINHA 4 Jayashree
49 20BIT0357 SOMPURA DHRUV UMESH 1 Jayashree
50 20BIT0361 ANKIT YADAV 2 Jayashree
51 KANKARIYA RUSHABH 3 Jayashree
20BIT0362 DINESH
52 20BIT0363 SOMANI ANANYA ALOK 4 Jayashree
53 20BIT0372 REDDYPALLI REHAN 1 Jayashree
54 20BIT0377 PARTHVI SINGH 2 Jayashree
55 20BIT0395 B. KAUSHIK RAO 3 Jayashree
56 20BIT0403 ABHISHEK K B 4 Jayashree
57 20BIT0405 KACHAM TEJESH 1 Jayashree
58 20BIT0410 RIYA KHATWANI 2 Jayashree
59 20BIT0415 MOULIK SINGH ARORA 3 Jayashree
60 20BIT0418 DIVYANSHU KUMAR 4 Jayashree
61 20BIT0423 RANOJ BHOWMIK 1 Jayashree
62 20BIT0432 SOORAJ SINGH 2 Jayashree
63 20BIT0434 HARDIK MAHESHWARI 3 Jayashree
64 20BIT0438 ASMIT 4 Jayashree
65 20BIT0452 PRASHANT RAJ 1 Jayashree

You might also like