Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners plz help me out with this problem...please write the program for me.thanxxxxx
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


patel priyank
plz help me out with this problem...please write the program for me.thanxxxxx
1 Answer(s)      3 years and 11 months ago
Posted in : Java Beginners


Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information will be entered by the user: - Account number (12 digit code) - Address - Kilowatts used for the month for evening useage - Kilowatts used for the month for daytime useage - Kilowatts used for the month for nighttime useage - Kilowatts used for the month for morning useage Layout specifications - Overall width of bill is 80 characters Time of Use Rates - Morning rates, $0.08 kWh - Daytime rates, $0.099 kWh - Evening rates, $0.08 kWh - Nighttime rates, $0.053 kWh Formulas ? Total Cost = Kilowatts x Time of Use Rate ? Taxes = Total Cost x 15% ? Total Payable = Total Cost + Taxes


Advertisement
View Answers

November 15, 2010 at 3:22 PM


Hi Friend,

Try the following code:

import java.util.*;
import java.text.*;
public class HydroBill{
    public static void main(String[]args){
        DecimalFormat df = new DecimalFormat("$###,###.## ");
        Scanner input=new Scanner(System.in);
        System.out.print("Enter Account Number: ");
        long accno=input.nextLong();
        System.out.print("Enter Address: ");
        String address=input.next();
        System.out.print("Kilowatts used for the month for morning usage: ");
        double mkw=input.nextDouble();
        System.out.print("Kilowatts used for the month for daytime usage: ");
        double dkw=input.nextDouble();
        System.out.print("Kilowatts used for the month for evening usage: ");
        double ekw=input.nextDouble();
        System.out.print("Kilowatts used for the month for nighttime usage: ");
        double nkw=input.nextDouble();
        double totalMorningRate=mkw*0.08;
        double totalDayRate=mkw*0.099;
        double totalEveingRate=mkw*0.08;
        double totalNightRate=mkw*0.053;
        double total=totalMorningRate+totalDayRate+totalEveingRate+totalNightRate;

        double taxes=total*0.15;

        double totalPayable=total+taxes;
        System.out.println("Amount Payable is: "+df.format(totalPayable));
            }
}

Thanks



Related Tutorials/Questions & Answers:
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
Advertisements
really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i am confused here on what to write can some 1 help out here i dont quite understand how to code it so can some 1 help out. Part II Write, compile and execute
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
facing problem plz help me out - Framework
Facing problem plz help me out  hi i am new to servlet i deployed... the web.xml file too parallel to the classes folder now i am facing this problem.plz tell me what to do... error:The requested resource (Servlet servlet
plz help me to write a snake game using swings - Swing AWT
plz help me to write a snake game using swings  write snake game program using swings
Help me to write this simple java frame program
Help me to write this simple java frame program   I want to write a Java program for.... To create a frame with 4 text fields;name,street,city and pin;with suitable labels. Also add a button "OK". After enter values
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Help me quickly plz??
Help me quickly plz??  Can you help me to write code quickly this code is a java code take input as double and should use command line arguments and enhanced for statement then find the combine of the numbers plz help quickly
it is a linux program is there anyone who can help me out with it?
it is a linux program is there anyone who can help me out with it?  Write a Bash script that prompts the user for a user-ID and displays the corresponding user√Ę‚?¨‚?Ęs login name, owner√Ę‚?¨‚?Ęs name, and his/her home directory
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server is a standlone application that is made up the combination of two-application, server
plz help me for this question
plz help me for this question  Apply simplex procedure to solve the L.P.P. maximize z = 3x1 + 4x2 subject to 5x1 + 4x2 ‚?§ 200; 3x1 + 5x2 ‚?§ 150; 5x1 + 4x2 ‚?• 100; 8x1 + 4x2 ‚?≠‚?• 80, x1 ‚?• 0, x2 ‚?• 0
Plz Help Me
Plz Help Me  Write a program for traffic light tool to manage time...? Program must be written in Micro C.   Here is a code that displays traffic light on the frame. We have used java swing. It may help you. import
plz help me - Java Beginners
plz help me  Deepak I can write a sessioon code plz help me admin_home.jsp page is display but data is not disply plz help me what is wrong
help me out...!!!!
help me out...!!!!  i have to make a project on console based application in java.. so can anyone guide me with some gd ideas that can be implemented
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
Please help me out
Please help me out    Description* You are hired to develop a laptop inventory information system for Sheridan College in order to keep track of the information about the laptops lent to the students. Users can add or remove data
plz help me - Java Beginners
plz help me  Hi, I want to search all field from database using name, and display in text box, then data is update and delete. i want to search name using alphabets a-z, plz reply fast. plz help me this is very urgent
plz Help me - Java Beginners
plz Help me  Hi, I want learn struts,I dont have any idea about this plz help how can i make a framework.If u have any information then plz send my personal id plz tell me that whose software installed.and give me brief
plz help me - Java Beginners
plz help me  Thanks deepak continue response..i face some problem i... is true...but i very confuse that how it is not displayed admin page plz any one give me reponse my persinal given id  Hi ragni, i am sending
plz help me!!!!!!!! - JSP-Servlet
plz help me!!!!!!!!  i`ve set the environment varaibles for tomcat as well as jdk.. but i`m not understanding where i`ve to save my servlet..i.e.... there are compilation errors.. plz do help me.   make sure that you did
Advertisements
 

 

 

DMCA.com