Back to bother you guys again
Q. Enter 10numbers using command line. Do the addition and print the DIV along with % . Must use a separate meathord.
A.
class Grades1
public static void main(String[] args)
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int c=Integer.parseInt(args[2]);
int d=Integer.parseInt(args[3]);
int e=Integer.parseInt(args[4]);
int f=Integer.parseInt(args[5]);
int g=Integer.parseInt(args[6]);
int h=Integer.parseInt(args[7]);
int i=Integer.parseInt(args[8]);
int j=Integer.parseInt(args[9]);
int r = calmarks(a,b,c,d,e,f,g,h,i,j);
String grade=calgrade(r);
int z=((r*100)/1000);
System.out.println("Your Total Marks Is :"+r+" And Div Is :"+grade);
System.out.println("Marks In % Is :"+z);
static int calmarks(int a,int b,int c,int d,int e,int f,int g,int h,int i,int j)
int z=(a+b+c+d+e+f+g+h+i+j);
return z;
static String calgrade(int r)
if(r<300) return "Fail";
else if(r<450) return "Third";
else if(r<600) return "Second";
else if(r<800) return "First";
else return "Star";
}now she told me to write the code such a way that
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int c=Integer.parseInt(args[2]);
int d=Integer.parseInt(args[3]);
int e=Integer.parseInt(args[4]);
int f=Integer.parseInt(args[5]);
int g=Integer.parseInt(args[6]);
int h=Integer.parseInt(args[7]);
int i=Integer.parseInt(args[8]);
int j=Integer.parseInt(args[9]);should be in a loop so that i need not write sop much..
need help..............................
i have no idea how to do a loop in user input on command line
please give me an idea so that i can write the code my self........................
warnerja wrote:
so please guys help me by puting the code, for me to read and under standNo, that's YOUR job. YOU do the work, and ask specific questions about it if needed. The forum people are here to nudge you in the right direction, not to do lazy goof-off's homework for them.
Please ask the forum admins to rename your username to something more appropriate, like failguy .Thats so mean! Where is your Christmas spirit?
The syntax of a for loop is:
for (int i = 0; i < args.length; i++) {
//int i is a counter variable and is declared in the first part of the loop
//After every loop, the less than comparison is made and if i is NOT less than the args array size
//then the loop is done.
//i++ increments the i counter after every iteration of the loop
}Knowing this it is perfectly legal to do this in your for loop...
Integer.parseInt(args);
where the i counter is in place of a hard coded number.
Similar Messages
-
I'm really sorry to bother you guys, but this is all new to me! i'm trying to put my face on another persons photo as a gag! i have been struggling with this all day! can anyone explain to me how this is done in language i can understand??? thanks in advance!
What software do you own? Give details, please.
Photoshop is a professional level application that makes no apologies for its very long and steep learning curve.
It's not something you can learn in a forum, question by question. Teaching someone Photoshop from scratch exceeds the scope of this or any other forum.
The process involves isolating your face, by selecting it and deleting the unwanted parts around your face or with layer masks, then placing it as a new layer on top of your target image, making sure it's the right size, color, lighting, etc. Google for tutorials on any of those elements you are unfamiliar with, -
Soooo, any chance of you guys EVER bringing back trade-in promos on games again?
It seems like forever since you guys did an actual trade-in promo on games and when you did it was the lowest amount possible(30%). Any chance we'll actually see the good trade promos make a comeback or are game trade-ins pretty much done and buried at this point(as is evidenced by the laughable disc only and pretty barren pre-owned sections at my closest store)?
While we're at it, how about a return to halfway decent trade in values to go with any promotions? :-P Not that I'm not excited beyond belief at getting $2 for (insert semi recent game name here) plus my extra $.20 for being a GCU member.Hey CheapestGamer,
While we generally can’t speak to any upcoming promotions or anything like that, I can certainly say that I agree with you here. I usually wait until a solid trade-in promotion to trade my games in and I can understand where you’re coming from in regards to that bonus only being 30% recently. It's definitely better than nothing, though!
With that said, this fall is going to be insanely busy with all of the upcoming gaming releases, so I’m pretty confident we’ll be running some trade-in promotions to coincide with said releases. Here’s to hoping for a 50% bonus, or even higher!
Cheers,
-
hey how are you guys listen i have an iphone 4s the one i use with the H20 CARRIEr and i trying to enable the option call forwarding and when i type tho number i go back and i notice to the call forwarding it turning off as soon i back to the main menu ?
There are a lot of posts in the forums today with people having problems with iMessage. There was also a published outage yesterday, so it's possible there are still some issues that may be impacting you both.
I would just wait it out - I'm sure it will be sorted out soon. -
iba allow others to make text edits. What workflow are you guys using to allow others to make text edits once the iBook has been layed out and formatted? Is it too late? Do I need to export txt then reimport the editted text and reformat it all again?
Hi Ken,
Thanks for the reply. The project I am working on is a test project for a customer. They could potentially want a number of their educational subjects presented as an interactive text book. The intent of this first project with them is to establish a logical workflow that will allow us to efficiently estimate costs and allow for review throughout the design process. Having worked with customers on creative projects in the past I can anticipate that they will want a number of changes made once they see a working version of the interactive text book.
It is a grim reality that no project can be fully edited and planned prior to working on it and I know revisions and changes are always made once the customer can see their product. It is ok with me if there is no easy way to pass the text back and forth from the customer and me without having to reformat everything but I just want to know that is the way it works in order to provide a realistic time estimate for the project.
My hope was I would be able to export the formatted text, allow them to make edits and then reimport that formatted text. The style sheets I am using are from one of the iBooks Author templates.
Do you know if there is a way to use (or export ) this style sheet so it can be used in a Pages Document?
Or, would the best option be to have the customer install iBooks Author? This would require the customer to have a mac and the software so it doesn't work for all cases.
Another idea I was considering would be to export the book as a PDF and have the customer add markup and notes to the PDF.
All of these options do not seem too great to me.
I am open to any ideas.
Thanks,
Rob -
My IPhone shut off by itself and I can't turn it back on. My lock screen button is broken and I tried plugging it into the wall but nothing happened. Can you guys please help me.
IIf the battery was completely drained it might take some time before the phone will respond. Wait at least 30 minutes with the phone connected to the charger. Then reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. If the phone starts up let it continue to charge until it's 100%.
if the broken button will not let you do the reset Make an appointment at an Apple Store to have your device examined by a technician. Or contact Apple Support. -
Why has iTunes seperated a album into indevidual songs, which I have copied over from my external hard drive into iTunes? How can you pull all the songs back together into one album again?
Steve MacGuire a.k.a. turingtest2 - iTunes & iPod Hints & Tips - Grouping Tracks Into Albums - http://www.samsoft.org.uk/iTunes/grouping.asp (older post on Apple Discussions http://discussions.apple.com/message/9910895)
Quick answer: Select all the tracks on the album, File > get info, and either give them all a single "album artist", or check the "compilation" flag (as in https://discussions.apple.com/message/17670085).
If these are from multiple-CD sets you may also need to enter the appropriate information in the disc number fields. If they are not a multiple CD set you still need to make sure the disc number fields are set correctly or all empty. -
Good morning i already bought the converter pdf to word ,why you guys charged again
hello Good morning i already bought the converter pdf to word ,why you guys charged again@
I suggest that you Contact Customer Care - click on the Still need help? button to chat with an agent.
[topic moved to ExportPDF forum] -
My father and I have an ipad. My ipad wanted to do a back up. We both had our i[ad back up and i accedintally click on his back up . My question is how do i get my back up on my ipad again
مرحبا بكم
اخي الكريم اذكنت تريد تبادل إعلاني
تم نحميل ولا يعمل علي الكمبيوتر WhatsApp 2.10.2 هذ ابرامج
ولكم ما جزيل الشكر
<Link Edited by Host> -
I deleted my Mail app sometime back. I reinstalled it again, today, on my Macbook Snow Leopard Mac OS but when I try launching Mail, it says ' You have Mail version 4.0(1075/1085). It can't be used on Mac OS X version 10.6.8(Build 10K549)",
The Mail version for your machine is 4.6 (1085) You can get it via the Combo updater. Mac OS X 10.6.8 Update Combo v1.1
Then follow with software updates to pick up the most recent security and iTunes updates. -
I have an iphone 4 which was lost on the bus ride home from an amusement park with my class. The phone does not have find my iphone on it and i cannot track it. Is there anything you guys would say i should do to get this phone back.
Call it and ask whoever answers to give it back to you.
-
Do you guys change back glass of iphone 5s ? , how much ?
Do you guys change back glass of iphone 5s ? , how much ?
$100000000.
I will even clean it with a toothbrush and q-tip. -
Hello ! I got a so good answer last time... that I'm coming back to you guys ! I'm trying to send a text message to more than hundred people... It doesn't work... Any ideas ?
Thanks a lot in advance for your answers !!!
Have a nice evening/day !That is a legitimate Mozilla newsletter. As it says in the email:
You're receiving this email because you subscribed to receive email newsletters and information from Mozilla. If you do not wish to receive these newsletters, please click the Unsubscribe link below.
Unsubscribe https://www.mozilla.org/en-US/newsletter/existing/ad9febcf-65ac-41fd-810b-798945f448f3/
Modify your preferences https://www.mozilla.org/en-US/newsletter/existing/ad9febcf-65ac-41fd-810b-798945f448f3/ " -
I'm asking why you guys canceled my apple account and I'm wondering when I'm getting my account back
I'm asking why you guys canceled my apple account and I'm wondering when I'm going to get it back.please I need it
Contact Apple
http://expresslane.apple.com
http://www.apple.com/retail -
Will you guys take back an ipod touch if has a cracked screen?
will you guys take back an ipod touch if has a cracked screen?
Apple will, however, replace the iPod for their standard out-of-warranty replacement fee.
http://www.apple.com/support/ipod/service/faq/
Regards.
Maybe you are looking for
-
Employer pension contribution issue
Hi experts, please suggest me this issue as per SAP employer pension contribution have to deduct 541 rupees based of 6500 basic amount with 8.33%. More than 6500 basic amount have to add in 3.67% employer PF contribution.So one employee basic is 5000
-
IPhoto to iDVD photos too light
I've burned photos to iDVD with moderate success in the past. My recent effort produces images that are much too light on my TV. Any suggestions apart from darkening all my images?
-
My bank card will no longer link to my billing information when it has previously worked; I'd like to know why this is happening and how to resolve it
-
can anyone advise about the budget checking in purchasing.. what are the business steps, and what is the standard (for assets and stockable materials) should it be checked in the PR or in the PO? what is the business flow for each. thank you
-
My ipod touch screen is all of a sudden very hard to operate, it is unsensituve to pressure
all of a sudden my screen is hard t use, it doesnotnfrespond to touch, i need to use hard repeated touches to make it do anything