Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't know how to solve these problem2~problem6 I put BlueDot code in last part. Could you solve these problems? If you don't know, just

I don't know how to solve these problem2~problem6

I put BlueDot code in last part.

Could you solve these problems?

If you don't know, just solve problem2 plz.

Problem 2: Pump It Up!

In the context of the NPW, write a program called PumpItUp within the npw package to paint an image of the Pump It Up dance floor, much like the one depicted below.

image text in transcribed

Constraints:

  1. Use the technique of modifying an existing program that does something similar. Do so by: (a) Creating a new Java Main Class file for the program, naming it PumpItUp and placing it in the npw package. (b) Replacing the entire contents of the PumpItUp file with the entire contents of the BlueDot program.
  2. (c) Changing all occurrences of BlueDot to PumpItUp.
  3. Place the following code, without alteration, in the paintTheImage method.

    1

    2

    3

    4

    5

    6

    SPainter painter = new SPainter("Pump It Up",600,600);

    SSquare square = new SSquare(150);

    paintYellowSquare(painter,square);

    paintRedSquares(painter,square);

    paintBlueSquares(painter,square);

    paintGraySquares(painter,square);

    Then: (a) Use IntelliJs hints to add necessary import statements. (b) Use the light bulbs to create a stub for each of the unrefined program. (You should create 4 stubs.)
  4. One at a time, complete the definitions of the methods, proceeding as follows: (a) Run the program, and see that not much happens. (b) Refine the paintYellowSquare method, run the program, enjoy the yellow square. (c) Refine the paintRedSquares method, being sure to make it invariant with respect to both the location and heading of the painter, run the program, enjoy the yellow square and the red squares. (d) Refine the paintBlueSquares method, being sure to make it invariant with respect to both the location and heading of the painter, run the program, enjoy the yellow square and the red squares and the blue squares. (e) Refine the paintGraySquares method, being sure to make it invariant with respect to both the location and heading of the painter, run the program, and enjoy looking at the dance floor!

Problem 3: Dots

In the context of the NPW, write a program called Dots within the npw package to paint an image consisting exclusively of dots (painted circles) subject to the following constraints:

  1. it contains exactly 9 painted (filled in) circles
  2. it contains circles of exactly 4 different sizes
  3. it contains circles of exactly 4 different colors
  4. none of the circles touch
  5. the image is symmetric about the Y-axis
  6. not all of the circles touch the Y-axis

Problem 4: Two Figure Minuet Thing

In the context of the MMW, write a program called TwoFigureMinuetThing within the mmw package to play the exact same sequence of ten notes that is played by the following program, subject to the constraint that you may not use any SComposer objects. Thus, you will have to write the program using only an SNote object.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

/*

* Ten note line created by joining two JSB minuet figures.

*/

package mmw;

import composer.SComposer;

public class TwoFigureMinuetThing {

public static void main(String[] args) {

SComposer sc = new SComposer();

sc.text();

sc.mms_35_JSB_M9();

sc.mms_35_JSB_M13();

}

}

Problem 5: Landscape and Motion Sequence Viewer

In the context of the MMW, write a program called LandscapeAndMotionListener within the mmw package to simply play each of the melodic sequences related to landscapes (e.g., hills) and motion (e.g., strolling) that are listed in the back of your lab manual and available in the MMW, in such a way that they are textually displayed. Do so by using Task 4 of Lab 2 as a model. That is, work by explicit analogy with the program featured in that task.

Problem 6: Hilly Journey

Write a program called HillyJourney within the mmw package to play a melody composed exclusively of the figures available in MMW which relate to landscapes and motion, subject to the following additional constraints:

  1. The melody will consist of between 40 and 45 notes.
  2. The melody will make use of exactly 6 different modular melodic sequences, all related to either motion or landscapes.
  3. At least one sequence will be related to hills, and at least one will be from the sequences related to motion.
  4. The final note will be a long C note

image text in transcribed

Pump It Up a pumpitup C o Q Database Sant Tanpa File Edit View Navigate Code Analyze Refactor Build Run Tools VCS Window Help CS1 C:WUser WMSIWIdeaProjectsWCSI - .. WachinpwwblueDotjava CS1] - Intelli IDEA 051) se npw BlueDut Project - Red.java Pumpltlp.java Blue Detja si ChusersericeaProjects package npw; idea out 3 import java.awt.Color; import javax.swing. SwingUtilities; import painler.5Painler; BlueDot import shapes.SCircle; Pumpitulp Redx public class BlueDul { C. CS1.im SimpleComposer Cusers MSDesktopSecomp 18 SOLUTION / lilli External Libraries Scratches and Consoles private void paint The Image () { SPainter kloe - now Spainter 1: "alue Dot", w. see, h: 500); Scircle dul = new Scircler 200); klcc.setColor(Color.BLUE); klee.paint(dot); /**REQUIRED INFRASTRUCTURE**/ public BlueDot() { paint The Image(); : Structure public static void main(String[] args) { SwingUlilities. Invokeluler(new Ruminable() { public void run() { now BlueDotO; * 2: Farurtesi BlueDot * 8 TODO Terminal Fantlog 4 spaces 2 322 UTF-8 12 . et e e 2020-02-17 Pump It Up a pumpitup C o Q Database Sant Tanpa File Edit View Navigate Code Analyze Refactor Build Run Tools VCS Window Help CS1 C:WUser WMSIWIdeaProjectsWCSI - .. WachinpwwblueDotjava CS1] - Intelli IDEA 051) se npw BlueDut Project - Red.java Pumpltlp.java Blue Detja si ChusersericeaProjects package npw; idea out 3 import java.awt.Color; import javax.swing. SwingUtilities; import painler.5Painler; BlueDot import shapes.SCircle; Pumpitulp Redx public class BlueDul { C. CS1.im SimpleComposer Cusers MSDesktopSecomp 18 SOLUTION / lilli External Libraries Scratches and Consoles private void paint The Image () { SPainter kloe - now Spainter 1: "alue Dot", w. see, h: 500); Scircle dul = new Scircler 200); klcc.setColor(Color.BLUE); klee.paint(dot); /**REQUIRED INFRASTRUCTURE**/ public BlueDot() { paint The Image(); : Structure public static void main(String[] args) { SwingUlilities. Invokeluler(new Ruminable() { public void run() { now BlueDotO; * 2: Farurtesi BlueDot * 8 TODO Terminal Fantlog 4 spaces 2 322 UTF-8 12 . et e e 2020-02-17

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

Show how aspartame can be synthesized using DCC.

Answered: 1 week ago

Question

Q: Please describe your companys selection process.

Answered: 1 week ago

Question

=+7 How has the COVID-19 pandemic impacted the operations of IHRM?

Answered: 1 week ago