# Maximum PC

 It is currently Thu Jul 24, 2014 12:28 pm

 All times are UTC - 8 hours

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Programming helpPosted: Fri Oct 15, 2010 6:49 pm
 8086

Joined: Sun Apr 11, 2010 12:59 am
Posts: 68
Hey guys,
I am in a computer systems technology course right now... but we only just started using eclipse and I am so lost.. I have written small programs such as the HelloWorld program. I was away from school for 1.5 weeks with mono and have so much to catch up on! My professors do not offer help/review sessions. This is soo hard to learn without being in those classes I missed This program is quite a bit more complicated. Can you guys give me a hand with the lines of code involved as per the following instructions? Thank you so much in advance!

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
When the Titanic embarked on her maiden voyage on April 10, 1912 there were 2,227 people on board. There were also only 20 lifeboats with an average capacity of about 59 people (maximum capacity was therefore about 20 x 59 = 1,180 people). Obviously it would have been ideal to have enough lifeboats to safely evacuate everyone on board ship! Your task is to write a Java program that will calculate the minimum number of lifeboats required to do this as well as the numbers of people who would be rescued or drowned given the number of available lifeboats. Your program should be flexible enough to work for any ship and size of lifeboat.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Write a Java program called Lifeboats.java that will do all of the following:
1. Display a title

2. Ask the user to enter the following values:
a. The name of the ship (possibly including spaces like HMS Endurance)
b. The number of people on board the ship
c. The maximum number of people that can be carried by one lifeboat assuming all the lifeboats on the ship are the same size
d. The actual number of lifeboats that are available on board the ship

3. Calculate and display the following results:
a. The minimum number of lifeboats required to carry all the people
b. The number of people that would be rescued if the available lifeboats were filled (but not beyond the number of people on board the ship) as well as the percentage that this represents of all the people on board
c. The number of people that would drown as well as the percentage that this represents of all the people on board
d. If nobody drowns, then also display the number of additional people that could be carried by the lifeboats if they were all filled to capacity regardless of whether this number is greater than the number of people on board.

Top

 Post subject: Re: Programming helpPosted: Sat Oct 16, 2010 8:19 am
 Team Member Top 100

Joined: Sun Feb 12, 2006 2:52 pm
Posts: 1994
Location: Cryptogram City!
I don't know a thing about Java, but this assignment has three parts:

1) get data from the user,

2) make simple arithmetic computations (ie: the number of people who would drown equals the number of people on board, minus the number of people who could (in total), be put into life boats.), and

3) output a few variables.

Check your book or Google for what you don't know about #1 and #3. If you're stuck on #2, specify what you're stuck on.

This is an easy assignment - not climbing Mr. Everest here.

Top

 Post subject: Re: Programming helpPosted: Sat Oct 16, 2010 9:04 am
 Java Junkie

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24222
Location: Granite Heaven
We don't do homework here.

We will help you with code you've written but we won't write the assignment for you.

Top

 Post subject: Re: Programming helpPosted: Sun Oct 17, 2010 1:03 am
 8086

Joined: Sun Apr 11, 2010 12:59 am
Posts: 68
I apologize for not showing my first code writes. Here they are.
And for future referance, I am not looking for someone to do my homework. How can I learn this language if someone does it all for me? I just need someone to help guide me. It was my bad for not being more clear with my current work in progress. Here is what I have so far.

import java.util.Scanner;

public class Lifeboats

{
public static void main(String [] args)

{
Scanner userInput = new Scanner(System.in);
System.out.println("\n\n\t\t\tLifeboat Capacity Analysis!");
System.out.println("\t\t\t***************************************\n\n");

System.out.println("First some information is needed...");

System.out.print("Please enter the ship name... ");
String shipName = userInput.nextLine();
System.out.print("Please enter number of passengers on board... ");
int passengers = userInput.nextInt();
System.out.print("Please enter the maximum capacity per lifeboat");
int lifeboatCap = userInput.nextInt();
System.out.print("Please enter the amount of lifeboats available on the " + shipName);
int lifeboatAmount = userInput.nextInt();

double amount =

Top

 Post subject: Re: Programming helpPosted: Sun Oct 17, 2010 5:33 am
 Northwood

Joined: Mon Sep 17, 2007 1:27 pm
Posts: 3311
Location: Toronto, ON
What is it exactly you are having trouble with? The syntax? Or coming up with the algorithms?

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 5 posts ]

 All times are UTC - 8 hours

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Maximum FAQs    Forum Rules, Posting Guidelines & Announcements    The Good, The Bad & The Banned    FAQs Help/Do It Yourself    PC Building Lab    The Help Desk    PC Modding    Education & Certification Hardware    Nuts & Bolts    Portable Talk    Appraisals, Deals & Bargains (oh my!) OS/Software/Programming    Windows Parlor    Alt.OS.Abode    Games Arena    Programmers' Paradise Networking/Internet    Internet Truckstop    Network Nook In/Out    Magazine and Book Feedback    Forum & Website Feedback    Dog Pound Team Maximum PC Folding at Home    Team Maximum PC - Folding at Home - FIND CURES TO DISEASES    Team MPC - Folding Gauntlets