Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Problem 3: University Painters (65 points) Your friends run a painting business and have asked you to write a paint estimator for them. One

Programming Problem 3: University Painters (65 points)

Your friends run a painting business and have asked you to write a paint estimator for them. One gallon of paint is needed for every 100 square feet of wall space. It takes 5 hours to paint 100 square feet.. A gallon of paint is $12.50 and the company charges $25 an hour for labor.

Your deliverables:

Calculate by hand: If the project has 2810 square feet of wall space, calculate the following by hand and enter the answers here:

The number of gallons of paint required rounded UP to the nearest whole number.

The hours of labor required rounded up to the nearest whole number

The cost of paint formatted as currency to 2 decimal places, make sure you round up the number of gallons before calculating the paint cost.

The labor charges formatted as currency, remember to round up number of hours before calculating labor cost.

The total cost of the paint job, formatted as currency.

Create an application that allows the user to enter the square feet of wall space.The GUI:

Three buttons, calculate, clear and exit. Assign a keyboard access key to each of the buttons. (page 177).

Focus should be on the square feet text box.

Textboxes should be placed within a GroupBox,

Tab order should be square feet, calculate, clear, exit

The results should be displayed as labels.

The Accept Button should be the calculate button, the Cancel Button should be the clear button.

Add a nice background image to the form.

When the results are displayed on the form change the font color for the user input to red, the clear button method must change these colors back to the original (last section in chapter).

The program should calculate and display the following data in the form as labels:

The number of gallons of paint required rounded up to the nearest whole gallon use Math class see example below for the rounding up of labor hours.

The hours of labor required rounded up to the nearest whole number

use the Math class, Math.Ceil to round up, for example,

double sqFeet = 165; //square feet in project example only

double labor = (sqFeet / 100.0) * 5; //calculate hours of labor

labor = Math.Ceiling(labor); //ceiling round up

The cost of paint and labor:

all currency should be a decimal datatype and labor is cast as a decimal with (decimal) temporarily as in:

decimal laborCost = (decimal) labor * 25.00m; //calculate labor cose

remember to round up hours and gallons before calculating cost.

formatted as currency use ToString method,

laborCostOutputLabel.Text = laborCost.ToString("C"); //output

The total cost of the paint job, formatted as currency use ToString method.

Requirements in your code

Include a try/catch to validate user input

Currency should always be decimal data type think of it this way if a variable should have a $ in front of it when displaying, it should be a decimal datatype, all others should be double.

Format all numbers when output to GUI

Remember to fully comment your code

Follow all rules of good programming, including naming conventions and indenting

Paste all your code for Form1 here:

Paste a screenshot of your design window for Form1 so that your GroupBox is visible.

Paste a screenshot of your Properties window of your Form1 to show that the acceptButton and cancelButton have been set properly.

Paste a screenshot of your Properties window for your Calculate Button to show that the Text property has a Keyboard Access Key and the correct Tab Order,

Place a breakpoint at the start of your button click method, using the first test case given below, take a screenshot when your program hits the breakpoint, then step through line by line and take another screenshot when the cursor is on the last statement before the closing }. Make sure your Locals window is clearly visible in both screenshots . Note: Please change your screen colors for these screenshots if using a dark background otherwise it is impossible for me to see it.

Paste five screenshots with results for the following scenarios: 325 (before hitting Calculate and After), 2810 (before hitting Calculate and After), 530, 10 and 310.55. Make sure the answer for 2810 matches your hand worked example.

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 Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions