Hey I need help creating this code using Visual Studio (Basic) 2015
Fitness World Health Club is having its Weight Room tiled. The room is rectangular and must
have
its walls covered with tile.
· The tile costs $30 per carton.
· One carton of tile will cover 25 square feet.
· The labor charge is $55 per carton of tile applied.
A program is needed to compute the total cost of the job (tile cost plus labor charge).
User inputs needed would be the dimensions of the room (length, width, height).
The outputs must be:
1. Area to be tiled in square feet,
2. The number of cartons of tile needed. (You cannot buy a partial carton so you must round
up to the next integer. A statement that will do this for you is
intCartons = CInt(Math.Ceiling(dblTotalArea / 25))
3. Cost of the tile,
4. Labor charge,
5. Total Cost of the Job (tile cost plus labor charge)
Notes:
· Remember to use text boxes to hold user inputs and labels to display outputs.
· Be sure to choose appropriate names for variables and other objects.
· Create Keyboard Access Keys (Alt key shortcuts) for the buttons and make the Calculate
button the Accept Button.
· Be sure the Tab Order is set properly.
· Use comments to document your work.
Sample of interface R Tiling Cost Calculator X Length 30 Width 25 Height 42 Total Area 4620
Cartons Needed 185 Cost of Tile $5,550.00 Labor Cost $10.175.0 Total Job Cost $15,725.0
Calculate Clear Exit
Solution
/*C sharp code */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace tilingCalc
{
public partial class Form1 : Form
{
int length, width, height, total_area, cartoon, cost_tile, labor_cost;
/* Closes an app */
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
/*Closes current app and invoke new object */
private void button2_Click(object sender, EventArgs e)
{
Form1 f = new Form1();
f.Show();
this.Dispose(false);
}
private void button1_Click(object sender, EventArgs e)
{
getData();
/* Calculate area and display them */
total_area = length * width * height;
text_area.Text = total_area.ToString();
/* Calculate cartoon no and display them */
cartoon = (int)(Math.Ceiling((decimal)((double)total_area / 25)));
text_cartoon.Text = cartoon.ToString();
/* Calculate tile cost and display them */
cost_tile = cartoon * 30;
text_tile_cost.Text = \"$\" + cost_tile.ToString() + \".00\";
/* Calculate labor cost and display them */
labor_cost = cartoon * 55;
text_cost_labor.Text = \"$\" + labor_cost.ToString() + \".00\";
/* Calculate total cost and display them */
text_total_cost.Text = \"$\" + (cost_tile + labor_cost).ToString() + \".00\";
}
void getData()
{
try
{
if (text_length.TextLength != 0)
{
length = int.Parse(text_length.Text);
}
if (text_width.TextLength != 0)
{
width = int.Parse(text_width.Text);
}
if (text_height.TextLength != 0)
{
height = int.Parse(text_height.Text.
Hey I need help creating this code using Visual Studio (Basic) 2015.pdf
1. Hey I need help creating this code using Visual Studio (Basic) 2015
Fitness World Health Club is having its Weight Room tiled. The room is rectangular and must
have
its walls covered with tile.
· The tile costs $30 per carton.
· One carton of tile will cover 25 square feet.
· The labor charge is $55 per carton of tile applied.
A program is needed to compute the total cost of the job (tile cost plus labor charge).
User inputs needed would be the dimensions of the room (length, width, height).
The outputs must be:
1. Area to be tiled in square feet,
2. The number of cartons of tile needed. (You cannot buy a partial carton so you must round
up to the next integer. A statement that will do this for you is
intCartons = CInt(Math.Ceiling(dblTotalArea / 25))
3. Cost of the tile,
4. Labor charge,
5. Total Cost of the Job (tile cost plus labor charge)
Notes:
· Remember to use text boxes to hold user inputs and labels to display outputs.
· Be sure to choose appropriate names for variables and other objects.
· Create Keyboard Access Keys (Alt key shortcuts) for the buttons and make the Calculate
button the Accept Button.
· Be sure the Tab Order is set properly.
· Use comments to document your work.
Sample of interface R Tiling Cost Calculator X Length 30 Width 25 Height 42 Total Area 4620
Cartons Needed 185 Cost of Tile $5,550.00 Labor Cost $10.175.0 Total Job Cost $15,725.0
Calculate Clear Exit
Solution
/*C sharp code */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
2. using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace tilingCalc
{
public partial class Form1 : Form
{
int length, width, height, total_area, cartoon, cost_tile, labor_cost;
/* Closes an app */
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
/*Closes current app and invoke new object */
private void button2_Click(object sender, EventArgs e)
{
Form1 f = new Form1();
f.Show();
this.Dispose(false);
}
private void button1_Click(object sender, EventArgs e)
{
getData();
/* Calculate area and display them */
total_area = length * width * height;
text_area.Text = total_area.ToString();
/* Calculate cartoon no and display them */
cartoon = (int)(Math.Ceiling((decimal)((double)total_area / 25)));
text_cartoon.Text = cartoon.ToString();
/* Calculate tile cost and display them */
cost_tile = cartoon * 30;
text_tile_cost.Text = "$" + cost_tile.ToString() + ".00";
/* Calculate labor cost and display them */
4. {
}
}
}
/* C Sharp design code */
namespace tilingCalc
{
partial class Form1
{
///
/// Required designer variable.
///
private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
5. this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.calculate = new System.Windows.Forms.Button();
this.clear = new System.Windows.Forms.Button();
this.exit = new System.Windows.Forms.Button();
this.text_length = new System.Windows.Forms.TextBox();
this.text_width = new System.Windows.Forms.TextBox();
this.text_height = new System.Windows.Forms.TextBox();
this.text_area = new System.Windows.Forms.TextBox();
this.text_cartoon = new System.Windows.Forms.TextBox();
this.text_tile_cost = new System.Windows.Forms.TextBox();
this.text_cost_labor = new System.Windows.Forms.TextBox();
this.text_total_cost = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(27, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Length";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(27, 50);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 13);
this.label2.TabIndex = 0;
this.label2.Text = "Width";
//