java input problem



Share on Google+Share on Google+

java input problem
1 Answer(s)      9 years ago
Posted in : Java Beginners

I am facing a Java input problem

View Answers

June 30, 2012 at 12:41 PM


You are required to write an application called Customer Billing System. This system will calculate water usage charges for a month that has been imposed by Syarikat Air Melaka Berhad. This system will categorise users into residential users and industrial users and calculate the charges based on data entered by the user. Data needed are the type of customer (Residential or Industrial), past meter reading and current meter reading.

Given the charge rate as follows:

For Residential: 0 ? 15 m3 : RM 0.82 every m3 15.1 ? 40 m3 : RM 0.65 every m3 40.1 m3 and above : RM 0.42 every m3 Minimum charge is RM 5.00

For Industrial: 0 m3 and above : RM 1.47 every m3 Minimum charge is RM15.00

Instruction: The above application must be able to hold information for up to 5 customers. Use an array and repetition structure to store information about users such as type of customer, past meter reading, current meter reading and charges. Write a structured Java program to develop the above system by following the steps below:

a) Prompt the user to input the type of customer, past meter reading and current meter reading. Next, get the difference between current meter reading and past meter reading. b) Separate them as either R/r for Residential or I/i for Industrial. You can use any one of the two selection structures. c) Calculate the charges based on rates given above. If there is no water consumption, the minimum charge will be imposed. You can use any one of the two selection structures. d) Display information about the type of customer, past meter reading, current meter reading and charges for each customer. Print the information in table format.


Related Tutorials/Questions & Answers:
java input problem - Java Beginners
java input problem  I am facing a Java input problem
Java Command Line Input
Java Command Line Input  How to get input from command line in java... System.out.println("Please Input A Number"); BufferedReader br... this code you will find the output as Please Input A Number 2 data is- 2
different type input in java
type of input method. thank   Java Read through DataInputStream: import...); } }   Java read input through Scanner: import java.util.*; class...); } }   Java read input through BufferedReader import*; public class
Java User Input
Java User Input  I am using Scanner class for user Input. Scanner s = new Scanner(; String name =; but i am unable to store full name in name i can store full name plsss reply   use
input output in java
input output in java  java program using filereader and filewriter   Hi Friend, Try the following code: import*; class FileInputStreamAndFileOutputStream { public static void main(String[] args) throws
input - Java Beginners
me soon.  Hi Friend, There are lot of ways to input data.You can use... to input the data from the command prompt. Try the following code to input name...:"); Scanner input=new Scanner(; String name=input.nextLine
java user input - Java Beginners
java user input  how to input from keyboard? please give a example.  Hi Friend, There are lot of ways to input data from keyboard.You...:****** try{ System.out.print("Enter String:"); BufferedReader input = new
input  a java program that will exchange the last names of two students that were input by a user
Input / Output in Easiest Method in Java
Input / Output in Easiest Method in Java  How to input from keyboard... with the easiest method in Java?   Hi Friend, Try the following code: import...)throws Exception{ Scanner input=new Scanner(
user input in java - Java Beginners
user input in java   i am trying to write a code to compute the average of 5 numbers but i dont know what to do for the program to accept user input  Hi import java.util.*; public class AverageExample { public
JAVA Problem
JAVA Problem  Write a program that takes two parameters 1. a word... in the array. For Example: INPUT word="ravi" word_array = ["Chethan Bhagat...) { Scanner input=new Scanner(; System.out.print("Enter word
Input and Output problems - Java Beginners
Input and Output problems  1) what is Difference between... to a particular platform. Thus, this class reads characters from a byte input stream.... This link will help you.
java Problem
java Problem  I want to create a binary tree for displaying members in Downline. i am creating a site for MLM(Multi-Level MArketing). tree must be dynamically populated from database. is there any help for me. Thanks in advance
Java Problem - Java Beginners
Java Problem  Write a program 2 input a positive integer n and check... series i.e. 2 3 5 7 11 13 17....... For eg. ---> if input is 11..., Code to solve the problem : import*; public class PrimeNumber
code problem - Java Beginners
java script j2ee j2me sql plz help me to sort out this problem. thnx  ...code problem  Dear sir, I'm havin a problem that suppose i've got a file that contains the following lines- java java script j2ee php sql
Java get User Input
Java get User Input       In this section, you will learn how to get the user input from the command prompt. We are providing you a java application
Validation on input xml in java program - XML
Validation on input xml in java program  Hi.. i am accepting xml data as input which I have to use in my program. i have to validate this input xml against some schema using xml beans and NOT by using sax or dom parser. I am
Java Input/Output Examples
Java Input/Output Examples In this tutorial you will learn about how the Inputs and outputs are managed in java. To understand the Java Input & Output there is a package in java named which provides the classes
resolution problem in java
resolution problem in java  I designed project in java in my PC when run the same project in some other PC i can't fully view my java forms.Some said that it is resolution problem
problem 1 - Java Beginners
problem 1   Hi, please help me!!!! How can i code in java using.... this is my input data file: 88 90 94 102 111 122 134 75 77 80 86 94 103 113 80.... Method to input data from the data file Method to display the table
JAVA Problem - Java Beginners
JAVA Problem  please help me!!!! How can i code in java using Two... 109 120 Method to input data from the data file Method to display.... can create methods for the input, for the output, for the average
code problem - Java Beginners
; Hi friend, Code to help in solving the problem : import (br.readLine()); count++; } //Close the input stream in.close... in Java visit to : Thanks
java problem - Java Beginners
java problem  Write a program to model a simple calculator. Each data... operation. doNextOp has three input parameters (the operator, the left operand... to power of right operand) q quit Your calculator should display the accumulator
java programming problem - JDBC
java programming problem  Hi, Request you to provide the source code in Java for the following programming problem : upload .csv file data into oracle database. please send the solution to [email protected]
How to get the unicode of japanese character input in java
How to get the unicode of japanese character input in java  Good Evening sir/madam; I am trying to create an application in java which needs to show the japanese character on frame and need to get the japanese string from
java problem - Java Beginners
java problem  Write a program that could be used to help children... an answer for each. After user has input each answer, the program then display... of such a program. The user input is shown in boldface. How many problems would you like? 3
java problem - Java Beginners
java problem  a) Binary numbers is important in computers. Binary... available in Java that will allow us to convert from denary integer (base 10... (bits) ; } } public static void main(String args[]){ Scanner input=new
Problem in uploading java application
Problem in uploading java application  I have uploaded my java application (folder created under webapps) using Filezilla FtpClient.Application... this problem
code problem - Java Beginners
code problem  Dear sir, my problem is given below: suppose a file...; Hi friend, Code to help in solving the problem : import InputStreamReader input = new InputStreamReader(; BufferedReader reader
Java problem - Java Beginners
Java problem  what are threads in java. what are there usage. a simple thread program in java  Hi Friend, Please visit the following link: Thanks
Bid Problem - Java Beginners
Bid Problem  Write a 'for' loop to input the current meter reading... in this application explain in details : Code to help in solving the problem...!"); } } } For more information on Java visit to : http


Advertisement null