help with java code make sure you.?

Problem by keren875: help with java code be sure to.?
Can someone inform me what the issue with this code is?
When i operate it, after the user puts in the electricity, the output is each can not operate and enough energy. It should only print 1 of them… i think there is a dilemma with my if/elseif conditioning…. aid?

System.out.println (“Form the Energy you have on that technique:”)
electrical power = sc.nextInt ()

if (electrical power < 0)
System.out.println ("Invalid Entry")
System.exit(0)

else if (apps == 1)
if (system.equals ("Windows XP"))
if (power < 300)
System.out.println ("Can Not Run")
else if (system.equals("Vista"))
if (power < 800)
System.out.println ("Can Not Run")
else if (system.equals ("Windows 7"))
if (power < 500)
System.out.println ("Can Not Run")
if (apps == 2)
if (system.equals ("Windows XP"))
if (power < 500)
System.out.println ("Can Not Run")
else if (system.equals ("Vista"))
if (power < 1000)
System.out.println ("Can Not Run")
else if (system.equals("Windows 7"))
if (power < 800)
System.out.println ("Can Not Run")

if (apps> two)
if (technique.equals(“Windows XP”))
if (power < (500+(apps*50)))
System.out.println ("Can Not Run")
if (system.equals("Vista"))
if (power < (1000+(apps*50)))
System.out.println ("Can Not Run")
if (system.equals ("Windows 7"))
if (power < (800+(apps*50)))
System.out.println ("Can Not Run")

System.out.println ("Enough Power")

System.exit(0)
}}

Best answer:

Solution by MichaelInScarborough
It is really hard to examine your code:
attempt the adhering to:
Method.out.println (“Sort the Energy you have on that system:”)
energy = sc.nextInt ()

if (energy < 0)
System.out.println ("Invalid Entry")
System.exit(0)

if (apps < 1)
System.out.println ("Invalid Entry")
System.exit(0)

String strPrompt[] = new String[]
"Windows XP",
"Windows 7",
"Vista",
"Can Not Run"

switch(apps)

case 1:
if (system.equals (strPrompt[0]) && (power < 300))
System.out.println(strPrompt[3])

else if (system.equals(strPrompt[1]) && (power < 800))
System.out.println(strPrompt[3])

else if (system.equals(strPrompt[2]) && (power < 500))
System.out.println(strPrompt[3])

else
System.out.println ("Invalid Entry")

break
case 2:
if (system.equals (strPrompt[0]) && (power < 500))
System.out.println(strPrompt[3])

else if (system.equals(strPrompt[1]) && (power < 1000))
System.out.println(strPrompt[3])

else if (system.equals(strPrompt[2]) && (power < 800))
System.out.println(strPrompt[3])

else
System.out.println ("Invalid Entry")

break
default:
if (system.equals (strPrompt[0]) && (power < (500 + apps * 50)))
System.out.println(strPrompt[3])

else if (system.equals (strPrompt[0]) && (power < (1000 + apps * 50)))
System.out.println(strPrompt[3])

else if (system.equals (strPrompt[0]) && (power < (800 + apps * 50)))
System.out.println(strPrompt[3])

else
System.out.println ("Invalid Entry")

break

In this way, you find your error far easier.

You could go one step further and pack those three statements for xp, vista, and windows 7 into a function. Then you just had 3 function calls which would set up the logic of your program. A lot of code and options to do mistakes would be rationalized away.

I hope this was helpful.

What do you believe? Answer underneath!

Question: This code is required for my website to operate?

question of miss piggy :? It is this code essential for my site to work Very best Solution:

reaction from indigo_dream
The xmlns refers to the XML namespace. It is needed for a properly-shaped XHTML document but invalid HTML. Numerous browsers ‘meaning’ it anyway. It will not do anything to slow down your web page to load, so I would go away it, but if you want to get rid of it, adjust it in just .

know greater? Leave your very own solution in the comments!

Asking : “The final Handle E-book operation did not do well because of to a server error. (Error Code: -seven)” ??

Problem by kiralyvlad: “The very last Tackle E-book operation did not realize success because of to a server error. (Error Code: -7)” ??
I reinstalled Windows, mounted a new antivirus + firewall suite, and now, My Contact ID’s from my messenger record are gone. When I try out to add them, i get the error… I searched by means of my firewall’s acknowledged applications, almost certainly there is a third social gathering file accomplishing this Tackle E-book things, but discovered nothing. Thank you for you time.
Rebooted dozen moments. Not functioning.

Best remedy:

Solution by duderinow
reboot, try again.

Give your solution to this query beneath!

Price: How do I uninstall Windows Vista, so I can my new product important code for Windows seven Final use?

query of Xavier : How do I uninstall Windows Vista, so I can use my new solution essential code for Windows seven Greatest I downloaded Windows 7 from the “Best Steal” internet site (or some thing comparable). Throughout the configuration, I choose all the issues, if it is the first time ran to install. When I very first opened in Phrase, check out out the title bar “Windows 7″ instead of the common “Windows seven (subscription)” so I know some thing has altered. But now it is asking for solution important code. He says this is mistaken on my e-mail receipt. Now Microsoft tells me I have to uninstall it on my Windows Vista. What and how do I do that Very best Answer:

solution by Sandy G
difficulties llike this is normally not done with genuine Microsoft products. What is in the absence of a important set up complain? You do not want a real Windows 7 Keys to Vista or Word. Operate

Add your own solution in the remarks!

Consult: Microsoft Term “pc code” change Support?

query of Miss Mandy :? Microsoft Term “computer code” convert support So I used to transform a docx file to a doc file in Microsoft Term 2007 to 2003, seems easy adequate right … well, it was like a week in the past. and it is a very essential document. when they turned into all this mambo jumbo that seems to be like pc language. can anybody support please ??????? Is there a way, it was the way back once again, it Greatest Answer:

response from Ben
How did you transform it? Here is a check to see if you did it appropriate, you phone them out to whatever.doc whichever.zip. Then try to extract it. If you can extract it effectively, it is a legitimate docx. If not, it can be almost certainly a doc. You could not have applied. This is not truly “pc language”. It is a sequence of numbers that the computer tries to study a text, so it is all mad.

Create your personal solution in the feedback!

Dell / Windows XP – “do not start application.Please you start your computer … error code -2147023174″?

question of Hb : Dell / Windows XP – “do not commence software.Please you commence your laptop or computer … error code -2147023174″ My Dell desktop working Windows XP all the sudden would not perform. I turned on the personal computer as you typically clicked, the user identify, windows begin-up window messenger appeared as typical, then a beep and the concept: “Software could not start off make sure you restart your computer and try yet again Error code -. . 2147023174 “The bar previously mentioned the message shows” C: Plan Files gs_agent dsc.exe Dell Support Middle “. I restarted the personal computer a number of occasions and the exact same factor happens each and every time. I attempted to open World wide web Explorer, and it would not open. I tried to open Firefox, and has opened a new window, but it could not find the server. The laptop or computer could not uncover printer nicht.Ich went into the Handle Panel, remove and tried Dell Help Middle underneath Add / Take away Packages. It beeped and gave me the following concept: “Windows Installer Services could not be judged” Make sure you aid.. Thank you a lot.Ich have McAfee set up on my pc and you remember prior to the crash just been updated – download the 5959 DAT to flash generate on an additional personal computer – not in a position to operate it on my affected computer systems. And I can not locate the svchost.exe file with all the detailed techniques. Please support. Hyperlink: https://kc.mcafee.com/corporate/index?page=content&id=KB68780 Greatest Response:

response from Dennis
I have precisely the exact same factor … just started

Add your very own response in the feedback!

Get Secret Code Free For BlackBerry Curve 8520,9700, Bold 9000, 8900, Storm

Here some BlackBerry Curve 8520,9700, Bold 9000, 8900, Storm the secret code:
1. Numerical change in the signal band: ALT + NMLL (Type of course: ALT + NNMLL) home screen.

2. Using sound and visualization of data usage: BUYR (Type of course: butter) in the [option], [Status].

3. Show me the refl dan ServiceUserId: ALT + VIEW (type ALT + VVIIEWW course) when you open the message.

4. Show Event: ALT + LGLG home screen

5. Show Help Me: ALT + CAP + H (Type of course: ALT + race) on the main screen

6. Show your SIM card information: MEPD (Type of course: Meppen) [Options] [New Opportunities] [SIM card].

The latest BlackBerry Curve 8520,9700, Bold 9000, 8900, Storm trick can be used to verify that you opened or closed on a BlackBerry. If the status is unlocked will appear disabled, otherwise it is locked. BlackBerry Curve 8520,9700, Bold 9000, 8900, Storm happy!

How do you download Windows 7 online with an activation code?

I have an activation code to download Windows 7, but have lost or misplaced my disk. Does anyone know where I can go online and download the software without having to pay again?

The Affiliate Code – Michael Jones Is Shaking The Affiliate Industry!

The Secret Blueprint Everybody Was Waiting For… Learn How A Super Mega Affiliate Makes 7 Figure A Year – Join Me And Earn 60% Commission + 3 Irresistible Upsells. Up To $6.3 Per Hop You Send.

The Affiliate Code – Michael Jones Is Shaking The Affiliate Industry!