fbpx

IT Solutions

Create MyOwnAutoShop class which contains the main() method. Perform the following within the main() method. ◦Create an instance of Sedan class and initialize all the fields with appropriate values. Use super(…) method in the constructor for initializing the fields of the superclass. ◦Create two instances of the Ford class and initialize all the fields with appropriate values. Use super(…) method in the constructor for initializing the fields of the super class. www.oumstudents.tk ◦Create an instance of Car class and initialize all the fields with appropriate values. Display the sale prices of all instance.

Solutions

Write an applet that asks the user to enter two floating‐point numbers, obtains the two numbers from the user and draws their sum, product (multiplication), difference and quotient (division). Use the techniques shown in example.

Solutions

Write a complete Java application to prompt the user for the double radius of a sphere, and call method sphereVolumeto calculate and display the volume of the sphere. Use the following statement to calculate the volume:

Solutions

Write a Java program that reads a string from the keyboard, and outputs the string twice in a row, first all uppercase and next all lowercase. If, for instance, the string “Hello” is given, the output will be “HELLOhello”

Solutions

Create a class called Date that includes three pieces of information as instance variables—a month (typeint), a day (typeint) and a year (typeint). Your class should have a constructor that initializes the three instance variables and assumes that the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day and year separated by forward slashes(/). Write a test application named DateTest that demonstrates classDate’s capabilities.

Solutions

Write a program that calculates and prints the product of three integers.

Solutions

Create a super class called Car. The Car class has the following fields and methods. ◦intspeed; ◦doubleregularPrice; ◦Stringcolor; ◦doublegetSalePrice();

Solutions

What is the this Pointer?

Solutions

Create an applet that can display the following component. No event handling is needed for the components.

Solutions

Temperature Conversion a. Write a temperature conversion applet that converts from Fahrenheit to Celsius. The Fahrenheit temperature should be entered from the keyboard (via a JTextField). A JLabel should be used to display the converted temperature. Use the following formula for the conversion: Celcius = ((5/9)*(Ferenheit‐32)). b. Enhance the temperature conversion applet of Q1 by adding the Kelvin temperature scale. The applet should also allow the user to make conversions between any two scales. Use the following formula for the conversion between Kelvin and Celsius (in addition to the formulain Q1): Kelvin = Celcius + 273.15

Solutions

Can't find an answer to your question?