Maximum dimensions

I just recieved an assignment to find the maximum area of a rectangle when there are 100 feet of fencing availabe. You plan on using your neighbors fence for one side. The equations for the area, length, and width of the rectangle are listed below:
Area=X(100-2X)
Length= 100-2X
Width=X
I am trying to obtain the largest rectangular area possible. I have already found out how to find the largest area possible, my trouble is in finding the dimensions. I should get a 25 by 50 rectangle and yet I just can't seen to figure out how to get those dimensions. The focus of the assignment is using ifs.
Heres my code for the maximum area:
public class Prog215c
public static void main (String [] args)
int x, area, maxAREA, length, width;
maxAREA=0;
for (x=1; x<=100; x++)
area= x * (100 - (2 * x));
if (area>maxAREA)
maxAREA=area;
System.out.println(maxAREA);
Would anyone mind pointing me in the right direction? I'm a complete beginner at java so I hope you don't mind what I know is probably a question with a very simple answer. Thanks for your help in advance. This is my first post too in these forums too ^^

Hi Firesword,
The problem is that by the time your loop finishes,
you don't really have an "x" with a sensible value you
can use.
Consider the following fragment
int resultArea = -1;
int resultWidth = -1;
for(int x =0; x <= 50; x++) {
    int area = x * (100 - (2 * x));
    if(area > resultArea) {
        resultArea = area;
        resultWidth = x;
}Now you can System.out.print resultWidth as well as resultArea.
(You can call it resultLength if you prefer, the question is
symmetrical wrt length and width).
Since you only have 100m of wire, I don't recommend letting
the width get bigger than 50m, or you'll run out wire!
Cheers,
Peter

Similar Messages

  • Is it possible to resize a photo in iPhoto--controlling the maximum dimensions and the dpi?

    is it possible to resize a photo in iPhoto--controlling the maximum dimensions and the dpi?

    The dpi depends on the print size you'll be making. This explains it in detail:  The Myth of DPI.
    A 300 dpi image for a 4x6 print will have fewer pixels in it than a 300 dpi image for an 8. 10 print. 
    You can set the pixel dimension of a photo by exporting it via the File ➙ Export ➙ File Export menu option and use the Custom size setting.  However, you should crop the photo to the size ratio you want before exporting, i.e 4 x 6, 5 x 7, etc.  Then set the maximum pixel size you want for the image:
    OT

  • Maximum dimensions of still images in Premiere CC

    Hi, anybody know what is the new maximum dimensions of still images in Premiere CC?
    Is it still 256 megapixel (like CS5, CS5.5, and CS6)?
    Thanks for the answers!
    Bye!
    Brianenno.

    Yes still the same.
    Do you want to import files that are larger then  32,768 pixels in e.g. either direction

  • After Effects render constraints for .mov with h.264 codec maximum dimensions 2000px x 2000px?

    Is there anyway I can create  .mov container with h.264 codec with dimensions 3840px by 1080px? When I try rendering from AE it lowers dimensions to under 2000px. Same thing happens when I try to save as from Quicktime. Programs I have access to are Premiere Pro, After Effects, Adobe Media Encoder, and Final Cut.
    Thank you for your help.

    Yes, It does seem to be mutliple LDCs. They asked for a final output video as 3840x1080. The  requirements are this and they finally sent this display.
    Basic Requirements
    Ensure the resolution of the file (width and height in pixels) matches the specs provided exactly, even small deviations can result in poor quality playback or no playback at all
    .MOV animations must use H.264 encoding
    We recommend 15fps (frames per second) for animation
    File size should be roughly 1 Megabyte per second or less, i.e. a 10 second .MOV file should be 10MB or less.
    Thank you for your help, I will ask on the other forum.

  • Maximum Dimensions of AIR Application

    Hi All,
    Can someone advise me if there is a limit to the dimensions that a desktop AIR application can be?
    This is specifically related to an an app made from Flash.
    I have been able to set larger width and heights in the descriptor file post installation to make the application open any size so far - but I don't have a screen large enough to see if there is a limit.
    Thanks,
    jkafkaris

    4095x4095 (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/NativeWin dow.html#bounds)

  • When I export a edited video, maximum dimensions are reduced. :(

    Hi, I'm new to use Adobe Premiere Pro CC. Its version is 7.2.2. I use it on my Mac. I'm in free trail.
    I imported a video with domentsions of 2560 x 1600. Then I edited this video. When I tried to export edited video, the maxmum dimentisons of video is 2048 x 1280.
    I wanna export my edited video on dimensions of 2560 x 1600. How do I get this done?
    Thank you.
    Wei

    Hi, Neil.
    In sequence settings, the dimensions are 2560 x 1600. I made a screenshot: https://www.dropbox.com/s/lo8im1m7lfa710a/Sequence%20Settings.png
    When I export the edited video, I choose "Match Source - high bitrate". I also made a screenshot: https://www.dropbox.com/s/oqo4ngrk0jdmupk/Export.png
    I wait for you help. Thank you.
    Wei

  • Maximum Dimensions in FCP 7

    In 6, it's 4,000 x 4,000. Does anyone know if that's true for 7 as well? I looked through the documentation and could find no note of it. Thanks!

    Still the same. Doing something larger than 4K?
    Shane

  • How do I write a script to set maximum pixel dimensions?

    I need to batch process JPGs and limit the maximum dimension to 500 px. This has to apply to the largest side of the image, either height or width. The other side should auto size proportionately. I'm currently having to make these size changes manually. I haven't found any script language or function that will let me set the largest pixel size to 500 px, regardless of which dimension is the largest.
    Example:
    1. If the image is 1000 px w x 750 px h, I want the script to resize the image proportionately for the largest side, changing the width to 500 px
    2. If the image is 750 px w x 1000 px h, I want the script to change the height to 500 px and the proportions conform accordingly for the width
    Any ideas are grately welcomed.
    Thanks,
    Linda

    Create an action that use File - Automate - Fit Image.
    I think there may still be a bug that this should fix....
    http://www.ps-scripts.com/bb/viewtopic.php?f=10&t=3370&p=15152&hilit=don%27t+enlarge+fit+i mage&sid=ea73e8349aaf965015a4a351340e865d#p15152

  • What are the photo dimensions in the iPhoto book?

    I'm scanning 35mm slides and want to know what size I should set my output. I'm looking in the iPhoto Help, but don't see anything about the printed page dimensions.
    Currently, my scans show up in Photoshop's image window as: 4"x6", 256 dpi and 1500x1000 pixel size.
    I think/hope this will be OK for 4, 3 and 2 images per page, but I want to rescan for the pages that will only have 1 picture.
    Should I set my output to the actual physical size of the picture on the printed page of the book? If so does anyone know what the dimensions are for 1, 2, 3 and 4 per page?
    Using VueScan software, I can set the input Scan Res from 300 to 4800 dpi. Is 600 dpi enough? Or should I go to 1200 or more?
    My Canon LiDE 600F scanner says it handles up to 48 bit rate. Should I set the Bits to pixel to this?
    Thanks for your assistance,
    Steven

    Steve:
    Setting the print size in Vuescan will adjust the dpi of the resulting file so that the photo is set to print that size. The scan dpi is what sets the number of pixels to be created during the scan. The print size just adjusts those pixels in the file so that an application like Photoshop will read it as that print size and adjusts the dpi as read to fit that size. If the print size it larger than the scanned image the dpi will be less than the scan dpi. It the print size is smaller conversely the dpi will be greater than the scan size.
    If you think that you might use a photo for a full page layout in the iPhoto book, 8.5 x 11, you would want to scan at a resolution that would give you 3300 pixels in the largest dimension. For a slide that would be 3300/1.4 or about 2400 dpi. The books are printed at 300 dpi so a 2200 dpi on the maximum dimension would fill the bill for nearly all but a full, one photo per page, layout. And then it would still come out pretty good.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Is there a maximum album cover size in Music app?

    Is there a maximum album cover artwork size in the Music app? I've noticed that some albums — that I've scanned the covers for — will display the cover in iTunes but not on my iPhone, so I'm wondering whether there's a maximum filesize or maximum dimensions.

    No
    There is a maximum numb of pages in a book (100 pages) and the larges page I am aware of holds 16 photos so the maximun number of photos you could have in a book would be 1600
    LN

  • BPC MS 7.0 ; Is there a guideline for max. no. of dimensions per app?

    I need to know if there is guideline for maxumum no. of dimensions per application? i have been hearing that there should be 8 to 11 dimensions per application? Is this SAP recommended? or is this a best practice?

    Hi Sudhir,
    As per Nilanjan's reply below, the maximum dimension per application is 20.
    But, the more dimension you create in the application, the higher the effort to maintain it, i.e. when creating input templates/ reports, etc. So, define your dimension carefully.
    Regards,
    Liam

  • Changing Photo Size Dimensions

    Hi,
    I put a few photo's on CD and attempted to put a couple of photo's on the internet using a PC as I'm not currently online at home. The website I tried to post these on allows space for 2KB for each image, each image I used is less than this. However when I try to post the images/message it says:
    Your uploaded image exceeded the maximum dimensions of 650 x 650. Please shrink your image to be smaller than these dimensions.
    What does this mean and am I able to do this using the CD the images are on or do I have to do this using iPhoto? If so how?
    Thanks.

    Hi Fancy,
    You can shrink the photos in iPhoto. Open iPhoto and select your image > Share > Export... choose the 'Scale Images No Larger Than:', from here you can scale down to 650 X ?. Unless the orginal is square you will get a 'non square' sized image... when finished export to your CD.
    To make you images sqaure, you must first crop your image to 'square constrain', save, Share > Export... again go through the steps above, your finished image will be close to 650 x 650...
    See if this work and post back... you may or may not encounter problems with the file size as well..
    Rick
    iMac G5 iSight 20" - 30G iPOD in Slimming Black -   Mac OS X (10.4.7)   - HP Pav 15" WS and Toshiba Sat 17" WS LP's - Canon 20D & A620

  • "The rasterized image exceeded the maximum bounds for saving to the PNG format"

    Hi everyone, I'm using Illustrator CS4 and encountering the following problem:
    I made a level map in illustrator that exceeds 10000x10000 pixels. When I try to export the image as a PNG, I get the error "Could not complete this operation. The rasterized image exceeded the maximum bounds for saving to the PNG format". I tried saving in JPG and others as well, but got similar errors.
    How can I get around this?

    Here is an interesting discussion: http://bytes.com/topic/php/answers/735556-png-maximum-dimensions
    -- although the dimensions there are way larger than your paltry 10K x 10K. It appearts not to be a limitation of the PNG format, but solely from the software used.
    Here's a question. What on earth do you think you need 10K x 10K PNG files for?

  • Graphics card dimensions HP Pavilion 6774y

    Hi,
    I am deciding on what graphics card (or video card if you will) to buy. I don't need any help on deciding, but I would like to know what dimensions will fit inside the pc (regarding space). My computer is an un-changed and un-upgraded HP Pavilion 6774y Magnesium Gray edition. What size dimensions will fit in the area where the PCIe x16 is in between the power supply and processor fan?
    Will a dual-core fit? Is it too wide?
    How long can it be?
    How tall?
    Will the case that I have support it regarding the end of the card?
    I am currently deciding on getting a GeForce GTX 560 Ti which looks like this:
    http://www.amazon.com/EVGA-GeForce-Mini-HDMI-Graphics-02G-P3-1568-KR/dp/B005760836/ref=sr_1_2?s=elec...
    ( Sorry if links aren't allowed on this forum)
    as you can see on the edge there's a silver part. It looks a little too big to fit with the case to me.
    If you could help me out in finding out the maximum dimensions that a video card could fit in the 6674y, that would be great.
    And if you could suggest any cards that are better in any way that would also be appreciated.
    Thank you.

    Here are the specs of the GeForce GTX 560 Ti (#02G-P3-1568) Graphics Card you are looking at. At about 9 inches long, it should fit fine in you case. It will take up two PCIe slots,so make sure the PCIe x1 slot next to the PCIe x16 graphics slot is empty. You will also need a 500 watt or larger power supply to use this card. The Corsair CX500 and CX600 come highly recommended and are known to fit many HP cases.
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • How can I view the size of a particular event in iPhoto '11?

    How can I view the size of a particular event in iPhoto '11? The 'Get Info' option is not displaying the size of the event like it used to in iPhoto 8.

    But the event does not really have a size - you can export the photos and make the size pretty much what you want - while it is in iPhoto it is an event
    I guess that iPhoto could report the size of the original photos as imported - or the size of the modified photos if exported as JPEGs - or the size of the modified photos if exported with a maximum dimension of 1080 - but the event simply is photos and does not have a "size" until you export it
    Obviously you want to know the size but the question was
    what is your puprose for knowing the size?
    WIth that information maybe there is a way to get you what you want
    But the basic answer is simply that an event does not have a size - an event is a collection of photos and each photo has either two or three versions in the iPhoto library and each photo can be exported for outside use in several formats and at any size
    LN

Maybe you are looking for

  • ITunes doesn't put music on my iPod, or load the Store. . .

    My iTunes is ridiculous. Basically I can't do anything but import music, for the longest time it hasn't been able to put music or anything else on my iPod Touch. So when I had to get a replacement iPod because of a cracked screen and permanent LCD da

  • Copying files need "permission" to be transferred?

    Alright so I lost one macbook but all my files were backed up.  When I go to retrieve them with a new macbook I can see all of them (their HD movies about 120) my plan was to plug the laptop into the time machine for a fast transfer of the hd movies

  • OSX 10.6.8 security

    Is OSX 10.6.8 vulnerable to recent security problems as reported in New York Times (Feb 24, 2014?)?

  • Clearing radio button selection

    Guys, iam stuck in a situation where iam not able to clear the radio button selection in the SINGLESELECT tableview. I am using MVC approach and my layout is similar to bookshop example in SAP  tutorial_4_mvc. I found that even in the SAP example the

  • How to transport Query variant used in APD

    Hello Experts, I have created 2 query variants for a query in Development system. And, these variants are being used in APD. Now, when APD is transported to next system, query variants does not exist in next system, so cannot execute APD. Please let