首页 > > 详细

Java辅导Class、Java程序TCP、UDP、JSP等辅导 Let's Make a Class辅导留学生Java语言

Java,Class,OOP。
 

Overview

Throughout this course, you have been using and modifying classes that have been predefined for you (World, Turtle, Picture etc.) In this assignment you will be creating a slideshow of images and sounds using 2 brand new classes that you will be creating! This is one of the coolest (and most important) parts about Object-Oriented Programming, and you will have to bring together all the knowledge you’ve accumulated over this quarter to get this done. Let’s get it done!!!

Important Note: This assignment leaves certain details of the solution implementation up to you. This makes the assignment more interesting, as it forces you to be creative about how you decide to implement the solution, and it also tests your complete understanding of all the material presented in this class.

This PSA is worth 20 points total, allocated as follows.

  • Creating new java classes
  • Style and Comments
  • Program Description

As you have to work with a partner for this PSA, please review the guidelines for pair programming. (Remember that you have to work with a partner for each PSA). In addition, note the following details about working with a partner:

  • You must engage in true pair programming as described in the guidelines for pair programming.
  • You must work with the SAME partner for both parts A and B.
  • You and your partner will work on ONE partner’s account, on ONE version of the code.
  • You will submit only ONE submission for the entire PSA8 between the two of you.

How It Should Work

The slideshow should work like this:

  • When we run your program, we should see a series of images (“slides”) appear one at a time, accompanied by a sound. The program should not prompt for input files using the FileChooser, but rather, the files you would like to use can simply be uploaded in the same directory as the source code for convenience, and then hard coded into the program. Please name your picture files as pic1.jpg, pic2.jpg etc. and sound files as sound1.wav, sound2.wav etc.
  • Each image will be accompanied by exactly 1 sound, and will remain displayed for the duration of the sound
  • After the sound is done playing, the currently displayed image will be closed, and the next image will be displayed
  • The slideshow should also randomly flip (either vertically or horizontally) each slide before the slideshow. The probability that the slide will flip vertically vs. horizontally will be controlled by a member variable in the Slideshow class. See the detailed specs below for more information on this.
  • NOTE: You should only use the sound files from the lab’s mediasources folder. Many sounds you download online will have dual channels, which isn’t supported by our Sound class. Additionally, even if the file is single channel, the sample rate will most likely be different and the speed or pitch of the file will sound different when you play it!

Style and Comments

We will be looking for the following additional comment/style points in your code:

  • Meaningful variable names (i.e. don’t name a pixel “n”, “i”, or “bob” or “hello”. Name them something pertinent to their role, such as “sourcePixel” or “targetPixel”)
  • Proper indentation of code. Every subsequent coding/loop block must be further indented properly. Every single code example in your textbook follows this convention, so see your book for examples
  • Comments at beginning of methods indicating what they do at a high level. Example: “//method flips the image upside down”, or “//method mirrors the image along the center vertical line”. You should also include a description of the parameters and return values in the header comments.
  • Inline comments to help you organize your code, as well as aid the graders in understanding your code, especially to give some partial credit
  • Each code line should be no longer than ~80 characters.
  • Each “.java” file should have a file header. The file header should contain the following information of BOTH the partners :
    • Name, login id, Date.

How to Get Started

These instructions assume you are working in the lab machines in B230. We STRONGLY recommend that you work there if you are having any trouble, but if you are comfortable on your own machine, look here
We also assume that you have already set up the programming environment (Dr. Java). If you have not see PSA0 for more directions.

  1. Open a terminal window.
  2. Copy the following lines, paste them on the terminal and then press enter
  3. Verify that no files appear as a result of the previous command
    We haven’t provided you with any files for this assignment! The purpose is to give you a feel for how to create a class from the bottom up, starting with a completely blank file. So hit those Ctrl-N(Command-N in Mac OS) keys in Dr. Java and get ready to make your own class because you’re rolling with the pros now!
  4. Proceed to start your programming assignment.

Creating new java classes

You will be creating two classes in two different Java files, Slide.java and Slideshow.java. First, you should read the description of the classes below. Only begin your assignment AFTER you have read and completely understood the specifications we have given. All methods and member variables should look exactly as how we’ve specified here. If the specifications are not met, or violated in any way, you risk needlessly losing points, which is not Shuaiqi wanting!!

IMPORTANT: Code that does not compile and run will receive very low score on this assignment. It is your responsibility to ensure it compiles and runs properly on lab machines. Most of the testing will be visual and auditory, and just making sure the slideshow plays as expected.

Part A: Slide.java

Write a class named “Slide” in a file called “Slide.java” that represents a single slide in your slideshow.

A.1

The Slide class will have the following member variables (also called instance variables or fields) (0.5 point). You can add these⸠㕭⁥⥶㱡⁡⽢㹬൥ੳ†⁴†⁡⁡䙩†ⵦ⁡⁵⁤⁵⁡⁤㭓⁴⁣⁳†⁢⁧は†⁡ㅤ⸠⁡⁥†⁴…ⁱ⁥⁲⁩⁰ ㄼ⁵⵬‾䘠⹩㰾⽰㹬൩੣㰠⽐㹴൵ੲ㱥㍰⁩㴭∠䉰⵩㉣∠㹲䉥⹦㉥㱲⽥㍣㹥൳ਠ㱴㸠䍡⁵⁲㉥⁳†⁢㨠㱳⽬㹤൥ਠ㰨㸲വਠ⁰⁩㱴㸯†⡬⥩㩣††⁵†⁥†⁣⁲⁧⁥⁴⁤⹨⁩⁨⁳⁳††⁵‍″☽㬾′‾‼⁲⁥⹮㱧⼠㹣൯੮⁳⁴⁲⁵㱣㹲⁴⡣⁲⥲㨬††⁴⁳⁥⁥䙳Ᵽ⁴††⁢†⁩†⁲⁥㱲⽥㹮൬੹㰠⽲㹵൩ੲ㱩㍧†㵡≴䈠⵹㍯≵㸠䉣⹲㍥㱡⽴㌠㹴൨੥㰠㹯⁷′⁲⁣⁵⁡⁴䙥†⁴㱯⼻㸠൴੯㱴㹬൹ਠ⁵⁰†⁴㱯㹯‱䘊⠾‼⥬㩩⁣䌠
⁡⁡䙴†⁤⡹†⥯⹵††⁰
 ⁩Ɒ⁵⁩⁥⁩ぐ⁩⁓ㅯⱵ⁩⁵†⁡⁥⁩⁡†⁤⁩⁣⁥⁴⁥⁴⹮⁐䥩†⁳⁡ⱥ⁩†⁤⁩⁡⁩♬㭩䥣⁤⁥⁡䘠☠㬠䙳†⁥⁦⁲♮㭳Ⱐ⁴†䙥⁴⁴⁥⸮‬䘠⁵⁥⁨⁣⁴⁢†⁳⁥†⁦†⁴⁩⁴⁴⁳†⁤⁣⁰ⱬ⁩ ‾⁨‭‾‼‾⁙†Ⅼ䐠♥㭵⁡⁥⁤⁲⁶†‼‾ㄍ㠊⸠㌠†⁶⁤㽡㱮⽧㹩ൣਨ㱐⽩㹵൲੥㰠㍮⁐㴩∺䈠ⵃ㑨≡㹮䉧⹥㑳㰠⽴㍥㸠൰੩㱣㹵⁴†⁹⁤⁨†⁤†⁥⁲㩤†⡢㉹†⤠㱔⽨㹳ഠ੩㱳㹨ൡੴ†⁷⁥†㱨㹥⁲⡤⁥⥱㩵䄻†Ɑ⁵Ɽⁱ※†⁩⁴††⹩⁢ⱥ⁡⁵⁹†…⁴Ⱖ⁲⁵⁥†⁤⁌⁢⁐‮⁰ †⁩⁢⁤⁓Ɱ⁓⁤⁨⁥†⁡ⱦ⁩†⁴⁵†⁲⹮⁴䑥♢㭯⁩†⁩⁢⁥†ⅳ䡹㨠…⁵⁩†⁲‮⁴Ⰺ‼⁨⁩♤㬢䜴⠾⤍☊㭤†䱬†㡹䍬⸠⁣⁴䵥⁨⁨⁥䄠䱯⁹†䅣†䌨⁩⡮ㅴ
⤊㰼⽵㸍ഊਠ†††‼㱬㹰⁶⁳⡯⁰ⱬ⁩⁲䌬⥥㩡䌠⁥⁳⁨⁳♯㭤䍦♳㭲⁳⹵⁲⁳⁴⁡⁣⁲⁰⁲⁡†♴㭵䍤♯㭶⁥⁥†⁹⁳⁡⁴㭤†††䍯⁩⁴⁳Ɐ⁤⁨⁰†⁳⁡Ⱳ†⁲⁨⁲‮⸠⁎⡏ㅔ†⥥㰠⽴㸠൐੩㱣⽴㹥ഠ੯㱢㍥⁣㵩≮䈠⵴㕨≥㸠䉳⹬㕩㱤⽥㍯㹢൪੥㱣㸮⁥⁲⁦⁰⁺⁡⁵㩤⁩⡣㉡⁴⥨㱥⽲㹴൯ਠ㱦㹰ഠੴ⁨⁥†⁣㱯㸠†⁥⡵⥯㨻⁳⁴⁥⁲Ⅼⅹ†⁲⁡⁦‮⁺⹡䤠⁳⁵⁴†ⱳ⁨†⁦†⁥⁧⁴⁩‮☠㭷䕩Ⅱ†⁴†ⅰ♥㭥⹤‮⁦⁤⁤†⁣⁦⁩⡲㨠⁩⁥⁸⡥⥥⁰⁩⁰⁥⥣⹴†⁨⁥⁳⁴⁦⁥⁢⁳⁓⁤‮‾⁵‾⁐⁎†ⱨ†⁹⁤††⁳⁲†⁥⁷⁢⁡⹣൯੭⁥†⁴㰠㹤ഠ੡†⁡⁩†⁥㱴㹤䠠⁴†⁡†‬⁴⁡⁳†㨠⁁䑦⠠⥣⁴†⁩⁷⁩⁣⁳〠⁩⁨ㅥ⸠⁓ⱳ
⁤⁡♡㭳⁥⁥⁢‮⁰′⁤⁡⁓⁡•Ɽ⁥⁷⁶‼‾⁡††⁵⁳⁲⸠⁩⁦†…⹨ⱱ⁵⁨†⸠㱴⽨㹥൮ੴ⁩⁲⁥†⁳⁩⁤㱥㹯䙷 ‼Ɽ‽‱ ‍‾⁩⁷⁷ⵡ†⁲⁡⁢‼ ‾⸠⸠㰼⽬㹰൲੩⁶⁡⁴⁥†⁓⁩㱤㹝†⁴⁡㼠⁳⁤ⱴ†⁩⁴†⁤⁨⁥⁺†⁡†⹣⁴䥬†⁡†⁥⁢ⱦ†⁤†⁩䍤䕳⁨㡯䉷†⁩⁥†⁳⹡㰠⽴㹴൩੮⁧†⁦⁲⁡⁥⁷㱯㸠⁲⁩†⁵⁥⁔⁥Ⱜ†⁥†⁲⁴†⸠㱹⽯㹡൲੥†⁴⁡⁳㱫⽥㹷൩ੴ⁨†⁷⁲㱩⽴㹧ഠ੊㱕⽮㸠൴੥㱳㍳†㵲∠䥴ⵥ⵵䄠ⴠ䙣∯㹰䤾⁴⁩䅳⁥䙥㱲⽡㍃㹲൥੤㱩㸬⁨⁹Ⱖ⁩⁲䠠⠠⥷†⡯⥵‮⁲⁴†⸠⁳⁴†⁡⁰′⁷⁲ⱷ•⁷†⁲䅩㑮Ⱐ⁙†⁲′ ⁳†‰⁧⹴⁲⁩†⵮⁲⁨†⁵⁩⡭⥩Ⅱ⁰⁩⁐‬⁥⁩⸠⁨⡥⁰⁢‾⁡⥙ⱬ†⁲⁩⁩⸠⁤Ɱ⁲†⁴⁲⁤⸠⁥⁡㱨⽯㸮൪੡㱶㌬†㵣≴䉵⵲㙥∮㹪䉡⹶㙡㰬⼠㍯㹵൮੤㰮㹡䅶
Ⱙ‮⡳⥴⁨⁣†⁳⁩⁩⁩
⁤⁩†☨㬱䠮⁶⁳☮㭥ⱨ⁡⁥⁹⁲†⁨  ⹯†††⁲⁡⡴㌠‼⤢㱥⽸㹥൲੮㱡㸠൴੡⁲⁧⁥⁴㰽㹢䵬•⁲⁴㑴⁰‮⁲㑥⁵⁴⁷㑣⁡‼⁩⠾ㄍ ⥬㱩⼾㹩ൣ੫††㱴㸠䍌⁡⁥⁦⁵⁤⁥†㵣ひ⹮㙥⁲⠮〼ⸯ㕬⁩⤠㰠⼼㸾ൃ੬⁩⁣†㱴㸠䄦ⁱ⁄…ⁱ†⁃†⠶⤮‼†⠠ㄠ†⥮㰠⽴㹳ഠ੷⁥⁢†⁩㱮㹲䑦⁨⁴⁳⠠⥐⁓†⹵⁴⡩ぬ⸠㕴⁨⥩㱮⽴㹮ഠੴ㱨⽥㹥൦ੴ㰠㍡㴠≓䥥ⴸ⵩䄾ⴠ≵㸠䥷⁣⁡䅴†㱓⽴㍲㹴ദੲ㱤㹵䥯††ⱳ⁩†⁶⁡⁴⁡⁥⁣⁨⁵⁴†⁳⁥ⱷ⁤⁥⁐⁥⁲⹡†⁡†⁥⁴†⁲†††⁧⁩⁩⁤⹣⁡䅮⁥ⱹ†⁧⁴⁲⁳⹡㱺⽺㸡ഩਮ㰠㹴൥ੲ†⁳⁥㱤㹧䘠Ɒ⁡⁥†††††⁵⁰††⁴⁨⁥⹣⁡䙮⁴ⱬ⁤⁓…ⁱ†⁵⁩†‮⁩†⁣⁲⡴⹥⸠⁡⁴ⁱ⁣Ⱖ⁴☊㭬⁃†※⁡Ⱨ⁴⁳††⽯⁡⹬⥥⹳†⁩⁡⁣⁥⁁†⁥⁵†⁩⁰⁰⁧Ⅿⅵ䵤⁳⁤⁶⁵…⁰†ㅴ⸠Ⱐ⁵㉩⹮⁵⹬⁩⁳ ††ㅦ⹴ⱹ㈠⹤†⹯㱡⽤㹧ഠੴ⁨⁥†㱡㸠ⱨ⁥†⁤⁳⁴⁴†⁳※⁢⁁⁩⁥※䅯☠㭩††⁴ ⁦⠠††⁳⁥⁴⁨⁡⁴⁥⥬ⱥ⁳⁴⁴⁥⁳⁲⁴⁴⁴⁦⹥†⁡⁩‮†⁵⁡⁶⁴†⁴⁡†⁥⁵⁳ⅴ⁨䙩⁴⁲ⱨ⁥⁥⁵⁥⁵⽤⁡⁩†⁤⹵㱰⽬㹤മ਼㰯⽬㸍ഊਠ㰠㈠‼㴾≔⵵䑯≷㹩⁹䑯㱮⼠㉯㹵൲ਠ㱡㹳䑩⁩⁡‼         㔀     ⸀ 䐀         ⸀           ⸀  ⸀⸀        ⸀ ⸀㰀⼀㸀ഀ਀㰀㈀ 㴀∀䔀ⴀ䌀ⴀ∀㸀䔀 䌀 㰀⼀㈀㸀ഀ਀㰀㸀   ㄀    䌀䄀䔀 ⸀㰀 ⼀㸀ഀ਀䤀   䌀䄀䔀   䌀䔀 㠀䄀Ⰰ          ⸀      䌀䄀䔀 ⸀㰀⼀㸀ഀ਀㰀㌀ 㴀∀䔀ⴀ䌀ⴀ䨀ⴀⴀ∀㸀䔀 䌀 㨀 䨀  㰀⼀㌀㸀ഀ਀㰀㸀  䔀 䌀        Ⰰ       ⸀                        Ⰰ     ⠀⸀⸀           ⤀Ⰰ  ☀㬀☀㬀       Ⰰ     Ⰰ  ⸀       ☀㬀 ☀㬀        ☀㬀 ⸀ 䤀 䨀Ⰰ 䨀 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!