Exercício 06
Página 1 de 1
Exercício 06
O custo de um carro novo ao consumidor é a soma do custo de fabrica com a porcentagem do distribuidor e do imposto (aplicado ao custo de fabrica).Supondo que o porcentual do distribuidor seja de 28% e os imposto de 45%. Faça um programa que receba custo de fabrica de um carro, calcule e mostre o custo final do consumidor.
=> Class "dados"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EX6
{
class dados
{
public float vlDist = 28f;
public float inposto = 45f;
public void calculo(double b,double c)
{
b = this.vlDist;
c = this.inposto;
}
}
}
=> Class "Main Principal"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EX6
{
class Program
{
static void Main(string[] args)
{
float custofinal = 0;
float valor = 0;
dados vl = new dados();
Console.Write("Valor Do Carro = ");
valor = float.Parse(Console.ReadLine());
Console.WriteLine("---------------------------");
custofinal = valor + vl.vlDist * vl.inposto;
Console.WriteLine("Valor Apagar = " + custofinal);
Console.ReadKey();
}
}
}
Comenta ai
=> Class "dados"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EX6
{
class dados
{
public float vlDist = 28f;
public float inposto = 45f;
public void calculo(double b,double c)
{
b = this.vlDist;
c = this.inposto;
}
}
}
=> Class "Main Principal"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EX6
{
class Program
{
static void Main(string[] args)
{
float custofinal = 0;
float valor = 0;
dados vl = new dados();
Console.Write("Valor Do Carro = ");
valor = float.Parse(Console.ReadLine());
Console.WriteLine("---------------------------");
custofinal = valor + vl.vlDist * vl.inposto;
Console.WriteLine("Valor Apagar = " + custofinal);
Console.ReadKey();
}
}
}
Comenta ai
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|