Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

VISUAL BASIC WINDOWS FORMS APP (.NET FRAMEWORK) Power Rate Estimator (Using Strings, IF, Logical and Comparison Operators) Description Your company has been hired to create

VISUAL BASIC WINDOWS FORMS APP (.NET FRAMEWORK)

Power Rate Estimator

(Using Strings, IF, Logical and Comparison Operators)

Description

Your company has been hired to create a Power Rate Estimator calculator for a local power company. An analyst has documented the requirements for the application and a designer has come up with a basic design.

You are assigned to the project and need to create the application using the following program flow.

A user will run the application and enter the following information

The Rate Season they would like the estimate for

The user will select the Solar Rate if they have solar panels on their house. If the use has solar panels, they will receive a 20% discount off of their bill.

Average monthly power they use

Validate the user data

To avoid errors in the calculations, you need to validate the user data.

If there are no errors, you will perform the calculations.

If there are errors, you will inform the user and not perform the calculations.

Display the amount of the estimated monthly bill

General Information

Base Rates

Rules

Use constants for the different rates

Rates

Summer: 0.15 per kilowatt

Fall: 0.13 per kilowatt

Spring: 0.10 per kilowatt

Rate Steps

Rules

Must use a nested IF structure - See instructions in Billing Calculations section below

Use constants for the kilowatt levels, and kilowatt increase rates

Rate Levels

If kilowatts are less than 20, there is no rate increase

If kilowatts are between 20 and 39, inclusive, rate increases by 0.03 per kilowatt

If kilowatts are between 40 and 59, inclusive, rate increases by 0.05 per kilowatt

If kilowatts are 60 or greater, rate increases by 0.08 per kilowattInstructions

What to do

1. At the top of your application, add the following code:

Option Strict On

Option Explicit On

'

'Programmer:

'

2. Create a new Project/Solution

a. Project name: EnergyRateCalculatorProject

b. Solution name: EnergyRateCalculatorSolution

3. Create the Main Form a. Design

i. See wireframe model b. Settings

i. File name: MainForm.VB

ii. Name: MainForm

iii. Accept Button: Calculate

iv. Start Position: Center Screen c. Buttons

i. Calculate

1. Set Alt Key to: C

2. Run validation - See Validate the Data section below

3. When clicked, calculate the final bill ii. Reset

1. Set Alt Key to: R

2. When clicked, clears the data fields a. Rate Season: Empty

b. Solar Rate: Unchecked

c. Avg. Monthly Power: Empty

3. Set the focus to the Rate Season textbox iii. Exit

1. Set Alt Key to: X

2. When clicked, closes the application

d. Fields

i. Rate Season - Textbox

1. Settings

a. Set Max Length = 2

b. Use the Keypress Event to only allow letters to be entered in the textbox ii. Solar Power - Checkbox

1. Default value: Unchecked

iii. Avg. Monthly Power - Textbox

1. Allow decimal numbers

2. Use the Keypress Event to only allow numbers to be entered into the textbox.

4. Validate the Data

a. Rate Season Field

i. Convert the user input to uppercase ii. Valid Values

1. SP=Spring

2. SU=Summer

3. FA=Falliii. If Rate Season does not contain a valid value

1. Show a MessageBox with the following error message

Invalid Rate Season value, please enter: SP, SU or FA

2. Set the focus to the Rate Season textbox

3. Clear the textbox contents

4. Do not perform the billing amount calculations b. Avg. Monthly Power

i. Amount must be greater than zero

ii. If the amount is not greater than zero, show a MessageBox with the following error message

The Average Monthly Power must be greater than zero.

iii. Set the focus to the Avg. Monthly Power textbox iv. Clear the textbox contents

v. Do not perform the billing amount calculations

5. Billing Calculations

a. Only perform these calculations if there were no validation errors b. Decide which rate to use based on the Rate Season field

i. Summer: 0.15 per kilowatt ii. Fall: 0.13 per kilowatt

iii. Spring: 0.10 per kilowatt

c. Calculate rate adjustments based off the following rules

These rules refer to the Avg. Monthly Power data entered by the user i. Must use nested IF statements

ii. If kilowatts are less than 20, there is no rate increase

iii. If kilowatts are between 20 and 39, inclusive, rate increases by 0.03 per kilowatt iv. If kilowatts are between 40 and 59, inclusive, rate increases by 0.05 per kilowatt v. If kilowatts are 60 or greater, rate increases by 0.08 per kilowatt

d. Solar Power Checkbox

If checked, a 20% discount will be subtracted from the subtotal to calculate the final bill amount i. Calculate the billing subtotal amount

ii. Subtract 20% from the subtotal. This is the final bill amount.

6. Use a MessageBox to display the estimated monthly billing amount following this example: Your estimated monthly bill is: $123.45

7. Compile and test your application. If there are errors, fix them before submitting your work.Wireframe

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Discuss the five types of learner outcomes.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago