Objective: Your goal is to have a jeroo beautify the Island. Instantiate a jeroo with 8 flowers in its pouch and have the jeroo plant the flowers in the pattern below Download these beginning-activites
Objective: Your goal is to have a jeroo beautify the Island. Instantiate a jeroo with 8 flowers in its pouch and have the jeroo plant the flowers in the pattern below Download these beginning-activites
You have a lot of flexibility in creating this class, but here is what it should be able to do
It’s up to you to decide how to implement the functionality below. You will only lose credit if your methods clearly make no sense, have bad variable names/method names.
The functionality above ^^ can be implemented in any efficient way that makes sense, but it must be implemented. I am leaving that part up to you!
Constructor
instance Variables
Accesor Methods
Now, let’s refactor our class relationships to represent our new Iheritance Tree
Create the following class
Circle
Constructor
instance Variables
Accesor Methods
How can we improve our current class structure?
We are going to create a second “Generation” of classes and will denote this change by appending a ‘2’ to the names of all classes in this “generation”
Constructor
public Polygon2(int _col, double _width, double _height, int _sides)
instance Variables
Methods
instance Variables
None needed (see superclass)
Accesor Methods //override each of the superclass
instance Variables
None needed (see superclass)
Accesor Methods //override each of the superclass
InteractiveMath2 InteractiveMath2
Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100; the centurial years that are exactly divisible by 400 are still leap years. For example, the year 1900 was not a leap year; the year 2000 was a leap year
Call | return value |
isLeapYear(100) | false |
isLeapYear(4) | true |
isLeapYear(104) | true |
isLeapYear(400) | true |
isLeapYear(800) | true |
isLeapYear(5) | false |
isLeapYear(803) | false |
I . write bool isLeapYear( int year) : returns true or false depending on whether or not input is a leap year.
II. write a function called int secondsSince( int usersBYear, int usersBmonth, int usersBDay) .
This function should return the number of seconds since that bithdate (year, month, day)
III. In Main: use cout and cin to ask user for their bithdate and then display how many seconds since that person’s bithdate
IV. Determine how many seconds have occurred since 0/0/0 .
A PlayList project will be based on 3 Classes
The Artist class will store core information about an artist.
The Song class will store basic information about a song.
The PlayList class will manage a list of artists and their ratings.
Tester files:
Example of instantiating an Artist object and calling one of its methods:
1 2 3 |
Artist redHotChilliPeppers = new Artist("Red Hot Chili Peppers") ; redHotChilliPeppers.addSong( new Song("Snow") ); ArrayList<Song> chiliSongs =redHotChilliPeppers.getSongs() ; |
Example of instantiating a Song object :
1 2 |
Artist redHotChilliPeppers = new Artist("Red Hot Chili Peppers") ; Song underBridge = new Song (redHotChilliPeppers , "Under the Bridge") ; |
Mutator Methods
The method’s below are extra credit. If you figure out how to do them, you must also meet with me after school about the methods. To receive the extra credit, be prepared for a mini-quiz on how they work. Be prepared for me to ask about your solution and how changing certain parts of your code would affect your solution. This meeting must happen on the Monday or Wednesday following the deadline.
When you’re done this, begin exploring different sorting algorithms with this online sorting detective :
https://labs.penjee.com/sort-detective/
1 |
MPG = miles/gallons |
In the formula, C is the Centigrade temperature and F is the Fahrenheit temperature. Create a world in which the user is asked to enter a Fahrenheit temperature. Use a math expression to convert the temperature to Centigrade and store the converted temperature in a variable. Use a character from the People
collection to say the centigrade temperature.
People
collection. When you play the world, it should ask the user how for the radius of a circle. (This value should be stored in a variable ). The person should then say the area and the circumference of the circle.(circumference formula , area of a circle) (For an extra point do the same thing with a “Sphere”. Ask the user for the radius and calculate the .Part II
FanLoop
world on the Student CD so it asks the user for the number of times the fan blades should rotate. Use this value in the Loop
statement to control the number of times the roll
method is called.Vehicles
collection).Create an infinite loop that causes the sea plane to do a circular loop the loop. Adjust the style and duration editing tags to make the animation fast, and as smooth as possible.