Ask Question, Ask an Expert


Ask Java Expert

Home >> Java

problem: Ra Row Your Boat

Create a world with a boat, a person sitting in the boat, an island, and a pier located 25 meters from the island. In the world shown below, Ra (Egypt) is sitting in a rowboat (Vehicles). Create a method to make the Ra object row the boat 25 meters from the island to a pier (Beach). One suggested way to do this would be to create the methods: row LeftandrowRight(to control the arms’ motions), controlTorsoAndHead(to control back and head motions), and startRowand stopRow(to put Ra’s body in and out of the rowing position).

problem: Robot Preparing for Competition

In this project, your goal is to create a motion controller for a robot (Ranger from Scifi). You will create specific methods that allow the robot to perform warm-up actions for itsupcoming competition.

Create the following methods to help the robot warm up for it’s competition:

armSwing: the robot swings it’s arms back and forth across the front of it’s body
headShake: the robot’s visor flips back so it’s head is showing. Then it rocks it’s head right, left, back, forth. Then rotates its head left and right.
jumpUpAndDown: the robot jumps up and down
Your own method: Think of one other action for the robot and make a method for it.

Create the following keyboard controls:

When the “A” key is pressed, the robot swings its arms.
When the “H” key is pressed, the robot shakes its head.
When the “J” key is pressed, the robot jumps up and down.

problem: Help the Snowman get Home

Create a game where the goal is to move the snowman through a forest to get him home to his igloo. The hazard in this game is that if the snowman gets too close to a tree, he moves back 10 meters. Add the snowman (People), a snowboard (skateboard from Skatepark - change the is Showing for the wheels to false), an igloo (Buildings), and eight pineTrees (Nature). Set the vehicle for the snowman to be the skateboard. Create an event so that the skateboard can be controlled by game player, by typing the arrow keys.

Create a method for the skateboard named checkForCollisionWithTrees. If the skateboard’s distance to the pine tree is less than 3.75 meters, then move the skateboard back 10 meters. In this method, you will need to check each tree in the scene. When you have the If/Else working for one tree, then copy it for each of the other trees.

To have Alice constantly check for collisions with the trees, create a When the World Starts event. Then change it to While the World is Running (a right click on the event pops up a menu so it can be changed). In the during section of the While the World is Running event, call the checkForCollisionWithTrees.

In order to check whether the player has won the game, create a method named checkIfHomefor the skateboard. If the skateboard gets close to the igloo, display a 3D text object that proclaims “I’m Home!” To make the 3D text flash, add a loop that repeatedly sets the 3D text is Showing property to false and then true.

problem: Drinking Parrot

A small toy popular with children is a drinking parrot. The parrot is positioned in front of a container of water and its body given a push. Because of the counterbalance of weights on either end of its body, the parrot repeatedly lowers its head into the water. Create a simulation of the drinking parrot (Objects). Use an infinite Loop statement to make the parrot drink.

Hint: We used the blender object (Kitchen gallery), pushed the base into the ground, deleted the lid, and changed the color of the blender to blue to simulate a bucket of water.

problem: Why Did the Chicken Cross the Road?

A popular child’s riddle is, “Why did the chicken cross the road?” Of course, there are many answers. In this project, the chicken (Animals) has a real sweet-tooth and crosses the road to eat the gumdrops (Kitchen/Food) along the way.

prepare a game animation where the player guides the chicken across the road to get to the gumdrops. Cars and other vehicles should move in both directions as the chicken tries to cross to where the gumdrops are located. Use arrow keys to make the chicken jump left, right, forward, and back. Use the space bar to have the chicken peck at the gumdrop. When the chicken is close enough to the gumdrop and pecks, the gumdrop should disappear.

A recursive method is used to control the play of the game. If the chicken gets hit by a vehicle, the game is over (squish!). The game continues as long as the chicken has not managed to peck all the gumdrops and has not yet been squished by a vehicle. If the chicken manages to cross the road and peck at all the gumdrops along the way, the player wins the game. Signal the player’s success by making 3D text “You Win” appear or by playing some triumphant sound.

problem: Frog Crossing the Pool

Add a rectangle (Shapes) to a new world and change its color to blue. This will serve as a swimming pool. Add seven circles (Shapes) to the world—five yellow along the long side of the pool (each one meter apart), one green at the nearest side, and one red at the far edge. The yellow circles are lily pads that float back and forth across the pool. Add a frog, and place it on the green circle. The goal is to make the frog jump from lily pad to lily pad until it gets all the way across the pool. If the frog lands on the water (not on a lily pad), the frog sinks into the pool and the game is over. If the frog jumps all the way across the pool and lands on the red circle at the far edge, the player wins.

Your program must place the five yellow circles in a list. prepare a method that uses an infinite loop to repeatedly move each of the five yellow circles in the list across the pool and back at different speeds. (The easiest way to do this is to pass a random number to the method to specify the duration for the circle to move across the pool.) Create event handling methods that have the frog jump forward 1 meter if the player presses the key, move left if the player presses the key, and move right if the player presses the key. Connect each event handling method to an event.

problem: Record and Play a Song

The goal of this project is to allow users to record their own song and play it back. This project is an extension of project 5, from Chapter 5. If you already created the AlicePiano project, reuse it for this project. Otherwise, please refer back to project 5, Ch. 5, and create the project, as described. To the AlicePiano world created in Ch. 5 project 5, add four control “buttons.” These buttons can be created using different shapes and 3D text, as shown in the screen capture below.

The four buttons will be used to:

• Start recording—start recording a song
• Stop recording—stop recording this song
• Play recording—play the latest recorded song
• Clear recording—erase the latest recorded song

To record a song, the user first clicks the Rec button and then clicks on the piano keys to create a sequence of notes. As the user clicks each note, the note is played (to give feedback to the user) and is also recorded. To record the notes, create a world-level list named newSong. Initially, the newSonglist is empty, but during the recording process notes are added to the end of the list. To stop the recording, the user clicks the StopRecbutton.

Hint: In a recording studio, a “RECORDING IN PROGRESS” sign lights up when the microphones are on and the artist is playing. You must create a similar signal to let Alice know when to record and when not to record notes in the newSonglist. Try using a Boolean variable named recording. It should be set to true when recording but false when recording stops. Any methods that play a note should check this condition before recording the note (or not).

Java, Programming

  • Category:- Java
  • Reference No.:- M9160

Have any Question? 

Related Questions in Java

Question 1 illustrate that the nodes of any avl tree t can

Question 1. Illustrate that the nodes of any AVL tree T can be colored "red" and "black" so that T becomes a red-black tree. Question 2. Illustrate that via AVL single rotation, any binary search tree T1 can be transform ...

1 problem overviewyou have been asked to design and

1 Problem Overview You have been asked to design and implement a training system for company directors. In the best tradition of economics, we shall start by making things up. The training system is intended to show peop ...

Animal characteristicsin todays fast-paced world it is

Animal characteristics In today's fast-paced world, it is important for programmers to think about potential future changes that impact their programs. One way that software developers can address this concern is by desi ...

As we have discussed in class section 41 of our text

As we have discussed in class, section 4.1 of our text develops a List ADT and then offers two different implementations of it in the classes AList and LList. The ADT is defined in a Java interface file, and bo ...

This assignment is based on the principles of clock

This assignment is based on the principles of clock consistency and associated drifts in a distributed system. You have to create a simulation, running on a single machine, of a simple distributed system involving four p ...

Develop an application in java to accept the number of

Develop an application in Java to accept the number of students in a section for a subject and for each student accept the student number, Student name, prelim marks, midterm marks, final marks. The final grade should be ...

Topic java part a airline seatingmillions of commercial

Topic: Java Part A: Airline seating Millions of commercial airline flights cross the world's cities every year, and each one of these flights must solve what seems like a simple problem: how do you arrange where each pas ...

Java question1write an application that prompts a user for

JAVA Question 1. Write an application that prompts a user for a month, day, and year. Display a message that specifies whether the entered date is not this year, in an earlier month this year, in a later month this year, ...

Java programmingnow that your survey class has been

Java programming Now that your Survey class has been implemented, it is time to implement the SurveyConductor application class. This class uses the Survey class to conduct a survey. First, create pseudocode to develop t ...

Java programmingyou have been asked by your manager to

Java programming You have been asked by your manager to create a user-friendly application that will present a survey to your customers. The application will compile and analyze the results entered by the survey responde ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate