Click to See Complete Forum and Search --> : Need help with java


tofu
03-08-2006, 09:19 PM
ok so i have a midterm and need help this question that is gonna be on the midterm. i dont know how to do it and its worth 16 marks!!!! here it is


the UW Orchestra wants to produce a CD containing all the pieces of music
from its upcoming concert. In order to do that, it needs to calculate the total length of time for the
CD. In addition, the conductor wishes to know which piece of music has the longest duration.

Sample output for the program.
The Swan (3.88)
The Bee (0.98)
Claire de Lune (6.02)
Liebesfreund (3.38)
Ragtime (3.48)
The total time for the CD is 18.74 minutes.
The longest piece is Claire de Lune.

Do not include the HTML that is required to embed the program into a Web page (that is, show
only what you would write between <script> and </script> tags).


[4 marks] In the following space, define a function, Print, that takes two parameters, Title and
Length, and outputs a line of text such that Title appears in italics, followed by Length in
parentheses. The function also returns the value of Length.
For example, Print("My World",30) will output the line
My World (30)
and return the value 30.
Put your JavaScript program for the remainder of this question in the space provided on the next
two pages.

[9 marks]. For each piece of music, your program should input the title of the piece and the
duration (in minutes) for that piece, and it should output a line showing those values using the
Print function just defined. After all pieces have been listed, the program should output the
total length of time for the CD, adding in 0.25 minutes between each piece of music (which is
needed on the CD to separate the pieces).
[3 marks] The program should also output the name of the piece that has the longest playing
time.
Use reasonable variable names, indentation and good programming style. Documentation and
comments are not required, but you may add them to explain any assumptions you might want to
make. You need not check that the input is valid, and you may assume that no two pieces have the
same duration.

can anyone help me out! i would be indebt of ur kindness if u can help me out!

BigDog
03-09-2006, 08:35 AM
This is something you should spend time learning, we aren't here to do homework or take exams for people. At least make some effort before asking someone to do it for you.

BuezaWebDev
03-10-2006, 03:36 AM
Also, this isn't a javascript forum. Jeez.

takkie
03-15-2006, 12:41 PM
hahahaha