0% found this document useful (0 votes)
62 views

Using System Algor - Fulbito

1. The document contains code for several C# programs that take user input, perform calculations, and output results. The programs include calculating a new salary based on the original salary and thresholds, calculating the average of three test scores and determining if the student passed or failed, comparing two integer numbers and determining which is greater, and calculating a discount and total price based on the original price and thresholds. 2. The code uses common structures like if/else statements, constants, and data types like integers, floats, and strings. It prompts the user for input, performs calculations, and outputs results to the console by printing strings. 3. The programs demonstrate basic programming concepts like taking input, performing conditional logic and calculations
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Using System Algor - Fulbito

1. The document contains code for several C# programs that take user input, perform calculations, and output results. The programs include calculating a new salary based on the original salary and thresholds, calculating the average of three test scores and determining if the student passed or failed, comparing two integer numbers and determining which is greater, and calculating a discount and total price based on the original price and thresholds. 2. The code uses common structures like if/else statements, constants, and data types like integers, floats, and strings. It prompts the user for input, performs calculations, and outputs results to the console by printing strings. 3. The programs demonstrate basic programming concepts like taking input, performing conditional logic and calculations
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class rogram
{
static !oid "ain#string$% args&
{
short 'dad;
string (om)re;
long dni;
Console.*riteLine#+,n,nrograma 'dad+&;
Console.*riteLine#+,t-------------------+&;

.. /ngreso de !aria)le
Console.*rite#+,t /(G0'S' '1A12 +&;
'dad 3 short.arse#Console.0eadLine#&&;
..roceso
i4 #'dad 53 16&
{
Console.*riteLine#+'s mayor de edad+&;
Console.*rite#+ /ngrese (umero de 1(/2 +&;
dni 3 long.arse#Console.0eadLine#&&;
Console.*riteLine#+Tengo+ 7 'dad 7 +a8os+ 7 +el 1(/ es2+ 7 dni &;
9

else
{
Console.*rite#+'s menor de edad+&;
Console.*rite#+/ngrese nom)re del tutor2 +&;
(om)re 3 Console.0eadLine#&;
Console.*riteLine#+Tengo+ 7 'dad 7 +a8os+ 7 +el nom)re+ 7 (om)re&;
9
Console.0eadLine#&;
9
9
9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication:
{
class rogram
{
static !oid "ain#string$% args&
{
int numero;
Console.*riteLine#+,nA0 ' /"A0+&;
Console.*riteLine#+,t-------------------+&;
.. /ngreso de !aria)le
Console.*rite#+,t /ngrese numero2 +&;
numero 3 int.arse#Console.0eadLine#&&;
..roceso
i4 #numero ; < 33 =& .. modulo del resto
{
Console.*riteLine#+,n 'S A0+&;
Console.*riteLine#+,n S' ">LT/L/CA ?0 1?S2 + 7 #numero - <&&;

9
else
{
Console.*riteLine#+,n 'S /"A0+&;
Console.*riteLine#+ ,n S' ">LT/L/CA ?0 1?S2 + 7 #numero-:&&;
9
Console.0eadLine#&;
9
9
9
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication<
{
class rogram
{
static !oid "ain#string$% args&
{
@oat sueldoA (>'B?CS>'L1?;
Console.*riteLine#+,n,n rograma (ue!o Sueldo+&;
.. 1eclaraciDn de !aria)les
Console.*rite#+,t /ngrese Sueldo2 +&;
sueldo 3 @oat.arse#Console.0eadLine#&&;
..roceso
i4 #sueldo E 1===&
{
(>'B?CS>'L1? 3 sueldo 7 #sueldo - =.1F4&;
Console.*riteLine#+,n 'l sueldo es menor que 1===+&;
Console.*riteLine#+,n 'L (>'B? S>'L1? 'S2 + 7 (>'B?CS>'L1?&;
9
else
{
(>'B?CS>'L1? 3 sueldo 7 #sueldo - =.1<4&;
Console.*riteLine#+,n 'l sueldo es mayor que 1===+&;
Console.*riteLine#+,n 'L (>'B? S>'L1? 'S2 + 7 (>'B?CS>'L1?&;
9
Console.0eadLine#&;
9
9
9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication:
{
class rogram
{
static !oid "ain#string$% args&
{
@oat prac1A prac<A prac:A 0?"CG/(;
Console.*riteLine#+,n rograma romedio Ginal+&;
..1eclaraciDn de !aria)les
Console.*rite#+,n /ngrese (ota de rHctica12 +&;
prac1 3 @oat.arse#Console.0eadLine#&&;
Console.*rite#+,n /ngrese (ota de rHctica<2 +&;
prac< 3 @oat.arse#Console.0eadLine#&&;
Console.*rite#+,n /ngrese (ota de rHctica:2 +&;
prac: 3 @oat.arse#Console.0eadLine#&&;
.. CHlculo
0?"CG/( 3 #prac1 7 prac< 7 prac:& . :;
Console.*riteLine#+,n 'L 0?"'1/? G/(AL 'S2 + 7 0?"CG/(&;
.. roceso
i4 #0?"CG/( 53 11&
{
Console.*riteLine#+,n 'STI A0?JA1?+&;
9
else
{
Console.*riteLine#+,n 'STI 1'SA0?JA1?+&;
9
Console.0eadLine#&;

9
9
9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplicationK
{
class rogram
{
static !oid "ain#string$% args&
{
int numero1A numero<;
Console.*riteLine#+,n rograma ComparaciDn de dos (Lmeros+&;
../ngreso !aria)le
Console.*rite#+,n /ngrese el nLmero 12 +&;
numero1 3 int.arse#Console.0eadLine#&&;
Console.*rite#+,n /ngrese el nLmero <2 +&;
numero< 3 int.arse#Console.0eadLine#&&;
..roceso
i4 #numero1 E numero<&
{
Console.*riteLine#+,n La comparaciDn es2 + 7 numero1 7 + es menor que + 7
numero<&;
9
else
{
Console.*riteLine#+,n La comparaciDn es2 + 7 numero1 7 + es mayor que + 7
numero< &;
9
Console.0eadLine#&;
9
9
9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication<
{
class rogram
{
static !oid "ain#string$% args&
{
@oat "ontoA dsctoA /mporte;
const @oat pd1 3 =.<=4;
const @oat pd< 3 =.1F4;
const @oat pd: 3 =.1=4;
const @oat pdK 3 =.=F4;
string sal 3 + +;
Console.*riteLine#+,n"?(T?+&;
Console.*rite#+,t /ngresar "onto2 +&;
"onto 3 @oat.arse#Console.0eadLine#&&;
..roceso
i4 #"onto 53 1==&
{
dscto 3 "onto - pd1;
sal 3 + es el <=;+;
9
else i4 #"onto 53 M=&
{
dscto 3 "onto - pd<;
sal 3 + es el 1F;+;
9
else i4 #"onto 53 :=&
{
dscto 3 "onto - pd:;
sal 3 + es el 1=;+;
9
else
{
dscto 3 "onto - pdK;
sal 3 + es el F;+;
9
/mporte 3 "onto 7 dscto;
Console.*riteLine#+'l importe es2+ 7 /mporte&;
Console.*riteLine#+'l orcentaNe+ 7 sal&;
Console.0eadLine#&;
9
9
9
Problemas Propuestos.
1. Construya un algoritmo tal que dado como dato el sueldo de una trabajador,
le aplique en aumento del 15% si su su sueldo es inferior a 1000 y 12% en
caso contrario.
Imprima el nuevo sueldo del trabajador.
2. esarrolle un programa y el diagrama de flujo, que calcule el promedio del
alumno si se ingresan tres notas de pr!cticas. "uego se calcula el promedio
final #f $ %#rac1& #rac1& #rac1'(). *i el promedio es mayor o igual 11 se
debe imprimir + ,probado- de lo contrario +esaprobado-.
). .laborar un algoritmo que permita saber cu!l es el n/mero mayor y el
n/mero menor en comparaci0n de dos n/meros enteros.

You might also like