Getting an error message in code, but don't know what it means to do
import java.util.*;
import static java.lang.Math.*;
class Mid{
static Scanner console = new Scanner (System.in);
public static void main(String args[]){
int i = 0;
int j = 0;
int k = 0;
int mid = 0;
System.out.print("Enter an integer between 1 and 365: ");
i = console.nextInt();
j = console.nextInt();
k = console.nextInt();
System.out.println();
if (i>j && j>k)
mid = j;
System.out.println(+ j);
else if (i<j && j>k)
mid = max(i, k);
System.out.println(+ mid);
else if (i>j && j<k)
mid = min(i, k);
System.out.println(+ mid);
else if (i<j && j<k)
mid = j;
System.out.println(+ j);
}keeps telling me 'else' without 'if'
i don't get it, the program is supposed to work such that if i put in 3 distinct numbers, i, j, and k, i can use the program to find out which one is in the middle
Message was edited by:
kribraider414
An if statement without curly brackets only includes the first statement following it, e.g.
if(condition)
doSomething(); //This one belongs inside the if
doSomethingElse(); //This one is outside the ifwhereas
if(condition)
doSomething(); //This one belongs inside the if
doSomethingElse(); //This one is also inside the if
}So you else if statements are currently floating in the middle of nowhere.
Similar Messages
-
I've tried syncing my iPhone 3GS, but it'll stop when the sync is nearly complete, and the sync is interrupted with an error message reading "Error 1015". I've already tried all of the other things suggested by iTunes (ensuring that my OS is up-to-date, disconnecting other USB cables, ect.), yet this problem persists. Help...
5.0.2 has not been released, thus you can not upgrade.
Stedman -
I get an error message on Lynx, can someone tell me what this means?
When I check my home page on lynx I get what I would expect 2 links to 2 galleries below that the alt text for my logo and the photograph, and the footer info with an e-mail link. If I click any link I get a message "Bad Request - Your browser sent a request this server could not understand, the request contained invalid characters following the protocol string." All the links on the site www.hayhurst-photography.com do work. Should this show the next page (there are 42 others each have a table with 21 links + 3). Can you tell me what this means? and which are the invalid characters?
Thanks ChrisI just tested your pages using Firefox and IE7. I could click on both Business and Commercial links and venture into the inner pages with no error message showing up at all. Clicking on any of the thumbnails showed the larger images, again, with no error messages.
Nadia
Adobe Community Expert : Dreamweaver
Unique CSS Templates | Tutorials | SEO Articles
http://www.DreamweaverResources.com
Web Design & Development
http://www.perrelink.com.au
http://twitter.com/nadiap -
Hi, as above, back up not working, message "internal disc needs repair". Can somebody help with the meaning of this.
Thank you.click "utilities folder">open "disc utility" click on your disc> click "repair disc" in the lower right hand corner
-
I've locked my SIM card by entering the passcode incorrectly 3 times. Do I need a PUK code and how do I use it?
http://support.apple.com/kb/HT1316
-
No matter what I change email or passwords it continuously gives me this error.
Hi,
Please also try changing the typed words in the Captcha text field below the Captcha image that has a pair of words. If the existing pair is not clear, you can also try clicking on the refresh button (the top button among the three on the right of the image) to get a new image with another pair of words. -
Every time I try to update Muse to 2014.3 version in my mac (OS X 10.10.2) I get this error message: "Exit Code: 39 Please see specific errors below for troubleshooting. For example, ERROR: DW042 ... ---- Summary - 0 fatal error(s), 2 error(s) ERROR: Failed CreateAlias ERROR: DW042: ARP Entry couldn't be created for language : es_ES". I've tried both to uninstall the app and run CleanTooler, but there's no way. What else should I do?
Davidv82268468 have you removed and reinstalled Adobe Muse using the steps listed in CC desktop lists applications as "Up to Date" when not installed?
-
I downloaded an album and one single that I purchased just fine and then purchases another single and I keep getting an error message that says, You don't have enough access priviledges. What can I do to get this song? I am just going to have to ask for a refund and forget it?
What version of iPhoto do you have installed? Is if one of the versions shown as not compatible in this screenshot?
If it is then go to the App Store and download iPhoto 9.5. It will be free if you have an iPhoto 9 or later verson currently.
OT -
Updating ipod touch to os5.1 got an error message "cannot connect the ipod touch because the pairing record is missing" don't know what this means or how to fix but am stuck, only option is to answer ok and close the error box. Any ideas?
#1
- Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
- If a 5G iPod
Iphone 5 lightning port charging problem - SOLUTION!
- Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
- Make an appointment at the Genius Bar of an Apple store.
Apple Retail Store - Genius Bar
#1.1 n/a because the errror message overrides it
#2 see #1
#3 iOS: Device not recognized in iTunes for Mac OS X
But could be caused by #1
#4 Covered by previous ones
#5 Obvious jpegs are photos and thus will not sync as videos. Also see:
iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
iTunes: Frequently asked questions about viewing and syncing videos
#6 iOS: If you can't back up or restore from a backup in iTunes
First #7 See #6
Second #7 You have so many other problems resolve those first
#8 Resolve other problems first -
I have an issue installing photoshop CC trial, I currently have elements and wanted to see the differences before buying, when installing through the creative cloud app I get the error message Exit Code: 7 Please see specific errors below for troubleshooting. For example, ERROR: DW041 ... -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 1 error(s)
ERROR: DW041: INSTALLDIR Volume D:\ doesn't exist. ------------------------------------------------------------------------------------- System Requirements and it will not install, It says cant find the path D: im not sure why because as far as I can see its set to install on drive C: which is where I want it!Exit Code: 6, Exit Code: 7 Installation Errors - http://helpx.adobe.com/creative-suite/kb/errors-exit-code-6-exit.html
Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html for information on how to review your installation logs -
I set up mac mini and when I test the mail server by sending a mail from administrator to administrator I get the error message 'Diagnostic-Code: X-Postfix; connect to 127.0.0.1[127.0.0.1]:10024: Connection refused'. Can any one suggest a solution
Thanks. Where could I possibly look for a firewall rule. I knowingly did not creat any. My system has internet coming to a Modem which then is connected to a wireless router. I have computers connecting to the router through cable as well as wireless. One of these computers has been our mailserver using Mercury and Pegasus and that computer has a static IP address. The Mac Mini also has been assigned a different srtatic IP address. I have only set up user account, none of them an email account as I initially expect them to receive only internal mails. Is it necessary that I must set up an email id for each user while setting up the user account. My server id is server.local. So would the email id for local users be [email protected]?
-
Hi - clock in tool bar stuck, somebody in another post suggest bettertouchtool, but don't know what that is and can't get to magnifying glass next to clock, get the error-beachball. I'm a novice w/ Mac. Thx.
HI ..
Open a Finder window.
Select your user account on the left in the Sidebar. It has a small house icon.
Now open the Library folder then the Preferences folder.
Move the com.apple.systemuiserver.plist file from the Preferences folder to the Trash.
Restart your Mac.
edited by: cs -
Hi there,
I have just installed creative cloud on my mac laptop and am trying to download lightroom and photoshop (as a second computer) and am getting this error message
Exit Code: 7
Please see specific errors below for troubleshooting. For example, ERROR: DW006 ...
-------------------------------------- Summary --------------------------------------
- 0 fatal error(s), 2 error(s)
----------- Payload: Adobe Photoshop Lightroom 5 5.4.0.0 Adobe Photoshop Lightroom 5.pkg_5.4 -----------
ERROR: DW006: Apple Package failed to install successfully.
ERROR: Third party payload installer Adobe Photoshop Lightroom 5.pkg failed with exit code: 1See:
Exit Code: 6, Exit Code: 7 Installation Errors -
http://helpx.adobe.com/creative-suite/kb/errors-exit-code-6-exit.html -
I am trying to export a project in iMovie and I keep getting a error message about code revision
I am trying to export a project in iMovie and I keep getting a error message about code revision. i need help!!!
Hi there!
Are you certain that the serial number is for InDesign? And the correct version?
Please feel free to PM me if you wish to verify the serial number.
Thanks,
Amy -
I have purchased my first smart phone, an iphone 5. I would like to use some of the sounds from text messages for ringtones but don't know how to move them over. Any help would be appericated.
I'm sorry, had you already pointed out the rules which stated that lines from 2 separate accounts were eligible??? I don't see anywhere in the advertisement specifically stating that lines from 2 separate accounts would be eligible, so THAT is not what's advertised, either.
As far as I know Verizon's BOGO offers have ALWAYS been for lines on the same account. Possibly someone could chime in where they have received this offer on 2 separate accounts? The ONLY exception to this was someone getting the offer with 2 eligible lines on their account, reactivating the old phone on one of the lines and then giving one of the new phones to someone on another account.
Sorry if you think simply because someone disagrees with you, they are being condescending. That is certainly not the case. Good luck.
Maybe you are looking for
-
Photoshop CS5 Crashing Everytime Try open an image
Today I rebooted after upgrading to OS 10.6.4. I also ran monolingual to cleanup all languages except english. Everytime I open CS5 now as soon as I try to open an image it crashes. I've disable open gl and the same thing occurs. The report is gives
-
Need Answer on ALE Service Layer
In my cusomized outbound program i am using a function module MASTER_IDOC_DISTRUBUTE to generate the IDOCS. I am passing the both sender and reciever values to the function module MASTER_IDOC_DISTRUBUTE then distribution model in BD64 is not require
-
Why do clients not install anything??
New Win2k12 R2 WSUS server, Win2k8 R2 clients detect updates properly, even appear to download them... RSOP on the Win2k8 client servers shows the proper Group Policy and GPO are applied to the client. The clients can readily access http://wsus:8530/
-
Uninstall iTunes, need help...
I have read that when uninstalling iTunes and related components it has to be done in a correct order. What happens if I didn't uninstall in the correct order? My computer seems unaffected, but I would still like to know. Can anyone help?
-
How to deploy a java application -- might be silly but just help me out
Hi I�ve developed a java application in eclipse. How do I deploy it so that it can be used by others without the help of eclipse? I can run it in eclipse but how do I deliver it to my customers and how can they use it without the help of eclipse or u