3. The Car class (subclass) inherits the attributes and methods from the Vehicle class (superclass). And every car has model. Please also add toString method to the Car class to print out the brand, and model of the car.
Class Vehicle {
protected String brand; // Vehicle attribute
Vehicle() // Vehicle constructor
{
Brand = “Ford”;
}
public void honk() { // Vehicle method
System.out.println("Tuut, tuut!");
}
}
Please help write the Car class. (10 marks)
Write a subroutine named "printDayofWeek" that will output the day of the week for a given number. Use Swtich-case. For example, the command "1” would output “Sunday”. (10 marks)
1. Write pseudo code that prints the smallest value among a list of numbers. (10 marks)
The assignment will contain 4 departments as four different object classes
i) Super Department
ii) Admin Department
iii) Hr Department
iv) Tech Department
Unit 4 Programming Assignment In this assignment, you will again modify your Quiz program from the previous assignment. You will create a separate class for quiz questions, and you will create objects of that class to ask questions and check answers. This assignment will include multiple cut-and-paste operations from the existing "Quiz" class into the new "MultipleChoiceQuestion" class. Object-oriented programming is designed to avoid cut and paste, and you will see some of the techniques for re-using existing code in the next assignment. In this assignment, however, you will be converting from procedural programming to object-oriented programming, and cut-and-paste is a simple strategy for this conversion.
Give an example of a class and an example of an object. Describe what a class is, what an object is, and how they are related. Use your examples to illustrate the descriptions.
Your Discussion should be at least 250 words in length, but not more than 750 words.
The class shown below keeps track of a pressure sensor in a laboratory. When a Sensor object is created using the first constructor, the initial pressure is set to zero. When it is created using the second constructor it is set to the value of the parameter. The pressure should not be set to a value less than zero. Therefore, if the input parameter to the setPressure method is a negative number, the pressure should not be changed and a value of false should be returned. If the pressure is set successfully, a value of true should be returned. (a) Write the code for the Sensor class. (b)
Make a class student. The student class has data members such a sroll number, name, branch. Create a class called exam that has data members roll number and six subject marks. Derive the result class from student and exam it has own data members such a total mark, and result. Write a Java program to model the relationships.
Input
A line containing an integer.
35Output
A line containing a string.
OutDesign an application that will allow a user to keep track of the amount of tennis matches won by three professional tennis players. The user should be presented with a menu using the numbers 1, 2 and 3 that corresponds to the tennis players below. Tennis Players: 1. Novak Djokovic 2. Andy Murray 3. Roger Federer Prompt the user to choose a tennis player who has won a match from the menu using the numbers 1, 2 or 3; else the user enters 0 to quit. If the user chooses 1, 2 or 3, show the input section again and if the user then chooses 0, show a breakdown of the amount of matches won by each tennis player. Please note that menu items appear in the Console window. Menu items do not need to be created. Your output should also display the amount of games that have been captured. Make use of a method to get the input from the user and another method to increment the games won by the player. In your solution make provision for if a user has entered in an invalid tennis player number.