I am creating simple window money changer via microsoft visual studio and am encountering errors(refer to the picture) I hope you can help me solve this one

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

I am creating simple window money changer via microsoft visual studio and am encountering errors(refer to the picture) I hope you can help me solve this one.

this is my 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 Act3_AggaraoMikael_608
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            // Declares a variable
            double amount, converted = 0, exchange = 0;
            char currency;

            // Sstores the value of each textbox into variable
            amount = Convert.ToDouble(txtAmount.Text);
            currency = Convert.ToChar(txtCurrency.Text);

            // Uses Nested if
            if (currency == 'D' || currency == 'd');
            exchange = 44.50;
            else if (currency == 'Y' || currency == 'y');
            exchange = 0.58;
            else if (currency == 'R' || currency == 'r') ;
            exchange = 18.43;
            else if (currency == 'P' || currency == 'p') ;
            exchange = 115.65;
            else MessageBox.Show("Sorry, not available!");

            converted = amount * exchange;
            txtConverted.Text = "P" + Convert.ToString(converted);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            txtAmount.Clear();
            txtConverted.Clear();
            txtCurrency.Clear();
        }
    }
}

AggaraoMikael_608
Act3_AggaraoMikael_608.Form1
}
1 reference
private void button1_Click(object sender, EventArgs e)
{
// Declares a variable
double amount, converted
e, exchange
e;
char currency;
// Sstores the value of each textbox into variable
Convert.ToDouble(txtAmount.Text);
Convert.ToChar(txtCurrency.Text);
1
amount =
currency
4.
// Uses Nested if
if (currency
'D' || currency
==
==
?(,P.
exchange
else if (currency
exchange
else if (currency
44.50;
'Y' || currency
'y')¿
==
==
0.58;
'R' || currency
'r') ¿
==
exchange
else if (currency
18.43;
'P' || currency
'p') ¿
==
exchange
else MessageBox.Show("Sorry, not available!");
115.65;
4.
converted
= amount * exchange;
txtConverted. Text = "P" + Convert.ToString(converted);
1 reference
private void button2_Click(object sender, EventArgs e)
{
txtAmount.Clear();
txtConverted.Clear();
4.
txtCurrency.Clear();
}
Transcribed Image Text:AggaraoMikael_608 Act3_AggaraoMikael_608.Form1 } 1 reference private void button1_Click(object sender, EventArgs e) { // Declares a variable double amount, converted e, exchange e; char currency; // Sstores the value of each textbox into variable Convert.ToDouble(txtAmount.Text); Convert.ToChar(txtCurrency.Text); 1 amount = currency 4. // Uses Nested if if (currency 'D' || currency == == ?(,P. exchange else if (currency exchange else if (currency 44.50; 'Y' || currency 'y')¿ == == 0.58; 'R' || currency 'r') ¿ == exchange else if (currency 18.43; 'P' || currency 'p') ¿ == exchange else MessageBox.Show("Sorry, not available!"); 115.65; 4. converted = amount * exchange; txtConverted. Text = "P" + Convert.ToString(converted); 1 reference private void button2_Click(object sender, EventArgs e) { txtAmount.Clear(); txtConverted.Clear(); 4. txtCurrency.Clear(); }
100 %
O 24
A 4
Ln: 48
Ch: 10
OVR
SPC
CRLF
Error List
Entire Solution
X 24 Errors
A 4 Warnings
0 0 of 3 Messages
Build + IntelliSense
Search Error List
Description
File
Line Suppression State
Code
Project
(X) CS8641 'else' cannot start a statement.
Act3_AggaraoMikael_608 Form1.cs
37
Active
* CS1003 Syntax error, '(' expected
* CS1525 Invalid expression term 'else'
Act3_AggaraoMikael_608 Form1.cs
37
Active
Act3_AggaraoMikael_608 Form1.cs
37
Active
O CS1026 ) expected
* CS1525 Invalid expression term 'else'
X CS1002 ; expected
Act3_AggaraoMikael_608 Form1.cs
37
Active
Act3_AggaraoMikael_608 Form1.cs
37
Active
Act3_AggaraoMikael_608 Form1.cs
37
Active
Act3_AggaraoMikael_608 Form1.cs
Act3_AggaraoMikael_608 Form1.cs
Act3_AggaraoMikael_608 Form1.cs
X) CS8641 'else' cannot start a statement.
39
Active
* CS1003 Syntax error, '(' expected
X CS1525 Invalid expression term 'else'
X CS1026 ) expected
X CS1525 Invalid expression term 'else'
X CS1002 ; expected
39
Active
39
Active
Act3_AggaraoMikael_608 Form1.cs
39
Active
Act3_AggaraoMikael_608 Form1.cs
39
Active
Act3_AggaraoMikael_608 Form1.cs
Act3_AggaraoMikael_608 Form1.cs
39
Active
X) CS8641 'else' cannot start a statement.
41
Active
* CS1003 Syntax error, '(' expected
X CS1525 Invalid expression term 'else'
Act3_AggaraoMikael_608 Form1.cs
41
Active
Act3_AggaraoMikael_608 Form1.cs
41
Active
O CS1026 ) expected
* CS1525 Invalid expression term 'else'
X CS1002 ; expected
X CS8641 'else' cannot start a statement.
Act3_AggaraoMikael_608 Form1.cs
Act3_AggaraoMikael_608 Form1.cs
41
Active
41
Active
Act3_AggaraoMikael_608 Form1.cs
41
Active
Act3_AggaraoMikael_608 Form1.cs
Act3_AggaraoMikael_608 Form1.cs
43
Active
O CS1003 Syntax error, '(' expected
* CS1525 Invalid expression term 'else'
43
Active
Act3_AggaraoMikael_608 Form1.cs
43
Active
X CS1026 ) expected
Act3_AggaraoMikael_608 Form1.cs
43
Active
Act3_AggaraoMikael_608 Form1.cs
Act3_AggaraoMikael_608 Form1.cs
X CS1525 Invalid expression term 'else'
O CS1002 ; expected
A Cs0642 Possible mistaken empty statement
A CS0642 Possible mistaken empty statement
A CS0642 Possible mistaken empty statement
43
Active
43
Active
Act3_AggaraoMikael_608 Form1.cs
36
Active
Act3_AggaraoMikael_608 Form1.cs
38
Active
Act3_AggaraoMikael_608 Form1.cs
40
Active
A CS0642 Possible mistaken empty statement
Act3_AggaraoMikael_608 Form1.cs
42
Active
Transcribed Image Text:100 % O 24 A 4 Ln: 48 Ch: 10 OVR SPC CRLF Error List Entire Solution X 24 Errors A 4 Warnings 0 0 of 3 Messages Build + IntelliSense Search Error List Description File Line Suppression State Code Project (X) CS8641 'else' cannot start a statement. Act3_AggaraoMikael_608 Form1.cs 37 Active * CS1003 Syntax error, '(' expected * CS1525 Invalid expression term 'else' Act3_AggaraoMikael_608 Form1.cs 37 Active Act3_AggaraoMikael_608 Form1.cs 37 Active O CS1026 ) expected * CS1525 Invalid expression term 'else' X CS1002 ; expected Act3_AggaraoMikael_608 Form1.cs 37 Active Act3_AggaraoMikael_608 Form1.cs 37 Active Act3_AggaraoMikael_608 Form1.cs 37 Active Act3_AggaraoMikael_608 Form1.cs Act3_AggaraoMikael_608 Form1.cs Act3_AggaraoMikael_608 Form1.cs X) CS8641 'else' cannot start a statement. 39 Active * CS1003 Syntax error, '(' expected X CS1525 Invalid expression term 'else' X CS1026 ) expected X CS1525 Invalid expression term 'else' X CS1002 ; expected 39 Active 39 Active Act3_AggaraoMikael_608 Form1.cs 39 Active Act3_AggaraoMikael_608 Form1.cs 39 Active Act3_AggaraoMikael_608 Form1.cs Act3_AggaraoMikael_608 Form1.cs 39 Active X) CS8641 'else' cannot start a statement. 41 Active * CS1003 Syntax error, '(' expected X CS1525 Invalid expression term 'else' Act3_AggaraoMikael_608 Form1.cs 41 Active Act3_AggaraoMikael_608 Form1.cs 41 Active O CS1026 ) expected * CS1525 Invalid expression term 'else' X CS1002 ; expected X CS8641 'else' cannot start a statement. Act3_AggaraoMikael_608 Form1.cs Act3_AggaraoMikael_608 Form1.cs 41 Active 41 Active Act3_AggaraoMikael_608 Form1.cs 41 Active Act3_AggaraoMikael_608 Form1.cs Act3_AggaraoMikael_608 Form1.cs 43 Active O CS1003 Syntax error, '(' expected * CS1525 Invalid expression term 'else' 43 Active Act3_AggaraoMikael_608 Form1.cs 43 Active X CS1026 ) expected Act3_AggaraoMikael_608 Form1.cs 43 Active Act3_AggaraoMikael_608 Form1.cs Act3_AggaraoMikael_608 Form1.cs X CS1525 Invalid expression term 'else' O CS1002 ; expected A Cs0642 Possible mistaken empty statement A CS0642 Possible mistaken empty statement A CS0642 Possible mistaken empty statement 43 Active 43 Active Act3_AggaraoMikael_608 Form1.cs 36 Active Act3_AggaraoMikael_608 Form1.cs 38 Active Act3_AggaraoMikael_608 Form1.cs 40 Active A CS0642 Possible mistaken empty statement Act3_AggaraoMikael_608 Form1.cs 42 Active
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY