The Artima Developer Community
Sponsored Link

Java Answers Forum
Need help with java

1 reply on 1 page. Most recent reply: Mar 9, 2006 3:56 AM by Dave Hinton

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
kevin wong

Posts: 1
Nickname: tofu
Registered: Mar, 2006

Need help with java Posted: Mar 8, 2006 7:08 PM
Reply to this message Reply
Advertisement
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!


Dave Hinton

Posts: 42
Nickname: catbells
Registered: Oct, 2003

Re: Need help with java Posted: Mar 9, 2006 3:56 AM
Reply to this message Reply
You need help with javascript. Java and javascript are different languages, but have misleadingly similar names.

Flat View: This topic has 1 reply on 1 page
Topic: HELP ME!!! -- application development of lips recognition using ANN Previous Topic   Next Topic Topic: Broad Java Category

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use