Getting the Output to work
Hi...,
In the void Triangleoutput part of my code, im supposed to make it Pass to the method the coordinates of the vertices, the lengths of the sides of the triangle, the measure of the angles of the triangle, and the area of the triangle. But I cant get the system out println to come out in my program when i run it. I put a few outputs in for an example of what i was trying to do. Also at the end of my code, i need to be using the my triangle method, usually i would use that when printing out my methods, but my instructions want me to put it in the triangle output part of my code, plus if i tried something like myTriangle.computeArea(); it would give me an error, even after i made it public, and im not supposed to use the public variables for this code. Thanks
import chn.util.*;
class Triangle
double computeDistance (int x1, int y1, int x2, int y2)
return Math.sqrt(Math.pow((x1-x2),2)+Math.pow((y1-y2),2));
double computeAngle (double side1, double side2, double sideOpposite)
return Math.acos(((Math.pow(side1,2)+Math.pow(side2,2))-
Math.pow(sideOpposite,2))/(2*side1*side2));
double radianToDegrees (double radians)
radians=180*radians/ Math.PI;
return radians;
double computeArea(double side1, double side2, double side3)
double svar = (side1+side2+side3)/2;
return Math.sqrt(svar*(svar-side1)*(svar-side2)*(svar-side3));
void triangleOutput (int x1, int y1, int x2, int y2, int x3, int y3,
double a, double b, double c,
double angle1, double angle2, double angle3, double area)
System.out.println("measure of side AB" + x1+x2);
System.out.println("measure of angle ABC" + angle2);
// End of Triangle class
public class TriangleStats
public static void main (String[ ] args)
ConsoleIO keyboard = new ConsoleIO();
Triangle myTriangle = new Triangle();
int vertex;
System.out.println("Enter the vertex (x, y) as two numbers with a space between them:");
vertex= keyboard.readInt();
}
It depends on what kind of class you consider Triangle to be.
If it's a class you want to create Triangle objects from then the class should hold the data necessary to define a triangle and the methods shouldn't be passed values. Insted the values should be held as private data of every object of Triangle. In that case you don't call,
computeArea(double side1, double side2, double side3)
you call
computeArea()
and side1, side2 and side3 are held internally to each Triangle object.
Or you consider Triangle to be a class that holds a certain set of triangle related methods together. Basically it's a class like Math for example. Then you should, as has been said, declare the methods static.
Similar Messages
-
I cannot get the Output Module to work. I was able to get the button to show up, but when I click on it, nothing happens. i need to export a PDF asap. I am trying to export 33 PSD files in BRIDGE to a PDF like I used to do on my other computer with bridge.
Let's start with the general things.
When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
(1) Bypass Firefox's Cache
Use Ctrl+Shift+r to reload the page fresh from the server.
Alternately, you also can clear Firefox's cache completely using:
orange Firefox button (or Tools menu) > Options > Advanced
On the Network mini-tab > Cached Web Content : "Clear Now"
If you have a large hard drive, this might take a few minutes.
(2) Remove the site's cookies (save any pending work first). While viewing a page on the site, try either:
* right-click and choose View Page Info > Security > "View Cookies"
* Alt+t (open the classic Tools menu) > Page Info > Security > "View Cookies"
In the dialog that opens, you can remove the site's cookies individually.
Then try reloading the page. Does that help? -
Are You All Able to get the Output In EXCEL Format
Hi All,
I have one question. Are You All Able to get the Output In EXCEL Format?? I am working on Oracle Apllication 11.5.10.2 and my XML builder is 5.0.1. Problem which i m facing is this...... Whenever i am submitting a concurrent program with format type different from PDF i could not able to view the ouput in desired format. When i am pressing view output it gives me a file in XML and when i save that file with extention 'xls' or 'rtf' then i could able to see the saved file in desired format.
Can anyone tell me where is the problem??? Is it a bug?
I am using microsoft world 2000 sp-3.
Please give your valuable comments. May be your comments can solve my problem..
Thanks
RaviHi I got Same issue
When I change Format to EXCEL from
Submit request>> Option>> Format = EXCEL
In window I am getting something HTML code and
when I try to copy it to Browser from Tools>> Copy File in to Browser I am getting following message
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
End tag 'p' does not match the start tag 'a'. Error processing resource 'http://our url.com:8000/OA_CGI...
<p class="c0"><a name="Text4" id="Text4"><a name="Text1_1" id="Text1_1"><span class="c1">Dept No <...
But I can see the output when Format is PDF
Pls suggest solution ,I am using EBS 11.5.10.2.
Thanks
Rahul
Message was edited by: Rahul
user576181 -
Cosuming web service using consumer proxy - not getting the output
Hello All,
I am not getting the consumer proxy output structue filled though the web service is successfully executed. I did the following steps.
1. Created a webservice form RFC BAPISDORDER_GETDETAILEDLIST
2. Created a consumer proxy for the above created WSDL document.
3. Tested the service by executing the proxy directly by feeding the input in the XML (sales document and partner view). it is working fine
4. Created a program to access the consumer proxy by passing the input(same input as per XML). I am not getting the output in the proxy output structure ( but I can see the RFC is successfully executed and having the right values in the debugging mode).
Is this the issue is due to the date fields (XML cannot consider a blank date )?
Please note: the partner output table parameter in the bapi (output I am looking for ) is not having any date fields.
Please help me to sort out this issue.
Thanks,
GopiHi Gopi,
From your description, I assume you used the SE37 transaction's menu option Utilities -> More Utilities -> Create Web Service -> From the Function Module, to expose the BAPI concerned as a Web Service.
If this is the case, then it is possible that you are falling foul of your SAP User ID not having the necessary Remote Function Call authorization to execute the BAPI.
A prerequisite for successfully calling an RFC-enabled Function Module (which is what a BAPI is) is that the User ID used to call the function module must have the required RFC authorization (Authorization Object S_RFC). For example, when calling function module BAPI_CUSTOMER_GET_ROOT, if the User ID lacks the requisite authorization in the target system, the following error message will be received by the Consuming application:
User <User ID> has no RFC authorization for function group V02HBAPI.
Notice, as you can see from the above message, RFC execution authorization is implemented at the Function Group level, not at the Function Module level. In othere words, granting a user the authorization to a function group (authorization object S_RFC) enables the user to execute all RFC-enabled function modules contained within that function group.
I am guessing the BAPI works for you in debug mode because you are not calling the BAPI remotely.
Let me know if this helps.
Best Regards,
Andy. -
Getting the output of a batchfile to Powershell
Greetings. I have a list of batchfiles that triggers Powershell script, that will throw error message when different errors were encountered in the execution.
In the end of the batchfile, I have included:
if %errorlevel% neq 0 (echo error in previous command & exit /b %errorlevel%)
and it works fine in itself.
However due to some requirements I need to use new separate batchfile that triggers a Powershell, that will in turn lauch the batchfiles mentioned earlier.
In the new Powershel, I have included:
$process = start-process $batchFile.FullName -ArgumentList $argumentList -PassThru -Wait
and is able to get $process.ExitCode. However I would like to get the output or error message that would be raised from the first batchfile instead.
Any advice?Hi Bdrc,
If you want to capture the output of the batch file, please try to run the batch file like:
d:\test.bat argu1 argu2
And the cmdlet start-process will start a process with the batch file.
For more detailed information, please refer to this article:
How to Execute a .bat File within a PowerShell Job
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang -
How to get the output of a standard report RFBILA00 in PDF form.
hi,
I have to get the output of the standard report RFBILA00 in the PDF form.
Thanks.Hi Rao,
you can run your report RFBILA00 in background and in background job you can add one more step, next in that step you can add custom report like zsubmit .
job should be set like
step1: RFBILA00 with variant.
Step2: zsubmit report with variant.
In Zsubmit report you can read, your first step spool using FM GET_JOB_RUNTIME_INFO
and pass that spool in the FM CONVERT_ABAPSPOOLJOB_2_PDF.
when second report run in job you can set your target like download in the server or send email etc.
Regards,
Prasenjit -
How to get the output of a procedure in to a log file ?
Hi, Everyone,
Could you please tell me
How do i write the output of a procedure to a log file ?
Thanks in advance...Hi,
could you please explain me more on how to use the UTL_file to get the output to a log file as in am new to PL/SQL
my script file is
EXEC pac_sav_cat_rfv.pro_cardbase (200910,'aaa',100,'test_tbl');
i need the output of this statement in a log file.
Could you please explain to me how it can be done.
thanks in advance -
Is it possible to get the output of a text container into Spool..?
Hi
I am trying to write a report for a standard transaction(SM65) in BDC and run thru background job so as to get the output in to Spool. Right now I am facing an issue to get the SM65(text container) tcode output into spool.
FYI..I am using "CALL TRANSACTION 'SM65' USING BDCDATA MODE 'E'."
Please provide tour valuable inputs.
Thanks!
ShivHi Shiv,
Instead of writing BDC for T-code SM65 I would suggest you to use following function module to get the required data.
CALL FUNCTION 'BPT_ANALYSE_START'
EXPORTING
server_name = servername_tmp
check_all_btc_servers = sbpt1020-allsrvchk
profile_check = sbpt1020-profilechk
xpgm_environment_check = sbpt1020-xpgmcheck
TABLES
protocol_tbl = global_protocol_tbl
EXCEPTIONS
OTHERS = 99.
Once you got the data into "global_protocol_tbl " you can create spool of it. -
Can get the AirPlay to work off my computer, but not my iPhone or iPad. I have the latest software. Airplay logo never appears on iPhone or iPad.
Try here > http://support.apple.com/kb/TS1538
-
How can I get the volume to work on my ipad after the iOS 7.02 update?
The performance of my ipad plummeted after the iOS 7 and 7.0.2 updates. The apps crash and some do not work at all and worst of all, my volume does not work at all. Is there a way I can at least get the volume to work?
I was planning on purchasing a MacBook Pro but with all these issues I am reconsidering.I have tried changing the volume both by using the volume buttons on the side and through settings. I have updated all the apps. Closed and reopened a million times hoping it was just a one time deal but I have had continuous problems since the update on my ipad.
I love the update on my iphone but for some reason the ipad did not adjust well. I really would like to get it fixed because I love my ipad but there is no use when the apps an volume do not work. -
the touch screen on my ipod touch is not working. meaning that i can not unlock my ipod or even turn it off. is there anything i could to to get the screen to work again?
Try # 2 and 3 in link below. If neither work, your screen digitizer might need to be replaced.
Basic troubleshooting steps
17" 2.2GHz i7 Quad-Core MacBook Pro 8G RAM 750G HD + OCZ Vertex 3 SSD Boot HD
Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101 -
NOOB Question - Cannot seem to get the output in a text or CSV file - Please help!!
I was able to put together a script which finds members of a certain AD group, filters down the users, and then calculates the number of days till a password reset is needed. I am able to get on screen exactly what i am looking for, but cannot seem
to figure out how to get the same data to a file. What i am doing wrong? two goals here:
1. Create a spreadsheet with a list of users whose password is about to expire.
2. Down the line automate an email to users whose password is about to expire.
Here is my code:
## Get List Of Users in Password Change Lockout that do not have an expired password or a password that never expires
$Names = (Get-ADGroupMember -Identity "Password Change Lockout" -Recursive |`
Get-ADUser -Properties * |`
Where-Object {$_.PasswordNeverExpires -eq $False -and $_.PasswordExpired -eq $False} |`
Sort-Object name |Select-Object -ExpandProperty SamAccountName)
## Get Password last Set values for all
Foreach ($Name in $Names)
$VAR1 = (Get-ADUserResultantPasswordPolicy -Identity $Name).MaxPasswordAge
$VAR2 = (Get-ADUser $Name -Properties *).passwordlastset
$VAR3 = (Get-ADUser $Name -Properties *).name
$DTPC = (New-TimeSpan -Start (Get-Date) -End ($VAR2 + $VAR1) | Select-Object -ExpandProperty Days)
Filter users to those who need to change thier password in 15 days.
If ($DTPC -lt 15)
No matter what i try between the {} after the If statement, I cannot get the output to a file. However, if I use a Write-Output I get exactly what i looking for. I feel like i am forgetting some basic concept and could really use some help. Thanks.
Matt
Matt DillonHi Matt,
I generally create an empty array (something like $out = @()) at the top of the script and then use $out += $desiredOutput inside of the foreach loop.
Outside of the loop, you can then pipe $out to Out-File or Export-Csv, depending on your needs.
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing) -
How to get the output path in Java?
Hi all,
is there a way (method) to get the output path (where compiled classes are put) in Java?
thx a lot!
MicheleIf you have already successfully loaded the classes into memory, and you want to find out where the classes are physically stored, then you can use Class.getResource() to retrieve the location of the file.
import java.net.URL;
public class Find
private void run(String obj) {
try {
Class cls = Class.forName(obj);
//Here is the change to input correct resource path
//instead of class name
String resourcePath = "/"+obj.replace('.','/')+".class";
URL url = cls.getResource(resourcePath);
System.out.println(url);
catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) {
Find find = new Find();
find.run(args[0]);
}java Find java.lang.String
jar:file:/usr/local/j2sdk1.4.2_13/jre/lib/rt.jar!/java/lang/String.class
Edited by: Jin on Oct 23, 2007 10:38 AM -
How to get the output format options of SAP QUERY
Hi Gurus,
I want to get the output options available for sapquery program.means when you execute the program "AQZZ/SAPQUERY/FDF1============" you will get output options like sap alv,display as table,wordprocessing etc.
i am not able to unsderstand the logic in that standard code.my requirement is after fetching the data from the database i want to provide the ouput options SAP ALV,DISPLAY AS TABLE,WORD PROCESSING,SPREAD SHEET,FILESTORE.
I can output the data in SAP ALV and i can store the data.But i am not able to use the the remaining options in my program.please provide me solution.
I am very much thankful to the people who can provide me the solution.Hi,
If you have a query then go to transaction 'SQ01' . Then press the change button . Then u will able to see the Output Options.Their u can select the option what ever u want. -
ABAP Program where iam not able to get the Output.
Hi Team,
I have written the code for the following requirement but could not get the output
Can you people please have a look at this.
Create a Report with the following output.
In the selection screen you should have KUNNR and Delivery date(VBEP-EDATU).
When you select the Customer number and Date in the Selection the following output should be displayed.
Sales order Number (VBAK-VBELN)
Sales order Material (VBAP-MATNR)
Quantity (VBAP-ZMENG)
Ship-to-Party (VBAK-KUNNR)
Delivery Number(LIKP-LFDAT).
The key field used for fetching the values is VBELN.
Here the values from table VBAK are not getting selected.
Please check the Program and give your valuable suggestion.
I checked in Debug mode but could not get the values
Regards,
Pradeep P.Hi Ramchand,
Plz find the Code.
*Fetching vbeln matnr zmeng kunnr from vbak and vbap
select a~vbeln
b~matnr
b~zmeng
a~kunnr
into corresponding fields of table it_sales
from vbak as a
inner join vbap as b
on avbeln = bvbeln
where a~kunnr in s_kunnr.
If sy-subrc = 0.
sort it_sales by vbeln.
endif.
*Fetching vbeln edatu lfdat from vbep and likp
select a~vbeln
a~edatu
b~lfdat
into corresponding fields of table it_delivery
from vbep as a
inner join likp as b
on avbeln = bvbeln
for all entries in it_sales
where a~vbeln = it_sales-vbeln
and a~edatu in s_edatu.
Regards,
Pradeep P.
Maybe you are looking for
-
I have purcase several audio books via Itunes and they are on my computer however I have been unable to figure out how to transfer (sync??) them to my Ipod. Also I have receipts for several Itune audio books but they are not showing up on my purchas
-
Acquired a 2007 Imac 5,1 - need help
I have been given a 2007 Imac after my old work office closed down. I am a Newbie to macs so am a bit lost. Its an Imac 5,1 Intel Core 2 Duo processor 2.16GHz Memory 1GB Operating OS X 10.4.11 I dont think it runs as fast as it should. Probably has a
-
Hi All, can anybody have a idea about say while creating a new container element by clicking CREATE button in container we have several options like Element: name: short descreption: object type : ABAP dict reference: structure: field: ABAP di
-
Application builder (using OpenG source)
I just made a LV program and executable thing in LV8.2.0. Only one function (for converting cluster->ini) from OpenG was used to make the program easily. When I copy the program folder, so many OpenG (maybe related to the converting routine) codes we
-
I have just changed from Mac Pro with SATA to an iMac i5 so am now trying to get the best from Firewire 800 with RAID0 and 5 drives I was using with SATA. What I noticed was that using a Lacie Flat Firewire 800 cable I was getting just 26Mb/s Read ti