Question: Norksheet 1 1 In the main ( ) method, declare and integer variable x . Using a loop, print a countdown from x to 0
Norksheet
In the main method, declare and integer variable Using a loop, print a countdown from to
Write two methods
a One to compute the average of two numbers.
Will this method require any inputs?
Will it have a return value?
b Another method that prints the current age of a student when given the year of birth.
Will this method require any inputs?
Will it have a return value?
Consider the methods you wrote in Q:
a Can you write the preconditions
b Can you write the postconditions?
c Can you write some statements that detect when the precondition is violated and print a message?
Create Project called Practice: Then create a class to represent
a Pizza
b Student
c Car
d Television
Choose another object and come up with three fields. For now, choose fields that are able to be represented as a letter, number, or truefalse primitive data types Please format in pseudoUML. Must describe an individual thing, not a set. For example: shoe size vs number of shoes
Shoe size is a description of one pair of shoes
Number of shoes is a description of a collection of shoes
Open Eclipse and create a project called DogApplication. Create a class based on the following UML:
Dog
isBulldog : boolean
age : int
Add a driver class to the DogApplication project
DogDriver
Create a constructor in the Dog class that takes two input parameters and uses those parameters to initialize the instance variables.
In the main method inside the driver class, declare a variable of type Dog call it myDog and instantiate it with value of your choice.
In the main method inside the driver class, declare a variable of type Dog call it yourDog Instantiate it with appropriate values so that it represents a yearold bulldog.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
