Reply
java assignment
Old 10-27-2005, 01:09 PM java assignment
Junior Talker

Posts: 1
Hi, hows everyone?

i was searching for java help and came across this site so decided to register and see if anyone could help me.

I have got a week to do a java assignment which consists of the following:

"""

The Problem:
Write a program that outputs the lyrics to the song “99 Bytes of Bits on the Bus”, which can be sung to the melody of the repetitive song “99 Bottles of Beer on the Wall”. (The lyrics of this song can be found at the bottom)

Analyze the lyrics of the song. Identify recurring patterns in the lyrics of every verse. Also identify slight variations.

Develop an algorithm which makes use of basic control structures, such as sequence, selection and iteration, to efficiently output the lyrics.

Implement your algorithm in Java.

Test your program and improve it if necessary.


Requirements
Your assignment should be submitted as a short report. The report should consist of the following sections:
• A title section with the student details, e.g. name and matriculation number.

• A copy of this assignment.

• A section detailing the algorithm for your program, i.e. an enumerated list of steps that your program will need to accomplish in order to correctly solve this problem.

The algorithm can be produced in graphical form, i.e. as a control flow diagram or in textual form, i.e. as a list of short textual descriptions of each step.

This should ideally be about half a page long but no longer than one page.
• A section containing the source code.
• A section showing the output that is produced when you run your program. It is sufficient to print the text with a start value of less than 10.
• A section detailing your testing of the program for different start numbers of bugs. This should include the aim of the testing, i.e. your
2/4
choice of test values together with a short (!) justification of your choice and the outcome of your test. You should at least test 3 different classes of sensible values and one class of non-sensible values. This section should ideally be no more than half a page long.
• A digital version of your program, i.e. the .java file.
Assessment


Lyrics of the Song “99 Bytes of Bits on the Bus”

99 bytes of bits on the bus, 99 bytes of bits. Take two down, short them to ground.

97 bytes of bits on the bus.
97 bytes of bits on the bus, 97 bytes of bits. Take two down, short them to ground.

95 bytes of bits on the bus.
95 bytes of bits on the bus, 95 bytes of bits. Take two down, short them to ground.

93 bytes of bits on the bus.
93 bytes of bits on the bus, 93 bytes of bits. Take two down, short them to ground.

91 bytes of bits on the bus.
Continue like this to the last verses …

3 bytes of bits on the bus, 3 bytes of bits. Take two down, short them to ground.

1 byte of bits on the bus.
1 byte of bits on the bus, 1 byte of bits. Take it down, short it to ground.

No more bytes of bits on the bus.
"""

I have had about 4 weeks (about 6hours) of tutorials in java, and its fair to say most of the class are clueless about this, so i thought maybe someone on here could point me in the right direction or give me a helping hand. Ive covered basic loops such as for and while, and i know some variables, but the rest im totally clueless.
harrybuck is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 10-27-2005, 01:44 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
PHP and Unicode with UTF-8
Posts: 3,108
Location: Toronto, Ontario
No one will do the assignment for you If you don't know what you're doing at all then you should have went to your instructor sometime in the past 4 weeks and asked for some extra help. We'll help you answer specific questions.

If you know how to do loops, then you should be fine. The program is fairly simple. I'm sure the for loop examples you've seen have had a statement at the end which increments a variable (perhaps something like i++). You can modify this generic for loop example, but make the initial number begin at 99 (instead of 0), and make the incrememnt a decrement by 2 (i -= 2). Inside the loop, just write the song using the for loop variable (usually x or i).
Christopher is offline
Reply With Quote
View Public Profile Visit Christopher's homepage!
 
Old 10-27-2005, 01:52 PM
stoot98's Avatar
Ultra Talker

Posts: 340
Name: Stuart
Location: Glasgow, Scotland
Chroder is right, thats the way to do it. Just a simple loop with decrements of 2 instead of just one.

Stoot

Last edited by stoot98 : 10-27-2005 at 01:54 PM.
stoot98 is offline
Reply With Quote
View Public Profile
 
Old 11-01-2005, 11:30 AM
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
I remember starting programming oh way way back when i was a lad. And one thing i remember is no one would help me with my assignments either.

But yours is very easy.

You can do your assignment using any loop.

I'lll give you a hint though,

if (i % 2 == 0)
will be true for every occurence of i / 2 = 0

% is a fantastic tool for the programmer.

Ibbo
__________________
www.nationalclubgolfer.com www.sportspub.co.uk www.bespokecc.co.uk www.centralmarquees.co.uk
Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Reply     « Reply to java assignment
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13432 seconds with 13 queries