Ask for help( simple code but wired error )!
The post I sent just now has some mistakes. This post is correct. My simple code is as follows:
import java.io.*;
import java.net.*;
public class count {
float dclient = (float)3.333;
float dlan = (float)0.01884;
float drouter = (float)0.00115;
float doutlink = (float)0.04185;
float dinternet = (float)1.2615;
float dinlink = (float)3.18129;
float client1 = 0;
float lan1 = 0;
float router1 = 0;
float outlink1 = 0;
float internet1 = 0;
float inlink1 = 0;
float client2 = 0;
float lan2 = 0;
float router2 = 0;
float outlink2 = 0;
float internet2 = 0;
float inlink2 = 0;
float x = 0;
float z = (float)3.333;
public static void main(String[] args) {
for (int n=1; n<16; ++n)
client1 = dclient;
lan1 = dlan * (1+lan2);
router1 = drouter;
outlink1 = doutlink * (1+outlink2);
internet1 = dinternet;
inlink1 = dinlink * (1+inlink2);
x = n / (z + client1 + lan1 + router1 + outlink1 + internet1 + inlink1);
client2 = x * client1;
lan2 = x * lan1;
rounter2 = x * rounter1;
outlink2 = x * outlink1;
internet2 = x * internet1;
inlink2 = x * inlink1;
System.out.println(client1 + " " +
lan1 + " " +
rounter1 + " " +
outlink1 + " " +
internet1+ " " +
inlink1+ " **** " +
x + " **** " +
client2 + " " +
lan2 + " " +
rounter2 + " " +
outlink2 + " " +
internet2+ " " +
inlink2 + " ********************end of n = " + n + "************************"
The compiling error is:
count.java:43: Can't make a static reference to nonstatic variable dclient in class count.
client1 = dclient;
^
1 error
What is wrong with it? Many thanks!
import java.io.*;
import java.net.*;
public class count
public static float dclient = (float)3.333;
public static float dlan = (float)0.01884;
public static float drouter = (float)0.00115;
public static float doutlink = (float)0.04185;
public static float dinternet = (float)1.2615;
public static float dinlink = (float)3.18129;
public static float client1 = 0;
public static float lan1 = 0;
public static float router1 = 0;
public static float outlink1 = 0;
public static float internet1 = 0;
public static float inlink1 = 0;
public static float client2 = 0;
public static float lan2 = 0;
public static float router2 = 0;
public static float outlink2 = 0;
public static float internet2 = 0;
public static float inlink2 = 0;
public static float x = 0;
public static float z = (float)3.333;
public static void main(String[] args)
for (int n=1; n<16; ++n)
client1 = dclient;
lan1 = dlan * (1+lan2);
router1 = drouter;
outlink1 = doutlink * (1+outlink2);
internet1 = dinternet;
inlink1 = dinlink * (1+inlink2);
x = n / (z + client1 + lan1 + router1 + outlink1 + internet1 + inlink1);
client2 = x * client1;
lan2 = x * lan1;
router2 = x * router1;
outlink2 = x * outlink1;
internet2 = x * internet1;
inlink2 = x * inlink1;
System.out.println(client1 + " " + lan1 + " " router1 " " outlink1 " " internet1 " " inlink1 " **** " + x + " **** " +
client2 + " " +
lan2 + " " +
router2 + " " +
outlink2 + " " +
internet2+ " " +
inlink2 + " ********************end of n = " + n + "************************"
Similar Messages
-
My daughters iPod touch asks for her pass code but when she types it in the cursor does not move or input any characters so,she cannot get into the iPod. This has suddenly happened for no apparent reason, what can we do? Can anyone help please?
Try:
- iOS: Not responding or does not turn on
- Also try DFU mode after try recovery mode
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
- If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
- Try on another computer
- If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
Apple Retail Store - Genius Bar -
help!!!!! i just uploaded 2 days ago the new 7 update to my phone , then yesterday morning , it said disabled and asked me for my pass code . I couldnt remember what it was , so after trying different ones it finally locked me out for good. how do i fix this !!!!!!?????
If your phone is disabled from entering the wrong passcode too many times you'll have to restore it to remove the passcode, as explained here: http://support.apple.com/kb/HT1212.
-
Apple needs to either tell me how to unlock it or ship me another iPhone 4 32gb.
Hello Stina36,
Thanks for using Apple Support Communities.
I'm sorry to hear about the issue you're phone is having. I did however find this support article that has great steps for you to go through in order to try and resolve this issue:
iOS: If you can't back up or restore from a backup in iTunes
http://support.apple.com/kb/TS2529
Take care,
Alex H. -
Does anyone know how to bypass the pass code after updating iPad to ios7? I've never used a pass code before and now it asks me for one. Also, my iPad is now disabled due to too many attempts to unlock it. Any help would be greatly appreciated.
Hi,
Follow the steps here to recover a disabled iPad:
http://support.apple.com/kb/ht1212
Hope it helps -
Cant use Muse. It ask for an activation code but I'm an active cc member
Like the topic says, every time I start up muse it starts to validate for a little while then it just prompts the activation an trial buttons.
Hi,
Please try steps below
Windows
Click on the "Start" menu. Select "All Programs" and then "Accessories"
Right-click on "Notepad" and select "Run as Administrator"
Click "Continue" on the "Windows needs your permission" dialog
When Notepad opens, click File and select Open
In the filename field type the following:
C:\Windows\System32\Drivers\etc\hosts
If any entries in the host file include keywords such as "adobe," delete those entries. These are used for Adobe Licensing.
From the "File" menu select "Save" after making changes
Restart Muse
Macintosh
Click on the "Finder" icon. Select the "Applications" folder
Open the "Utilities" folder and select "Terminal"
Type the following:
sudo nano /etc/hosts
Enter the OS user's associated password when prompted
If any entries in the host file include keywords such as "adobe," delete those entries. These are used for Adobe Licensing.
Press control+o to save the file
Press control+x to close the file
Restart Muse.
Let us know if that works -
Hello! I bought an iphone on ebay. I feel the introduction says that is not a service. need to unlock official data on where the contract but I am not asking for help
I'm sorry but your post doesn't make much sense in English. You may want to try posting again in your native language.
Best of luck. -
having problem buying online.need your help since it's my first time here.apple is asking for my billing address but when i enter my address here in qatar,it's saying i should enter a valid zip code within the u.s.does it mean i can't buy online even if it wil be shipped within u.s. only?
To buy in for delivery in Qatar, you should be starting from the Apple Qatar site:
http://www.apple.com/qa/
Do you have an Apple-ID? if you do, then you should not have to enter your Address again, and may be able to sidestep the US Zip Code issue. -
I purchased Creative Cloud through the Employee Purchase program. Had to reimage system. Need help reinstalling application. I have "redemption" code, but get error saying it has already been redeemed. Can you please advise how I go about getting my software reinstalled? If I was given the serial number when I redeemed, I don't have any record of it.
Thank you,
StarlaHi Starla Mehaffey,
I would suggest you to sign in with your Adobe ID during installation and your product will automatically recognize your membership details.
Refer this Link for any further assistance:- Redemption Code Help
Hope that helps,
Regards,
Rahul Tyagi -
Wanted to update the software now available, but it is asking for a pass code. As far as I remember in didn't put in any pass code , how do I settle this issue . Earlier updates were asking Apple ID but pass code for updating the new soft ware not known.
Hello Kewal,
Thank you for the details of the issue you are experiencing when trying to perform an update. I recommend trying to update using iTunes, and as always, it is a good idea to make a backup first.
iOS: Back up and restore your iOS device with iCloud or iTunes
http://support.apple.com/kb/ht1766
Update your iPhone, iPad, or iPod touch
http://support.apple.com/kb/ht4623
Thank you for using Apple Support Communities.
Best,
Sheila M. -
I have turned on my I phone this morning and it is asking for a pass code I have never used one and cannot get past the page can anyone help?
You won't get a reply on your email here. These forums are for users who want to help other users.
If you didn't buy your iPhone in your own country and you unlocked it to work in any way, you're out of luck. If you accidentally setup a passcode check out this old discussion:
https://discussions.apple.com/thread/3671431?start=0&tstart=0 -
i'm setting up my new ipad air and it's asking for id and password, but not accepting it. help me
If it is asking for an APlle ID password for an ID you do not recognize then you have stumbled upon the Activation Lock feature of IOS7.
Read more about it here:
http://support.apple.com/kb/HT5818 -
Having lost my password, et al., I obtained a new one successfully, but now when I tried to make a purchase, I was asked for my Security Code. How do I obtain a new Security Code since I have lost all my iPad documentation? Thank you, Dzurek123
That refers to the 3 digit security code on the back of your credt card, not a security code for the iPad.
-
I need to by apps but it keeps asking for my security questions ;/ but forgot the answers to my security questions and the security/rescue email too (i dont have USA number to call please help me and send my rest to my email
You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
(115668) -
I wish to erase all the content and setting on my iPhone but it is asking for a restriction code, how/where do I get this?
You get it from the person who owns the phone.
Maybe you are looking for
-
HOW TO RECOVER A LOST FOLDER OR FILES?
I have had severe problems with my Macbook lately and I'm scared I have lost a very important folder and some files. How can I find them or recover them completely? I have searched the trash, spotlight, and finder and its missing???! please help than
-
WD external harddisk not recognised after failed format
Hi folks, So I have an old WD 320GB harddisk I pulled from an old windows acer 5535 I wasn't using, I tried formatting it to OSX journaled so i could use it to back my friends mac up. The drive was initially readable and showed my windows 7 and files
-
Please help me to delete pending download files
Hi, I would like to delete pending downloads in my itunes.
-
Form initialisation problem QMS-00100
I am NOT succeeding in generating a form with the right pre-form tigger code: The following code should be in the PRE-FORM trigger: /* CGNV$PRE_FORM_NAVCUR */ DECLARE rg_id RECORDGROUP; gc_wnd GROUPCOLUMN; gc_item GROUPCOLUMN; BEGIN CGNV$.nav_opening
-
How can I delete older apple ID on app store?
I have bought a second-hand macbook pro, the old owner removed his account and created a new one for me. I did a clean new install of OS and added my appl ID, but app store doesn' allow to update apps. when it asks to insert my ID the space for the u