Please assist. I want to add an array to my area calculation of a triangle
Yes, it compliles and runs,with just one set of integers, but I want to be able to calculate 3,4, 5 and 1,10, 2 as well using arrays. and I don't understand arrays enough to do this.
public class Heron{
private static void main (String [] args)
int a=3;
int b=3;
int c=3;
float s= (a+b+c)/2;
float y=s*((s-a)+(s-b)+(s-c));
if (s > a && s > b && s > c)
System.out.println ("The area of the triangle is " + Math.sqrt (y));
else
System.out.println ("Value=0");
}
public class Euclidean {
static int [] triangle;
private static void main (String [] args) {
if(args.length == 0) {
System.out.println("Specify length and height");
System.exit(0);
} else if(args.length % 2 != 0) {
System.out.println("incorrect number of args!");
System.exit(0);
triangle = new int[args.length];
for(int x = 0; x < args.length; x++) {
triangle[x] = Integer.parseInt(args[x]);
for(int i = 0; x < triangle.length; x++) {
calc(triangle[x], triangle[x+1]);
//System.out.println(x);
x = x+1;
public static void calc(int length, int height) {
System.out.println("Length = " + length);
System.out.println("Height = " + height);
int area = (length * height) / 2;
System.out.println ("The area of the triangle is " + area);
Similar Messages
-
How to add byte[] array based Image to the SQL Server without using parameter
how to add byte[] array based Image to the SQL Server without using parameter.I have a column in table with the type image in sql and i want to add image array to the sql image column like below:
I want to add image (RESIM) to the procedur like shown above but sql accepts byte[] RESIMI like System.Drowing. I whant that sql accepts byte [] array like sql image type
not using cmd.ParametersAdd() method
here is Isle() method contentSQL Server binary constants use a hexadecimal format:
https://msdn.microsoft.com/en-us/library/ms179899.aspx
You'll have to build that string from a byte array yourself:
byte[] bytes = ...
StringBuilder builder = new StringBuilder("0x", 2 + bytes.Length * 2);
foreach (var b in bytes)
builder.Append(b.ToString("X2"));
string binhex = builder.ToString();
That said, what you're trying to do - not using parameters - is the wrong thing to do. Not only it is insecure due to the risk of SQL injection but in the case of binary data is also inefficient since these hex strings are larger than the original byte[]
data. -
As I was installing the Windows 7 on my Imacwith the bootcamp and stated how I wanted to divide the drive I put 160, but I want to add more space because of the adobe software it will not install two of them, so how can I add more on the drive space to from 160 to 250? please help thank you.
I'm not sure this is what you're looking for, but it might help:
"If you made the Windows partition too small
First, back up all the information on your Windows partition. Then run Boot Camp
Assistant to restore your disk to a single volume. Restart your computer and use Boot
Camp Assistant to partition the disk again and reinstall Windows. Don’t forget to install
the Boot Camp drivers after installing Windows."
(from Bootcamp Assistant Manual see pg 22) -
I want to add items to the bookmarks toolbar. for example: the Zoom Toolbar addon. This works, but not only the favicons appear on the bookmarks toolbar, aswell as the underlined text. How to avoid this?
I only want the favicons from an addon to appear on the bookmarks toolbar, not with the underlined text. How to do this?
This problem doesn't happen with any other toolbar. And this problem didn't happen with an earlier version of firefox. Please Help!
Thanx, BassMann.If you only want the favicons and not the names of the bookmarks on the bookmarks toolbar, you can do that with the [https://addons.mozilla.org/en-US/firefox/addon/4072/ Smart Bookmarks Bar] add-on.
-
I have few PDf files on my computer and I want to add them to my ipod touch, please tell me the procedure on how should I do that? Secondly I want to run these Pdf files through the ibook app, as it also have the Pdf file sections
You should be able to just place them in your Books library in iTunes and check to ensure that your Book library is configured to sync to your iPod when you sync your iPod to iTunes.
-
Hi
I wonder if you could please assist me. I tried the online 'contact us" I
chose my iPad - but when I need to chose the second part - it does not give
me any options - hence I cannot go further?
My kindle does not want to open on my iPad. When I touch it - a grey screen
with kindle written in the middle appear for a few seconds. Then goes away.
I have restarted the iPad - still the same? What else can I do?
Thanks
MarynaJudging by the reviews of the current version of the Kindle app you aren't the only one haveing problems with it - it looks like Amazon need to fix something with the app.
Have you tried closing the Kindle app via the iPad's multitasking bar and seeing if it works when you re-open it ? Double-click the home button to open the taskbar, and then swipe or drag the Kindle app's screen from there up and off the top of the screen to close it, and click the home button to close the taskbar.
You could also try deleting the app and redownloading it via the Purchased tab in the App Store app on it (you will then need to redownload your books in the app, assuming that it opens). -
PLEASE I WANT TO ADD Rescue Email AND I HAD FORGET Q ANSWER
PLEASE I WANT TO ADD Rescue Email AND I HAD FORGET Q ANSWER
PLEASE HELPHOW CAN I CHAT WITH THE SUPPORT LIKE EFORE
MY COUNTRY IS NOT IN THE LIST -
I hav tried your way of editing the account information, but my billing is not editing , I want to change my card no. but I am not able to do that,would you please assist me,I hav tried the above described methods
To Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact -
My registered credit card on my account has been taken off, I've tried to add a new card but it wont accept it. Why? Please could you tell me why? I want to add more music.
Unfortunately we can't but support can my friend.
https://expresslane.apple.com -
Hi I wanted to cancel my membership and get a refund. Please assist me how to do so
Hi,
Hi I wanted to cancel my membership and get a refund. Please assist me how to do soFatimah,
Here is how to cancel:
http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
If there are any issues, you may go here for a chat,
Creative Cloud support (all Creative Cloud customer service issues, chat open between 5AM and 7PM PST/PDT on workdays)
http://helpx.adobe.com/x-productkb/global/service-ccm.html
or here for Adobe Support (phone),
http://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html
You should be aware that anything created with CC/CC2014 can only be accessed with Adobe Acrobat/Reader, and only if saved with PDF Compatibility. You can only work on with it if you renew the subscription (temporarily) or if you downsave to a CS version that you have. -
PLEASE DO NOT DISABLE MY ADD ONS. INSTEAD AMEND YOUR OWN SOFTWARE. I DO NOT WANT YOU TO DISABLE MY VIRUS SCAN SOFTWARE TREND MICRO ANY LONGER. TREND MICRO IS MORE IMPORTANT TO ME THAN FIREFOX!
I assume you're referring to the Add-On Compatibility Checker disabling your extensions when you update?
To disable Add-On Compatibility Checking you can follow the following steps:
1) Enter "about:config" into the URL bar (no quotes)
2) Right click and create a New Boolean
3) Name it: extensions.checkCompatibility
4) Set it to: False
You can now restart Firefox and it will no longer disable your addons.
Keep in mind that without the Compatibility Checker Firefox can't guarantee that your extensions will work with the latest versions. -
Hi everyone.
I had an itunes account for my classic and a few months ago wanted to add my daughters ipod to it. it told me when i pluged hers in 2 ipods could not use the same account and asked me if i wanted it to link her ipod and delete the current libary. like a fool i said yes. now i have a party comming up and cant plug my classic in without it saying if i sync it will wipe my 6000 songs and leave me with the new blank itunes that i have just set up.
what i want to do is add my 6000 songs to a new apple id libary/itunes without it wiping all my songs. does anyone know how to do this.
help thanksSince all of your music came from your computer in the first place, then it should still be there and should be included in your backup copy of your computer.
" it told me when i pluged hers in 2 ipods could not use the same account"
This is not true. You have misunderstood.
You can sync as many ipods/iphones/ipads as you like to one one library. -
Can I use my iPad to record excel inventory figures? I have excel on my Macbook Air and have Mavericks on it. But I use the iPad when I run around taking inventory. The computer is just too large and cumbersome to carry while walking around. I Want to add numbers to my excel docs whilst right on my ipad as I go through inventory.
Is there a way to get my excel doc into my iPad and open it to add numbers?
And, because Mavericks is now the system that allows iPad (ios) devices to talk to Mavericks on macs, isn't this supposed to now be doable?
And, woe is me if not yet at this time. If so, is there an Application some smart person created that will allow me to transfer from mac to ipad and back to mac and excel numbers I input?
Muchos gracias!You will need Numbers (On your Mac) and then you can do what you wish.
-
I am using quicktime player and i want to add a music track can anyone help me please
I want to add a music track to my quicktime movie any help out there
HI sjr64,
I would suggest that you use iMovie or a similar video editing program to add a music track to your video:
iMovie (2013): Add audio and music
http://support.apple.com/kb/PH14708
Thanks for coming to the Apple Support Communities!
Cheers,
Braden -
I get an error (-50) when trying to access the app store on my desktop PC. I have no kaspersky parental blocks active. Please assist!!
Try Here > http://support.apple.com/kb/TS1583
And See this Discussion...
https://discussions.apple.com/thread/4204776?start=0&tstart=0
Maybe you are looking for
-
How do I enable Task Panes in Acrobat 9 Pro?
I'm trying to use Acrobat 9 Pro at work, and I'm repeatedly being given instructions on how to do various things that all involve the Task Pane(s). However, at some point on this machine I (or the person before me, since I haven't ever used Acrobat b
-
IPod continues to reboot nonstop.
I followed the iTunes instructions word by word... my iPod, which was the first gen of the video iPods, keeps rebooting and showing the Apple logo. iTunes said it was successful updating the iPod however the iPod now keeps on rebooting with the Apple
-
I got carried away and did more undos than I should have. Is there a way to do multiple re-dos, so I can go back to where I was? If not, I'm going to have to edit everything all over again, including oomplex effect attributes. Thanks
-
Can you find lost photos?
I have lots of pictures in various libraries on the hard disk. I cannot search for them, and so I cannot get iPhoto to change libraries. If I could only search for the files in the iphoto library, I could find the libraries! Can you search for JPEG o
-
Usually this system rejects access using SSO tickets exception
Hi, I'm facing a problem when trying to access to some tasks in the UWL. It appears an error message saying "Usually this system rejects the access using SSO tickets" (it's not an accurate translation, the message in spanish says "Generalmente este s