EDN Admin
Well-known member
I need to make a Console Application which can calculate the values of the Constants " X " and " Y " for the 2 equations ( ax + by = c) and ( dx + ey = f ) .. Of Course the program will ask the user to enter the values for the variables ( a , b , c , d , e , f ). Ive tried to make some code, but got stuck at the core of the code. Would anybody please help me?
my Code:
<div style="margin:5px 20px 20px
<div class=smallfont style="margin-bottom:2px Code: <pre class=alt2 style="border-right:1px inset;padding-right:1px;border-top:1px inset;padding-left:1px;padding-bottom:1px;margin:0px;border-left:1px inset;padding-top:1px;border-bottom:1px inset using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _1st_Exercise
{
class Program
{
static void Main(string[] args)
{
//Getting the constants
Console.WriteLine(""dx + ey = f" ,, "ax +by = c"n");
Console.WriteLine("Please entern");
Console.Write("F= ");
int F;
F = Convert.ToInt32(Console.ReadLine());
Console.Write("nE= ");
int E;
E = Convert.ToInt32(Console.ReadLine());
Console.Write("nD= ");
int D;
D = Convert.ToInt32(Console.ReadLine());
Console.Write("nC= ");
int C;
C = Convert.ToInt32(Console.ReadLine());
Console.Write("nB= ");
int B;
B = Convert.ToInt32(Console.ReadLine());
Console.Write("nA= ");
int A;
A = Convert.ToInt32(Console.ReadLine());
//Code core
int x;
x = (A - D);
int y;
y = (B - E);
//Output
Console.WriteLine("nnX = " + x );
Console.WriteLine("nY = " + y );
//Exit program
Console.WriteLine("nnPress any key to exit");
Console.ReadKey();
}
}
}[/code]
View the full article
my Code:
<div style="margin:5px 20px 20px
<div class=smallfont style="margin-bottom:2px Code: <pre class=alt2 style="border-right:1px inset;padding-right:1px;border-top:1px inset;padding-left:1px;padding-bottom:1px;margin:0px;border-left:1px inset;padding-top:1px;border-bottom:1px inset using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _1st_Exercise
{
class Program
{
static void Main(string[] args)
{
//Getting the constants
Console.WriteLine(""dx + ey = f" ,, "ax +by = c"n");
Console.WriteLine("Please entern");
Console.Write("F= ");
int F;
F = Convert.ToInt32(Console.ReadLine());
Console.Write("nE= ");
int E;
E = Convert.ToInt32(Console.ReadLine());
Console.Write("nD= ");
int D;
D = Convert.ToInt32(Console.ReadLine());
Console.Write("nC= ");
int C;
C = Convert.ToInt32(Console.ReadLine());
Console.Write("nB= ");
int B;
B = Convert.ToInt32(Console.ReadLine());
Console.Write("nA= ");
int A;
A = Convert.ToInt32(Console.ReadLine());
//Code core
int x;
x = (A - D);
int y;
y = (B - E);
//Output
Console.WriteLine("nnX = " + x );
Console.WriteLine("nY = " + y );
//Exit program
Console.WriteLine("nnPress any key to exit");
Console.ReadKey();
}
}
}[/code]
View the full article