Need help on some "expected" errors
I get two error when running this program. Can any help?
import java. text.DecimalFormat;// allow numbers to format to decimal form
import javax.swing.JOptionPane;
public class Grade.java {
public static void main( String args[] )
int inputcounter;
int counter;
char grades;
double overall; //varibale will store sum of grade in decimal form
double grade; // varibale will store grades in decimal form
double average; // varibale will store average of all three assignment in decimal form
String data;
overall = 0;
inputcounter = 0;
counter = 2;
data = JOptionPane.showInputDialog( "Enter grade score from 1 to 100" );
grade= Double.parseDouble( data );
if( grade >100 ^ grade<1 ){ //will validate user input
data = JOptionPane.showInputDialog( "Please re-enter your grade score from 1 to 100" );
grade= Double.parseDouble( data );
while ( counter != 0 ) {
overall = overall + grade;
inputcounter = inputcounter + 1;
counter = counter - 1; //insure user enters 3 sperate values
DecimalFormat twoDigits = new DecimalFormat( "0.00" );
average = (double) overall / inputcounter;
//displays percentage grade
JOptionPane.showMessageDialog( null,
"Your overall percentage grade is " + twoDigits.format( average ), "Ending Percentage Grade", JOptionPane.PLAIN_MESSAGE );
if (average >= 90) {
grades = 'A';
} else if (average >= 80) {
grades = 'B';
} else if (average >= 70) {
grades = 'C';
} else if (average >= 60) {
grades = 'D';
} else {
grades = 'F';
//displays letter grade
JOptionPane.showMessageDialog( null,
"Your overall letter grade is " +grades, "Ending Letter Grade", JOptionPane.PLAIN_MESSAGE );
System.exit( 0 );
}
First problem is public class Grade.java {
Should just be Grade and nothing else
Similar Messages
-
I need help with this code error "unreachable statement"
the error_
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errors
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class Tools//tool class
private int numberOfToolItems;
private ToolItems[] toolArray = new ToolItems[10];
public Tools()//array of tool
numberOfToolItems = 0;
for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
toolArray[i] = new ToolItems();
}//end for loop
}//end of array of tools
public int search(int id)//search mehtod
int index = 0;
while (index < numberOfToolItems)//while and if loop search
if(toolArray[index].getID() == id)
return index;
else
index ++;
}//en while and if loop
return -1;
}//end search method
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0;
int index;
index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
}//end delete method
public void display()//display method
for(int i = 0; i < numberOfToolItems; i++)
//toolArray.display(g,y,x);
}//end display method
public String getRecord(int i)//get record method
// return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
}//end getrecod
}//end class
Edited by: ladsoftware on Oct 9, 2009 6:08 AM
Edited by: ladsoftware on Oct 9, 2009 6:09 AM
Edited by: ladsoftware on Oct 9, 2009 6:10 AM
Edited by: ladsoftware on Oct 9, 2009 6:11 AMladsoftware wrote:
Subject: Re: I need help with this code error "unreachable statement"
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errorsThe compiler is telling you exactly what the problems are:
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
int index;
index = search(id); //< -----------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
// <<== HERE where is the return statement?
}//end delete method
public String getRecord(int i)//get record method
// return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
}//end getrecod
}//end class -
I have an error -5000 when I try to record in GarageBand V10,02..I urgen need help, I have an error -5000 when I try to record in GarageBand..
I just reinstal OSX 10,9,2 marveiks and downdload the GB.. but when I try to record, the error ocurr
I urgen need help
thanksThis is probably one of the files that is required by the template you are using.
These files are inside the iWeb app. Control click the iWeb app icon and select "Show package contents".
You need to dig down through the folders and files to find what you want...
Contents/Resources/da.lproj/Templates/
If the file is missing you would need to re install the iWeb app...
http://www.iwebformusicians.com/iWeb/iWeb-Tips.html -
Need help in understanding the error ORA-01843: not a valid month - ECX_ACT
Hello All,
We need help in understanding the Transaction Monitor -> Processing Message (error "ORA-01843: not a valid month - ECX_ACTIONS.GET_CONVERTED_DATE").
And how to enable the log for Transaction Monitor -> Processing Logfile.
Actually we are trying to import the Purchase Order XML (OAG) into eBusiness Suite via BPEL Process Manager using the Oracle Applications Adapter. The process is working fine with expected payload until it reaches the XML Gateway Transaction Monitor, where we are getting this error.
thanks
muthu.Hello All,
We need help in understanding the Transaction Monitor -> Processing Message (error "ORA-01843: not a valid month - ECX_ACTIONS.GET_CONVERTED_DATE").
And how to enable the log for Transaction Monitor -> Processing Logfile.
Actually we are trying to import the Purchase Order XML (OAG) into eBusiness Suite via BPEL Process Manager using the Oracle Applications Adapter. The process is working fine with expected payload until it reaches the XML Gateway Transaction Monitor, where we are getting this error.
thanks
muthu. -
I need help with some character replacement
I have a package that calls another package to determine if there are any of 4 values (&,<,>,") and I want to replace the value in the package with the proper value for HTML. If I can get the & figured out I can handle the rest, I just need help getting past this part. I consider myself a novice at PL/SQL so any input is welcome. The package body gives me this message on compile:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
if
I'm stuck on how to do the actual replace within the package. The code for the replace block is below: using a package and procedure in the package body. I'm using TOAD 9.x on 10gR2.
I have a feeling the the assignment of the := is having a problem but I'm not sure. This is all part of a larger chunk of code I've written to dynamically create audit triggers (before and after) for my data tables and it writes out to the audit in xml on a row by row basis. The XML insert is failing on on the 4 special characters that need to be converted to their HTML proper use.
CREATE OR REPLACE package pkg_audit_xml
as
procedure change_illegal_char
(p_new_val in varchar2,
p_old_val in varchar2,
p_has_changed in out boolean);
end;
CREATE OR REPLACE package body pkg_audit_xml
as
procedure change_illegal_char
(p_new_val in varchar2,
p_old_val in varchar2,
p_has_changed in out boolean)
is
v_temp clob;
begin
if ( nvl(p_new_val, ' ') <> nvl(p_old_val, ' ') ) then
p_has_changed := true;
p_old_val := replace(p_old_val,'&','&');
p_new_val := replace(p_new_val,'&','&');
end if;
end;
end pkg_audit_xml;
/SQL> create or replace procedure aa_test(a_old_val IN varchar2) as
2 begin
3 a_old_val := substr(a_old_val,1,4);
4 dbms_output.put_line(a_old_val);
5 end;
6 /
Warning: Procedure created with compilation errors.
SQL> show errors
Errors for PROCEDURE AA_TEST:
LINE/COL ERROR
3/2 PL/SQL: Statement ignored
3/2 PLS-00363: expression 'A_OLD_VAL' cannot be used as an assignment
target -
Need help in analysing the error in JasperReportIntegration Test Applicatio
Our DBA installed Jasper Reports Integration kit Version 1.1.0.0 in our test environment. Apex version is 3.2.1.00.12. Oracle database is 11g and Apache Tomcat is 7.0.26
I was able to bring up the Jasper Reports Integration test application. When I navigate to "Report Tester" tab, changed the JasperReportIntegration URL to the correct localhost and then cklick the "Show report (directly)" button, I got this message:
Jun 12, 2012 11:41:58 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [ReportWrapper] in context with path [JasperReportsIntegration] threw exception [Servlet execution threw an exception] with root cause
Throwable occurred: java.lang.NoClassDefFoundError: net.sf.jasperreports.engine.util.JRStyledTextParser (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:87)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:142)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:52)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
at de.oc.integration.jasper.webapp.ReportWrapper.service(ReportWrapper.java:318)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
Can anyone help me understand this error and let me know if this message is caused by installing the jasper report integration kit incorrectly?
Thanks.
Edited by: bratz69 on Jun 12, 2012 7:35 PMHi Dietmar,
Thanks for your reply.
There's no jasperreports-fonts-3.7.4.jar file in the webapps/JasperReportsIntegration/WEB-INF/lib folder. The only font file available is jasperreports-fonts-4.5.0.jar. I've downloaded the 3.7.40 jar file and saved it in the same folder without deleting the 4.5.0.jar. I tried to run the Test application again and still give me the same error.
Jun 13, 2012 3:58:26 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [ReportWrapper] in context with path [JasperReportsIntegration] threw exception [Servlet execution threw an exception] with root cause
Throwable occurred: java.lang.NoClassDefFoundError: net.sf.jasperreports.engine.util.JRStyledTextParser (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:87)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:142)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:52)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
at de.oc.integration.jasper.webapp.ReportWrapper.service(ReportWrapper.java:318)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
I also tried the suggestion from the link provided by Nick. However, the syntax is for SUN environment and we are using IBM so I searched the equivalent of that command in IBM. Our DBA added the Java system property in the startup script by adding these 2 lines. But it errored out on the first 2 lines. I'm not sure if I do have the right syntax.
java.version=1.4
java.awt.headless=true
----- Error
27) ./startup.sh
./startup.sh[25]: java.version=1.4: not found
./startup.sh[26]: java.awt.headless=true: not found
Using CATALINA_BASE: /dbfupg/apache-tomcat-7.0.26
Using CATALINA_HOME: /dbfupg/apache-tomcat-7.0.26
Using CATALINA_TMPDIR: /dbfupg/apache-tomcat-7.0.26/temp
Using JRE_HOME: /usr/java6/jre
Using CLASSPATH: /dbfupg/apache-tomcat-7.0.26/bin/bootstrap.jar:/dbfupg/apache-tomcat-7.0.26/bin/tomcat-juli.jar
----- Start up script
27) cat startup.sh
#!/bin/sh
java.version=1.4
java.awt.headless=true
os400=false
case "`uname`" in
OS400*) os400=true;;
esac
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
EXECUTABLE=catalina.sh
# Check that target executable exists
if $os400; then
# -x will Only work on the os400 if the files are:
# 1. owned by the user
# 2. owned by the PRIMARY group of the user
# this will not work if the user belongs in secondary groups
eval
else
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "The file is absent or does not have execute permission"
echo "This file is needed to run this program"
exit 1
fi
fi
exec "$PRGDIR"/"$EXECUTABLE" start "$@"
BTW, Thanks for the update on the new version.
Thanks!
Edited by: bratz69 on Jun 13, 2012 4:48 PM -
I am in the process of making a new template for my site.
I can't really provide any code and here's why, I need help finding the code that I need to change. The new template is actually being designed here.
If you scroll over the home link you will find a sub-menu pops up, if you scroll over the menu items they get bigger and come 'at" you, if you hover over sub-2 and then hover over sub-3 you will notice there is a wild transition effect, I need to know how to get rid of those, it is a different CSS code from another template link to my site. I can't find out how, if somebody could please help me out it would be wonderful. Thank you a whole bunch in advance.Your menu moves for a couple of reasons first, you have a border in the hover, which is going to move all of the text. You can get rid of the border in the hover or add a border of the same size/style in the active.
The second reason it appears you have some paddng in the hover that moves the text.
Find those and you can solve the issue.
Gary -
Need help... getting an error message "not enough storage" for icloud and it will not let me get passed the message
See if this helps.
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. -
Need help about : ORA-14450 error
ORA-14450: attempt to access a transactional temp table already in use
Cause: An attempt was made to access a transactional temporary table that has been already populated by a concurrent transaction of the same session.
what can i do to solve this error
need help immediatelySounds like you have a transaction-specific global temporary table (ON COMMIT DELETE ROWS) and that mulitple transactions try to use it at the same time.
You could make the table session-specific (ON COMMIT PRESERVE ROWS).
BUT, there may be a reason why it was created this way and you therefore have a problem somewhere in the program logic. -
i'm new in a jave and i need to write some programs
1) write a program that allows the user to enter a range of number. for that range of number, list the numbers and state their properties:
prime or not rrime; deficient, perfect, or abundant; smith number or not.
2) write a program that finds the largest Smith number possible that can be held in Java integerBigDaddyLoveHandles wrote:
Psyber wrote:
Here's the algorithm for perfect numbers:
boolean p_num(int number) {
int sum = 1;
for (int n = 2; n <= number / 2; n++)
if (number % n == 0)
sum += n;
return sum == number ? true : false;
}Now hand over the dukes.Why not:
return sum == number;
Whaddya expect for 10 dukes? -
I need help getting some photos off a really old ipod
Ok so here it is.... My grandparents way back when gave me an ipod video, I just recently found it and realized it has photo's on it that I would like to keep. My problems are 1. I don't have the original computer I used for it 2. when I plug it in my computer thinks it's a hard drive 3. autoplay won't give me the option to import the photo's to my computer and 4. itunes doesn't seem to have an option to transfer photo's from ipods to your pictures folder.... if any one could help I'd appriciate it.
The photos you synced to your iPod through iTunes are no longer in their full resolution, but instead are scaled down thumbnails of those photos. So if you do manage to get them off your iPod, they will be quite small in size compared to the original ones you lost.
In order to get them off of your iPod, you'll need the help of some sort of 3rd party software. Here is one option. You can Google for more.
http://www.macroplant.com/podtopc/
B-rock -
Need help with some JS installing Bumpbox 2.0
I am trying to add a lightbox effect to a pdf on my website, I found a Javascript plugin at http://www.artviper.net/bumpbox-demo/index.html that looks like it should do the trick, but I am having trouble getting it to work.
To narrow down the problem I created a test.html file that I stuck in the root directory of the folder I downloaded from their site (so I am working locally off my desktop at this point)
My code is as follows... I feel like I am missing something super obvious, does anyone see it? (do I need to define the .bump class in the css file?)
Thank you in advance for the much needed help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<a href="http://www.artviper.net/test.pdf" class="bump" rel="800-350">PDF File »</a><br />
<script type="text/javascript" src="js/mootools.js"></script>
<script type="text/javascript" src="js/bumpbox-2.0.1.js"></script>
<script type="text/javascript"> doBump( '.bump',750, 500, '111', '900', '0.8', 5, 1 ,'333', 15,'000', 4,
Fx.Transitions.Bounce.EaseOut,
Fx.Transitions.Bounce.EaseOut,
'images/demo_bg_bumpbox.png',
'top left',
'repeat-x' ); </script>
</body>
</html>These paths won't work because they point to files on your local hard drive.
<script type="text/javascript" src="file:///Macintosh HD/Users/Robert/Downloads/bumpbox Folder copy/js/mootools.js"></script>
<script type="text/javascript" src="file:///Macintosh HD/Users/Robert/Downloads/bumpbox Folder copy/js/bumpbox-2.0.1.js"></script>
Are you working within a properly defined local site?
Did you save those javascript files to the js folder in your local site root?
Correct path to scripts for this test page should look like this:
<script type="text/javascript" src="../js/mootools.js"></script>
<script type="text/javascript" src="../js/bumpbox-2.0.1.js"></script>
PS. Do not add spaces to folder or file names. It can create problems for web files.
Nancy O. -
Need help with some Coldfusion data structures
Hello,
I need to keep some sort of a list that contains a page, and then that page will have associated with it values. So,
if I have page 1, I may have values 240, 245, 300. Then, on to page 2, and I will have say, 344, 29, etc.
So, what I will have is something that "could maybe" be a 2 dimensional array where one of the elements is a list?
Or, do I set up a struct say, page.number and page.value list, and put that struct in an array?
Plus, the fun part is I have to save this bad boy in session. I've been looking around the web for some examples, no
luck. So, to reiterate:
I have a page number that has to be associated with a list. That entire structure needs to be in an array or list of
some sort, and stored in session.
Thanks in advance!Really Google did not show anything like:
<cfset session.pageAry = [
{page="pageOne", numList="240,245,300"},
{page="pageTwo", numList="344,29"}]>
<cfdump var="#session.pageAry#">
OR
<cfset session.pageAry = arrayNew(1)>
<cfset arrayAppend(session.pageAry, strutNew())>
<cfset session.pageAry[1].page = "pageOne">
<cfset session.pageAry[1].numList = "240,245,300">
<cfset arrayAppend(session.pageAry, strutNew())>
<cfset session.pageAry[2].page = "pageTwo">
<cfset session.pageAry[2].numList = "344,29">
OR
The <cfscript> version of these examples. -
I need help setting up my Imessage and FaceTime.I have tryed and its not working.
iOS: Using FaceTime
iOS: About Messages
iOS: Troubleshooting FaceTime and iMessage activation
iOS: Troubleshooting Messages
iOS: Troubleshooting FaceTime -
Need Help by some % calculation
Hi Guys,
i need some help calculating something.
I have 5 boxes; "boxA" - "boxB" - "boxC" - "boxD" and "boxE". Box A–C are sums coming from other fields.
"boxD" represent the VTA – and can be just 19% ore 0%.
This means that "boxE" = ("boxA" + "boxB" + "boxC") * "boxD" ("box D" is equal with 0,19 – if the customer types 19% in the field – ore "0" (zero) – by leaving the "boxD" empty or typing the value "0" inside. A multiplication with 0 would be false, so it had to be ignored if the content of the "boxD" is 0)
I suppose it will be something with "if" and "else" but how i say, I'm a greenhorn in this domain.
Actually i found something that could help but i thing some parts – the definition of var v4, if v4 get the value 19% ore 0% – are missing.
(function() {
// Get the field values, as numbers
var v1 = +getField("boxA").value;
var v2 = +getField("boxB").value;
var v3 = +getField("boxC").value;
var v4 = +getField("boxD").value;
// I suppose here comes some "if" "else" stuff for the definitoon of var4
// Perform the calculation; the result is the content of the "boxE"
var result = v4 * (v1 + v2 + v3);
// Set the value of this field to the result
event.value = result;I would make sure you are not having a problem with using the "," as the decimal separator.
What problem are you having?
Is there an error in the JavaScript console?
If so, what is the exact wording?
Have you examined the values within the script to make sure you are getting the value you are expecting?
Maybe you are looking for
-
Portal runtime error while creating users in portal content administrator
I am getting this error while creating new users in portal. Portal Runtime Error An exception occurred while processing a request for : iView : pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.user_administration/com.sap.p
-
Creative Alchemy and Dawn of War 2
Hi i have just got Dawn of War 2 and have sound problems with the game. When i play the game the sound stuterrs etc. read somewhere on the net that the problem was to do with alchemy but my alchemy does not list dawn of war 2 as a possible game. I ga
-
How to see the table entries after creating the tansaction XD01
I creat customer initial screen through Transaction XD01. After creating customer initial screen how can i see the yable entries.
-
How to transport the sap script
Hi gurus, I am new to the SAP scripts. I finished the development of my form by usiing SAP Scripts. How can I transport it? Any help is appreciated! Thx in advance! Kun Bao
-
SCHEDULING & MONITORING PROGRAMS (TO PROCESS 100 TO 5000 FILES A DAY)
We have the end to end set of programs for scheduling & monitoring any ETL programs. In big enterprises , the system to system data access always happens through ascii files. if there are systems which needs to recieve/load files & produce handoff fi