function method

function method

input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936

View Answers

July 28, 2012 at 4:52 PM

Here is a java code where we have created a function that matches your requirement.

import java.util.*;

class CreateMethod
{
    public static int getResult(int rs){
        double discount1=.10,discount2=.08;
        double d1=discount1*rs;
        double r1=rs-d1;
        double d2=discount2*r1;
        double r2=r1-d2;
        return (int)r2;
    }
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.print("Input Rs: ");
        int rs=input.nextInt();
        System.out.println(getResult(rs));

    }
}









Related Tutorials/Questions & Answers:
function method
function method  i. void display(String str.int p)with one string... is an example where we have created a function that accepts a string and an integer value and perform a upper case and lowercase method to the string. import
function method
function method  input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936
Advertisements
function method
function method  input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936
method and function difference
method and function difference  so far, I understand that method and function are the same thing... but is there any difference between the two terms? Please explain me if both are different terms. Thanks in advance
How i write a function/method in jsp?
How i write a function/method in jsp?  How write the function/method in jsp? Using that method i can retrieve the value coming from database. give me example plz. Actually i want to show the list of user detail
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?  How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js? I set
function
function  difference between function overloading and operator overloading
Flex Trace Method, Trace function in Flex
Function Trace function is used for debugging the application which prints... and terminate button stops the debugging session. Flex Trace Method Example... mx.controls.Alert; public function init():void{ trace("Init started
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
method
method  can you tell me how to write an abstract method called ucapan() for B2 class class A2{ void hello(){ system.out.println("hello from A2"); }} class B2 extends A2{ void hello(){ system.out.println("hello from B2
JavaScript method eval()
JavaScript method eval()       This section illustrates you the use of JavaScript method eval(). This function evaluates the string passed into the method and executes it. Its syntax
PHP invoke Method
__invoke() Function in PHP: PHP 5.3.0 has introduced so many new concepts, new functions. __invoke() is one of them. The functionality of __invoke() method... heard that we can call an object as function? I suppose no, but with the help
method name
method name  Is there any method which is equivalent to c++'s delay(int) function
Calling a function
Calling a function  Hi, I have a function xyz() in php code. When a button is clicked it should execute that particular function for that i have written as <form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
JPA Abs Function
JPA Abs Function       In this section, you will learn about the JPA Abs() function. This method returns absolute value of the given field. JPA Abs Function:ADS
JPA Sqrt Function
JPA Sqrt Function       In this section, you will learn about the JPA sqrt() function. This method returns the square root of the given argument. JPA sqrtFunction:ADS
JPA Avg Function
JPA Avg Function       In this section, you will learn the avg of aggregate function. This method calculate an average of  given data. JPA Avg() function:ADS
JPA Locate Function
() function. This method returns the index of search string in specified string. String... JPA Locate Function     ...;. JPA locate Function:ADS_TO_REPLACE_1 Query query= em.createQuery
isNaN function
isNaN function  What does isNaN function do
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
If function in PHP
If function in PHP  Hi, Provide me the example of If function in PHP. ThanksADS_TO_REPLACE_1   Hi, If function is PHP is used to check... of if() function in PHP:ADS_TO_REPLACE_2 $book="PHP"; if($book=="PHP"){ echo "Book
using function
using function   using a function to find the value of v from the foiiowing expression 1v=1u+1*f
getch() method in java
getch() method in java  does someone know how can i obtain the getch() function in java
Overload function in actionscript
Overload function in actionscript  Hi.... How do you overload...; public namespace method3; public function MethodOverloadingExample():void { method1::overloadedMethod(1); } method1 function overloadedMethod(a:int):void
method inside the method??
method inside the method??  can't we declare a method inside a method in java?? for eg: public class One { public static void main(String[] args) { One obj=new One(); One.add(); private static void add
disable function
disable function  Sir, I have called a java script function when one radio button is checked i want to disable this function when another radio button is checked ,both radio buttons are of same group Please help Thanks in advance
PHP Sleep Wakeup Method
__sleep or not. If so, then the function execute that method prior to any other...The __sleep and __wakeup Function in PHP The __sleep function in PHP is useful... the object completely, this method is useful for commit pending or for purging
jsp function - JSP-Servlet
jsp function  how to make function in jsp... i want example of jsp method or function in which on button click function get data fron database and print that data.. don't want javascripts..  Writing Method in JSP
get method
get method   how to use get method: secure method is post method and most of use post method why use a get method
unoin function
unoin function  how to define a union function in java?(ex:a=a U b) how to write tha java code?give ex.   Java Union Function You have learnt union, intersection etc in Sets. Here the given code finds the union of two
Method
Method       In this section, we will explore the concept of method in the reference of object oriented... and behaviors are defined by methods. Method : An brief introduction Methods
method question
method question  How do I figure out the difference in a method heading, a method body, and a method definition
Method Overloading
Method Overloading  In java can method be overloaded in different class
Method Overloading
Method Overloading  In java can method be overloaded in different class
A method getColumnCount.
A method getColumnCount.  There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set
using function
using function  write a program using function overloading to accept any sentence and print vowels and consonants sepratly   Here is an example that accepts a sentence from the user and display the vowels and consonants
Function pointer in c
Function pointer in c  What is the difference between function call with function pointer and without function pointer(normal function call
The strpos() function
The strpos() function The strpos() function is used to find the availability of a sub string/string inside a string. This function returns FALSE ,if the string or sub string provided is not found. The syntax of the above method
abstract method
abstract method  is final method is in abstract class
Main function.. - Java Beginners
Main function..  Hi Friend.. public static void main(String args...   Hi friend, public: The method can be accessed outside the class / package static: You need not have an instance of the class to access the method
Static method
Static method  what is a static method?   Have a look at the following link: Java Static Method
gc() method
gc() method  what is difference between java.lang.System class gc() method and java.lang.Runtime class gc() method
What is the use of friend function?
What is the use of friend function?  What is the use of friend function
call function in php
call function in php  What is the call function in PHP please explain
basic function of computer system
basic function of computer system  What is the basic function of computer system
Understanding public static void main function
function. The main method is the first method, which the Java Virtual Machine... Understanding public static void main function       The public static void main function is important
Append Function in Java
Append Function in Java  What is the use of append function in java? How to use the append function to append a string to a buffer string. Thanks... the string. This is very efficient method of appending string in Java. Once all
The $_GET Function
The $_GET Function The $_GET function in PHP is used to gather data of form submit with method="get". The data sent using get method is visible...; method is not secure. It also has limits on the amount of information to send

Ads