Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace cgatito_chicharronera
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("resuelve ecueaciones de segundo grado ax^2+bx+c");
- Chicharronera ch = new Chicharronera();
- Console.WriteLine("ingrese el valor de ax^2");
- double a,b,c;
- string value = Convert.ToString(Console.ReadLine());
- if (Double.TryParse(value, out a))
- {
- Console.WriteLine("Valor valido");
- }
- else
- {
- Console.WriteLine("Por favor ingresar solo numeros");
- }
- if (a != 0)
- {
- Console.WriteLine("ingrese el valor de bx");
- string value1 = Convert.ToString(Console.ReadLine());
- if (Double.TryParse(value1, out b))
- {
- Console.WriteLine("Valor valido");
- }
- else
- {
- Console.WriteLine("Por favor ingresar solo numeros");
- }
- Console.WriteLine("ingrese el valor de c");
- string value2 = Convert.ToString(Console.ReadLine());
- if (Double.TryParse(value2, out c))
- {
- Console.WriteLine("Valor valido");
- }
- else
- {
- Console.WriteLine("Por favor ingresar solo numeros");
- }
- ch.Valor1 = a;
- ch.Valor2 = b;
- ch.Valor3 = c;
- if(ch.valchicharronera()==1)
- {
- Console.WriteLine("tu resultado es: \nx1= " + ch.getchicharronera() + "\nx2= " + ch.getchicharronera2());
- }
- else
- {
- Console.WriteLine("Rango de valores no validos");
- }
- }
- else
- {
- Console.WriteLine("no es una ecuacion de segundo grado");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement