Home Answers Viewqa Java-Beginners function method

 
 


partha karmakar
function method
1 Answer(s)      9 months ago
Posted in : Java Beginners

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

View Answers

July 28, 2012 at 4:53 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 Pages:
function method
function method  input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936
function method
function method  input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936
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
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
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">
method name
method name  Is there any method which is equivalent to c++'s delay(int) function
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
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
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
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
The $_POST Function
built-in $_REQUEST function. $_REQUEST Method is used to collect form data...The $_POST Function The $_POST function in PHP is used to gather data of form submit with method="post". When you send data using POST method
The $_Request Function
The $_Request Function The contents of both $_GET, $_POST, and $_COOKIE are contained by the PHP built-in $_REQUEST function. $_REQUEST Method is used... Transitional//EN"> <HTML> <HEAD> <TITLE>Request Method
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
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
onmouseover function in maparea
onmouseover function in maparea  Hello, I have a website... of the maparea in a onmouseover function showing a image. I have tried many things like the this.src method but it seems not to work. Current code <
function
function  difference between function overloading and operator overloading
Aggregrate function Max() in db
Aggregrate function Max() in db  Hi everyone i have a question and stuck with this problem. i have a table like Brand in mySql db where brandid(varchar) is generating automatically.. im having a Db connection class and a method
Load function ***PLEASE HELP
Load function ***PLEASE HELP   Hi I am writing a program that tracks... function that loads a file. The save function prompts the user to enter... a load function that prompts the user for the file name to be loaded
JPA Count Function
JPA Count Function       In this section, you will learn about the count function of JPA aggregate function. JPA Count function counts all records to database table. JPA Count
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
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
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
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
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
Java arraylist index() Function
Java arrayList has index for each added element. This index starts from 0. arrayList values can be retrieved by the get(index) method. Example of Java Arraylist Index() Function import
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
what is the correct format of charAt() function?
what is the correct format of charAt() function?  class prog... errors are coming: **p3.java:8:cannot find symbol symbol:method charAt(int) location...()function is correct in the code
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
PHP invoke Method
Method Example: <?php class A { public function __invoke($var){ var...__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
JPA Locate Function
() function. This method returns the index of search string in specified string. String... JPA Locate Function     ...;. JPA locate Function: Query query= em.createQuery("SELECT
JPA Sum Function
JPA Sum Function       In this section, you will learn about sum function of aggregate function of JPQL (Java Persistence Query Language). The sum function to calculate the sum
JPA Upper Function
JPA Upper Function       In this section, you will learn about the JPA Upper() function. This function returns upper-case of the specified string arguments. JPA Upper
JPA Mod Function
JPA Mod Function       In this section, you will learn about the jpa mod function. This function returns the modulo of number and divisor.  For JPA mod
JPA Substring() Function
JPA Substring() Function   ...() function. The substring() function returns the some part of string arguments...() Function: Query query=em.createQuery( "UPDATE Student st
JPA Trim() Function
JPA Trim() Function       In this section, you will learn about the JPQL trim() function. This function will trimmed the space character from your given string. JPA
JPA Lower() Function
JPA Lower() Function       In this section, you will learn about the jpa lower function. The Lower() function returns the lower-case of given string.  JPA Lower
JPA Length Function
JPA Length Function     ...() function. This function returns a number of characters in the specified string argument.. JPA Length Function: Query query=em.createQuery("SELECT
getch() method in java
getch() method in java  does someone know how can i obtain the getch() function in java
PHP toString Function
__toString method in PHP: In the previous versions of PHP it is not possible to convert an object to a string value, but with the invent of _toString method now it is just a function call away. This method is called implictly, whenever
JPA Max Function
JPA Max Function       In this section, you will learn how to develop a jpa max function. JPA max function retrieves data from the database table field which
JPA Min Function
JPA Min Function       In this section, you will learn about the min function of JPA aggregate function. It find the minimum value of given field. It return a single
main function defnition in class - Java Beginners
main function defnition in class  why do we use public infront of a main function   Hi friend, The main method is similar to the main function in C and C++; it's the entry point for your application
getch() method in java
getch() method in java  does someone know how can i obtain the getch() function in java?   Hi Friend, In java, you can use the method next() of Scanner class. Here is an example: import java.util.*; class Hello
PHP Polymorphism Function
PHP Polymorphism Function: The PHP Polymorphism Method is one of the feature... Run time Compile time polymorphism PHP is like function overloading, operator overloading etc. In Polymorphism function overloading we can create more than
method overloading - Java Beginners
method overloading   Write a program to demonstrate the method overloading for sum ( ) function.  class overloadingDemo { public void... is referred to as Method Overloading. In the given example, we have defined
JPA Concat Function
JPA Concat Function     ... Persistence Query Language) concat() function. The concat() function concatenates two string fields or literals.  JPQL concat() Function: Query query
PHP function uploaded_file() and example
Syntax for PHP uploaded_file() Function bool move_uploaded_file (file_name... only to the files uploaded by HTTP POST PHP uploaded_file() Function with Example Code for PHP uploaded_file() Function <html> <body>
boolean method - Java Beginners
is to promt user to select whether the notebook have bluetooth function or not? I don't know how to throw in the boolean method in my main class. Notebook...; } Below is main class method: String itemNo = JOptionPane.showInputDialog
Calling Flex Function From JavaScript
; } .style4 { border-style: solid; border-width: 1px; } Calling Flex Function From JavaScript Sometimes, you may need to call flex function from JavaScript... function using addCallback() function  of ExternalInterface to make the flex

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.