Question
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use handwriting. Given the code above: Find the errors (either
Please, i need Unique answer, Use your own words (don't copy and paste).
*Please, don't use handwriting.
Given the code above:
- Find the errors (either compile or run-time error) so that you have the same output listed below then state the type of the error.
- After you fixed the errors, rewrite the Java code using your name (Emad)
- Show a screenshot of the output (if there is no screenshot of the output, the student shall get a zero mark for this question).
_______________________________________
Q2
Consider the following java application consisting of two classes, and then answer the questions below.
- Find and fix the errors in the previous application.
- What is the output of the previous application? (What will be printed on the console window when CarTester class is executed)?
- What are the values of (model) and (year) variables for the object variable car1 and why?
_______________
Q3
Write a program that asks the user to enter two integers and then print:
The sum
The difference
The product
The average
The maximum (the larger of the two)
The minimum (the smaller of the two)
Hint: The max and min functions are declared in the Math class.
_________________________
Q4
- Create a class "Mobile" with the following specifications: brand, color, screen size and camera size as field.
- Declare the instance variableswith suitable data types.
- Define a constructor that allow the initialization of all the data of a mobileby specific values.
- Define all the needed getter methods: getBrand(), getColor(), getScreen() and getCamera().
- Write a tester class. In the main, create twophones then, display the details of each one.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started