This is a code I am using for this chart: I keep getting errors I have no idea what I am doing wrong at all, please help me figure it out = 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 CollegeCostComparison_Tabatha_Ross { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void calculateButton_Click(object sender, EventArgs e) { //Parse input values double tripstoCollege1 = double.Parse(tripstoCollege1.Text); double distanceToCollege1 = double.Parse(distanceToCollege1.Text); double applicationFee1 = double.Parse(applicationFee1.Text); double tuition1 = double.Parse(tuition1.Text); double roomBoard1 = double.Parse(roomBoard1.Text); double tripstToCollege2 = double.Parse(tripstoCollege2.Text); double distanceToCollege2 = double.Parse(distanceToCollege2.Text); double applicaitonFee2 = double.Parse(applicationFee2.Text); double tuition2 = double.Parse(tuition2.Text); double roomboard2 = double.Parse(roombBoard2.Text); //Constants const double fuelCostPerGallon = 2.50; const double milesPerGallon = 25; // Calculate 1 Year Total Fuel Cost for each college double fuelCostCollege1 = (tripsToCollege1 * distanceToCollege1) / milesPerGallon * fuelCostPerGallon; double fuelCostCollege2 = (tripsToCollege2 * distanceToCollege2) / milesPerGallon * fuelCostPerGallon; // Calculate 4 Year Total Costs for each college double totalCostCollege1 = applicationFee1 + (4 * fuelCostCollege1) + (4 * tuition1) - (4 * roomBoard1); double totalCostCollege2 = applicationFee2 + (4 * fuelCostCollege2) + (4 * tuition2) - (4 * roomBoard2); // Display the results resultCollege1.Text = $"4-Year Total Cost: ${totalCostCollege1:F2}"; resultCollege2.Text = $"4-Year Total Cost: ${totalCostCollege2:F2}"; } } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

This is a code I am using for this chart:

I keep getting errors I have no idea what I am doing wrong at all, please help me figure it out

 

 

=

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 CollegeCostComparison_Tabatha_Ross
{
public partial class Form1 : Form
{

public Form1()
{
InitializeComponent();
}

private void calculateButton_Click(object sender, EventArgs e)
{
//Parse input values
double tripstoCollege1 = double.Parse(tripstoCollege1.Text);
double distanceToCollege1 = double.Parse(distanceToCollege1.Text);
double applicationFee1 = double.Parse(applicationFee1.Text);
double tuition1 = double.Parse(tuition1.Text);
double roomBoard1 = double.Parse(roomBoard1.Text);

double tripstToCollege2 = double.Parse(tripstoCollege2.Text);
double distanceToCollege2 = double.Parse(distanceToCollege2.Text);
double applicaitonFee2 = double.Parse(applicationFee2.Text);
double tuition2 = double.Parse(tuition2.Text);
double roomboard2 = double.Parse(roombBoard2.Text);

//Constants
const double fuelCostPerGallon = 2.50;
const double milesPerGallon = 25;

// Calculate 1 Year Total Fuel Cost for each college
double fuelCostCollege1 = (tripsToCollege1 * distanceToCollege1) / milesPerGallon * fuelCostPerGallon;
double fuelCostCollege2 = (tripsToCollege2 * distanceToCollege2) / milesPerGallon * fuelCostPerGallon;

// Calculate 4 Year Total Costs for each college
double totalCostCollege1 = applicationFee1 + (4 * fuelCostCollege1) + (4 * tuition1) - (4 * roomBoard1);
double totalCostCollege2 = applicationFee2 + (4 * fuelCostCollege2) + (4 * tuition2) - (4 * roomBoard2);

// Display the results
resultCollege1.Text = $"4-Year Total Cost: ${totalCostCollege1:F2}";
resultCollege2.Text = $"4-Year Total Cost: ${totalCostCollege2:F2}";

 


}
}
}

Server Explorer Toolbox Data Sources
File Edit View Git Project Build
Form1
College Name
State where college is located
Number of one-way trips you
estimate you will drive in a year
from your
residence to the college
Form1.cs
Form1.Designer.cs
Form1.cs [Design] X
✪ Scaling on your main display is set to 125%. Restart Visual Studio with 100% scaling Help me decide
One-way distance, in miles,
from your residence to the
college
Colleges One-Time Application Fee
Cost
College's Annual Tuition Cost
College's Annual Room Board
cost
CALCULATIONS
Calculated 1 Year Total
FUEL Cost
Calculated 4 Year Total of ALL
Costs
'Form1' declarations
Entire Solution
Code
Error List Output
Ready
Debug
71°F
Sunny
Debug
Format Test Analyze Tools
Any CPU
▶ Start -
College 1
Calculate Totals for Both Colleges
Calculated Results
for College 1
Calculated Results
for College 1
College 2
Group by: Project only
Extensions
Calculated Results for
College 2
Calculated Results for
College 2
Window Help Search (Ctrl+Q)
= = =T + ||||I{@|
Q Search
X
Keep Results List View
(D))
G
File
■
Cal
0
HH
Line Col
Object [from metadata] â
CollegeCostComparison-Tabatha_Ross
(DELL)
Search Find All References
Project
O
XI
0
R.
X
Дх
P.
Solution Explorer
4
Sign in
O 心管
C# CollegeCostComparison-Tabatha_Ross
▷ > Properties
▷
References
App.config
Form1.cs
▷ Form1.Designer.cs
PAT
DE: Z
Search Solution Explorer (Ctrl+;)
Solution CollegeCost Comparison-Tabatha_Ross' (1 of 1 prc
→Form1.resx
c# Program.cs
Live Share
Solution Explorer Git Changes
Properties
x
↑ Add to Source Control
х гос
4 x
д х
8:02 PM
9/22/2023
Transcribed Image Text:Server Explorer Toolbox Data Sources File Edit View Git Project Build Form1 College Name State where college is located Number of one-way trips you estimate you will drive in a year from your residence to the college Form1.cs Form1.Designer.cs Form1.cs [Design] X ✪ Scaling on your main display is set to 125%. Restart Visual Studio with 100% scaling Help me decide One-way distance, in miles, from your residence to the college Colleges One-Time Application Fee Cost College's Annual Tuition Cost College's Annual Room Board cost CALCULATIONS Calculated 1 Year Total FUEL Cost Calculated 4 Year Total of ALL Costs 'Form1' declarations Entire Solution Code Error List Output Ready Debug 71°F Sunny Debug Format Test Analyze Tools Any CPU ▶ Start - College 1 Calculate Totals for Both Colleges Calculated Results for College 1 Calculated Results for College 1 College 2 Group by: Project only Extensions Calculated Results for College 2 Calculated Results for College 2 Window Help Search (Ctrl+Q) = = =T + ||||I{@| Q Search X Keep Results List View (D)) G File ■ Cal 0 HH Line Col Object [from metadata] â CollegeCostComparison-Tabatha_Ross (DELL) Search Find All References Project O XI 0 R. X Дх P. Solution Explorer 4 Sign in O 心管 C# CollegeCostComparison-Tabatha_Ross ▷ > Properties ▷ References App.config Form1.cs ▷ Form1.Designer.cs PAT DE: Z Search Solution Explorer (Ctrl+;) Solution CollegeCost Comparison-Tabatha_Ross' (1 of 1 prc →Form1.resx c# Program.cs Live Share Solution Explorer Git Changes Properties x ↑ Add to Source Control х гос 4 x д х 8:02 PM 9/22/2023
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Design of User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education