the logical structure in which one instruction occurs after another with no branching in java
to develop an object-oriented application. They provide trucks, cars, and bikes on rent for a maximum period of 5 days, and if the number of days increases they double the rent for the extra days. They have different cars like luxury, sports and ordinary and all of them are powered by both electricity and petrol while trucks have only petrol option. In the case of bikes, they have electric street-bike and sportbikes have only petrol option. Further, the choice of the customer for the trucks is based upon weight, length, and wheels. The owner of the company can add, view and update vehicle, customer, and employee information.
Create a Java Project With Your name as “YourNameProjectQNo1”, add a class to this Project, Class name should be Your Name with Your Reg No as “YourNameYourRegNo”
a. Add a Method to Accept names and marks of n students from user, enter the value of n from User
b. Ensure that valid data is entered. If user enters an invalid data, then appropriate message should be displayed using Message Dialog Box e.g. ‘Name cannot be a number’ or ‘Marks must be an integer value’
c. Add another Method, to Display this data in descending order according to marks such that name of student.
Q.No.2. Design an abstract class GeometricObject with lineColor as data member. GeometricObject must ensure that its children implement calcArea() method. [Marks : 03]
Design RectangleYourRegNo and CircleYourName Classes as children of GeometricObject class with overridden toString() method to return “Rectangle with w Width and h Height is drawn” OR “Circle with r Radius is drawn”. The attributes of Rectangle are length, width. The attribute of Circle is radius
Hint: Area of circle=πr2 , Area of rectangle= width*length
You have the String marks="60";
You want to use marks in in the method grading(int mk) which receives the marks and the return the corresponding grade. Which processing must be doe to marks for it to work ?
Create a class called with your Reg No, as Invoice18Arid876, that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables a part number (type String), a part description (type String),a quantity of the item being purchased (type int) and a price per item (double).
Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. In addition, provide a method named getInvoice Amount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0.0. Write a test application named InvoiceTestYourName that demonstrates class Invoice’s capabilities.
Suppose that the input is:
38 35 71 14 -1
What is the output of the following code? Assume all variables are properly declared.
sum = console.nextInt();
num = console.nextInt();
for (j = 1; j <= 3; j++)
num = console.nextInt();
sum = sum + num;
System.out.println("Sum = " + sum);
The college that you attend requires an application that will print out a Course Report. You are required to create an application that will allocate the following course data:
DISD DIWD DIDM
Diploma in Software Development Diploma in Web Development Diploma in Data Metrics
35 28 39
Mr Jones Mrs Smith Mr Ntsinga
Create a class named Course_Details that will contain get and set methods for the course name, student numbers and lecturer. In the Course_Details class include a method called Assign Venue that will randomly generate a Venue/Class for the course. Venues can be from 1 to 3 only. Your main class must include a static method to handle the printing of the course report.
Input option of choices of course details should be displayed in a dialog box.
Suppose that you have the following declaration:
int j = 0;
The output of the statement:
if ((8 > 4) || (j++ == 7))
System.out.println("j = " + j); is:
j = 0
while the output of the statement:
if ((8 > 4) | (j++ == 7))
System.out.println("j = " + j);
j = 1
Write a class with name ArrayDemo . This class has an array which should be initialized by user as given below. write a function with name display in this class.Call this display function in main function. [4 marks]
-1 4 1 6 3 8 5 10 7 12