Question about Computers & Internet

1 Answer

Electricity bill coding in java

Please tell me the coding for calculating the electricity bill in java

Posted by on

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Corporal:

    An expert that hasĀ over 10 points.

    Mayor:

    An expert whose answer gotĀ voted for 2 times.

    Problem Solver:

    An expert who has answered 5 questions.

  • Contributor
  • 19 Answers

First think how you would solve this problem yourself on a piece of paper. Then try programming it using the things you learned (if they've given you this assignment without teaching you to multiply, subtract and use if's, drop the course).
Well here is an idea.

Take the total kilowattage and send it to a function. What the function will do is subtract 14KW from the total Kilowattage and add the amount for the first 14KW then subtract 85KW from the total KW and add the amount for the 85KW. But once you subtract the number of KW from the total make sure to check if the total KW isn't negative, if so just break out of the function and return the total due.

Or if you have formula for how much the rate grows over how many miles.

For example lets say the rate grows by $1 every time the KW doubles you could have something like

int rate = 1; //Begining rate
int KW = 14; //First flat rate
int amount; //total amount they have to pay
while(totalKW > 0)
{
totalKW -= KW; //subtract the first rate
if(totalKW <= 0) //check if too much subtracted
break; //if so break
amount += rate; //add the rate to the total

rate += 1; // Add $1 to the rate every time
KW *= 2; // KW is doubled
}

Posted on Jan 09, 2009

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Wanted to do a good project on java.suggest d


if u have hardware knowledge,then u can interface a 4x4 matrix keypad with printer port and make a calculator!!
i have done this project, if u need hardware assistance tell me

Jul 14, 2010 | Sun Java Programming Language (cdj-275)

1 Answer

How to program calculator in java


Hello,
If the question is : how to make a programmable calculator run a program written in Java, the amswer is : you cannot. Maybe the newer ones.

But if you are looking for the source code of a Java applet that simulates a calculator, then maybe you should launch a Google search with keywords Java calculator and see what you get. I do not want to spoil your fun by supplying a link to what my search returned.
Hope it helps.

Oct 09, 2009 | Canon Office Equipment & Supplies

1 Answer

F700v java activation code?


you cannot do that use the java download option beawre you may need to pay for the games

Aug 17, 2009 | Samsung SGH-E900 Cellular Phone

1 Answer

Calculator in java


<FORM NAME="CALCULATOR">
<TABLE BORDER=4>
<TR>
<TD>
<INPUT TYPE="text" NAME="Input" Size="16">
<br>
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="button" NAME="one" VALUE=" 1 " OnClick="Calc.Input.value += '1'">
<INPUT TYPE="button" NAME="two" VALUE=" 2 " OnCLick="Calc.Input.value += '2'">
<INPUT TYPE="button" NAME="three" VALUE=" 3 " OnClick="Calc.Input.value += '3'">
<INPUT TYPE="button" NAME="plus" VALUE=" + " OnClick="Calc.Input.value += ' + '">
<br>
<INPUT TYPE="button" NAME="four" VALUE=" 4 " OnClick="Calc.Input.value += '4'">
<INPUT TYPE="button" NAME="five" VALUE=" 5 " OnCLick="Calc.Input.value += '5'">
<INPUT TYPE="button" NAME="six" VALUE=" 6 " OnClick="Calc.Input.value += '6'">
<INPUT TYPE="button" NAME="minus" VALUE=" - " OnClick="Calc.Input.value += ' - '">
<br>
<INPUT TYPE="button" NAME="seven" VALUE=" 7 " OnClick="Calc.Input.value += '7'">
<INPUT TYPE="button" NAME="eight" VALUE=" 8 " OnCLick="Calc.Input.value += '8'">
<INPUT TYPE="button" NAME="nine" VALUE=" 9 " OnClick="Calc.Input.value += '9'">
<INPUT TYPE="button" NAME="times" VALUE=" x " OnClick="Calc.Input.value += ' * '">
<br>
<INPUT TYPE="button" NAME="clear" VALUE=" c " OnClick="Calc.Input.value = ''">
<INPUT TYPE="button" NAME="zero" VALUE=" 0 " OnClick="Calc.Input.value += '0'">
<INPUT TYPE="button" NAME="DoIt" VALUE=" = " OnClick="Calc.Input.value = eval(Calc.Input.value)">
<INPUT TYPE="button" NAME="div" VALUE=" / " OnClick="Calc.Input.value += ' / '">
<br>
</TD>
</TR>
</TABLE>
</FORM>

eNJOY


Jul 01, 2009 | Aquabot Robotic Pool Cleaner

1 Answer

Code for method parseInt() in java


parseInt(java.lang.String, int)

This code takes two arguments, a string constructor from the Java language and an integer. Its purpose is to parse (meaning de-construct or disassemble into component parts) one data type into another.

Here is an example of a Java program to specify and print out the dimensions of a rectangle, taken from the page http://www.roseindia.net/java/beginners/entervaluesfromkeyboard.shtml:

class Rectangle{
int length, breadth;
void show(int x, int y){
length = x;
breadth = y;
}
int calculate(){
return(length * breadth);
}
}
public class EnterValuesFromKeyboard{
public static void main(String[] args) {
Rectangle rectangle = new Rectangle();
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
rectangle.show(a, b);
System.out.println(" you have entered these values : " + a + " and " + b);
int area = rectangle.calculate();
System.out.println(" area of a rectange is : " + area);
}
}

Apr 09, 2009 | Sun Java Programming Language (cdj-275)

1 Answer

Calculate a bill


Hi you can Apply below mention formula
=ABS(SUM(COUNTIF(RANGE,"CATAGARI")-(COUNTIF(RANGE,"CATAGARI")))

RANGE = FROM WHICH CELL TO YOU WANT TO APPLY THIS FORMULA TO TILL WHICH CELL.
CATAGARI = WHAT DO U WANT < FOR FOR FIRST > FOR SECOND

May 22, 2008 | Excel (SS8SATAS5128400R)

4 Answers

Java source code for supermarket billing system


sir im student i want billing and database tables for online sales and inventory for departmental stores kindly provide me er diag n class diagrams also as soon as possible

Feb 25, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

2,359 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

100311 Answers

David Payne
David Payne

Level 3 Expert

14160 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...