JavaElectricBillLabReport

docx

School

San Jose City College *

*We aren’t endorsed by this school

Course

023

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by DrKnowledgeElephant25

Report
AVA ELECTRIC BILL LAB REPORT Name and Student ID: Date project completed: Platform (Mac, PC, Linux, etc.): Development system (onlineGDB, NetBeans, Eclipse): OBJECTIVES Analyze a project definition Convert the project description into code without a sample program Separate kilo Watt hours into tiers using if...else if...else statements Handle non-numeric inputs using try...throw...catch PROJECT DESCRIPTION Create a program that does the following: 1. Use CONSTANTS to define the kwh limits and billing rate for each tier 2. Read the number of kWh used by the customer 3. The Energy Tax of 0.20 is just added to the total bill, not used as a tax rate and multiplied by the total bill. 4. Compute the Electric Bill with a lower rate for the baseline kWh and a higher rate for kWh over the baseline 5. Display: a.The kWh used for each tier and the dollar and cents amount of the bill for each tier with two digits past the decimal b.The Energy Commission tax with two digits past the decimal c.The total bill that includes the amount for each tier and the Energy Commission with two digits past the decimal Use constants to define limits and billing for each tier Tier1 Tier2 Tier3 Tier limit 350 1450 Bill rate per kWh 0.23 0.29 0.45 INPUT – PROCESS – OUTPUT TABLE INPUT PROCESSING Your program must use constants instead of numeric values for kWh limits and billing rates for each tier. OUTPUTS kWh Input kWh from user as a double Determine Tier1_kWh(up to 350) Determine Tier2_kWh (up to 1450) Determine Tier3_kWh (over 1450) Tier1_Bill = Tier1_kWh * 0.23 Tier2_Bill = Tier1_kWh * 0.29 Tier3_Bill = Tier1_kWh * 0.45 Electric_Bill = Tier1_Bill + Tier2_Bill + Tier3_Bill + Commission_Tax Display Electric_Bill charges for each tier energy tax total bill Enter the kWh: 1500 Tier1 charges $80.50 Tier2 charges $319.00 Tier3 charges
TEST DATA TABLE Fill in the Test Data Values and Expected Results as shown on the lab assignment from Canvas. Fill in the Actual Results after you have run and tested your program TEST DATA VALUES kwh EXPECTED RESULT Computed values before the program is run ACTUAL RESULT Fill in the output displayed by the program 300 $69.00 69.20 500 $124.20 124.20 1500 $422.20 422.20 six hundred illegal fail Sample program execution kWh used Tier1 bill Tier2 bill Tier3 bill Energy Commission Tax TOTAL 300 69.00 0.00 0.00 0.20 69.20 500 80.50 43.50 0.00 0.20 124.20 1500 80.50 319.00 22.50 0.20 422.20 DISCUSSION What did you do to develop the program? ("Followed the Directions" is not a complete description) What problems did you have and how did you overcome the problems? SCREENSHOTS Paste four screenshots on the next page. Capture only the portion of the screen that shows the calculator or program output. Do not capture the entire screen even though it may also contain the program output. If I need to zoom in on a screenshot, sometimes the image resolution is so poor that I am not able to read it. If this happens, I will ask that you resubmit your lab report. Refer to these instructions capturing screenshots and pasting them to the lab report. For the Mac 1) hold down command + shift keys and press the 4 key to get a screenshot of a selected area of the screen 2) Use the mouse or touchpad to select the desired area of the screen you want to save 3) use command+V to paste into the lab report For Windows 1. use Microsoft's Snipping Tool by holding down the Windows and Shift keys and tapping the ‘S’ key 2. Use the mouse or keypad to select the part of the screen you want to save 3. use Ctrl+V to into the lab report
Paste four screenshots here Screenshot #1 – When kWh = 300 Screenshot #2 – When kWh = 500 Screenshot #3 – When kWh = 1500 Screenshot #4 – When letters are entered for kWh instead of numbers
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help