Skip to content
Can someone fix my error? I didn't know where to append }
Profile icon
LienDo

using System;

class MainClass {
class Arithmetric{
class Check{
public double Add (double a, double b, double c){

double sum = a + b + c; Console.WriteLine (a + "+" + b + "+" + c + "=" + sum); return sum;

}
public double Subtract (double a, double b, double c){

double difference = a - b - c; Console.WriteLine (a + "-" + b + "-" + c + "=" + difference); return difference;

}
public double Multiply (double a, double b, double c){

double product = a * b * c; Console.WriteLine (a + "*" + b + "*" + c + "=" + product); return product;

}
public double Divide (double a, double b, double c){

double quotient = a / b / c; Console.WriteLine (a + "/" + b + "/" + c + "=" + quotient); return quotient;

}
public static void Main (string[] args) {
Arithmetric ar1 = new Arithmetric();

ar1.Add(10.383, 15, 20); ar1.Subtract(100002.2,20.434,16); ar1.Multiply(34.4, 0.15, 27); ar1.Divide(50000, 2, 5); Arithmetric ar2 = new Arithmetric(); Console.WriteLine("\n Second object: "); ar2.Add(37283.3, 323.32, 1387); ar2.Subtract(9382923.21,123,98.3); ar2.Multiply(113.4, 0.123, 0.122); ar2.Divide(1000000, 5756, 2.2); Check ch1 = new Check(); Console.WriteLine("Enter a number: "); int x = int.Parse(Console.ReadLine()); //checking if number is even or odd if (x % 2 == 0 & x % 5 == 1){ Console.WriteLine(x + " is an even number."); Console.WriteLine(x + " is also divisible by 5."); } else{ Console.WriteLine(x + " is an odd number."); } }

}
}

Error:
main.cs(62,246): error cs1525: Unexpected symbol 'end-of-file'

You are viewing a single comment. View All
Profile icon
Jackolanternexe