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}"; } } }
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F40f5df34-6756-4b67-b2a4-18e7119b980e%2F3d388e84-f52f-4a6f-9732-9518674a4309%2F2vzjxs8_processed.png&w=3840&q=75)

Step by step
Solved in 3 steps









