Example #1
0
    // public static string GetLoanDurationDescritiont
    public static double calculateCompoundInterest(double Principal, double InterestRate, decimal periods, CompoundType compoundType)
    {
        double InterestEarned, AnnualRate;
        double FutureValue, RatePerPeriod;
        //int  CompoundType;

        AnnualRate = InterestRate / 100;

        //if (rdoMonthly.Checked)
        //    CompoundType = 12;
        //else if (rdoQuarterly.Checked)
        //    CompoundType = 4;
        //else if (rdoSemiannually.Checked)
        //    CompoundType = 2;
        //else
        //    CompoundType = 1;

        //NumberOfPeriods = Int32.Parse(txtPeriods.Text);
        double i = AnnualRate / (int)compoundType;
        double n = (int)compoundType * ((double)periods);

        RatePerPeriod = AnnualRate / ((double)periods);
        FutureValue = Principal * Math.Pow(1 + i, n);
        InterestEarned = FutureValue - Principal;

        return FutureValue;
        //txtInterestEarned.Text = InterestEarned.ToString("C");
        //txtAmountEarned.Text = FutureValue.ToString("C");
    }
Example #2
0
		public IType MergeTypeWithTemporary (IType type)
		{
			if (type == null || type.CompilationUnit == null || string.IsNullOrEmpty (type.CompilationUnit.FileName))
				return type;
			
			if (temporaryCompilationUnits.ContainsKey (type.CompilationUnit.FileName)) {
				var unit = temporaryCompilationUnits[type.CompilationUnit.FileName];
				IType tmpType = unit.Types.FirstOrDefault (t => t.Location == type.Location || t.DecoratedFullName == type.DecoratedFullName);
				
				if (tmpType != null) {
					CompoundType result = new CompoundType ();
					result.AddPart (type);
					result.AddPart (tmpType);
					return result;
				}
			}
			return type;
		}
Example #3
0
		static DomType ReadTypeInternal (BinaryReader reader, INameDecoder nameTable, IDomObjectTable objectTable)
		{
			uint typeCount = ReadUInt (reader, 1000);
			if (typeCount > 1) {
				CompoundType compoundResult = new CompoundType ();
				while (typeCount-- > 0) {
					compoundResult.AddPart (ReadTypeInternal (reader, nameTable, objectTable));
				}
				
				return compoundResult;
			}
			
			DomType result = new DomType ();
			ReadMemberInformation (reader, nameTable, objectTable, result);
			//			bool verbose = result.Name == "CopyDelegate";
			//			if (verbose) System.Console.WriteLine("read type:" + result.Name);
			result.TypeModifier = (TypeModifier)reader.ReadUInt32 ();
			result.BodyRegion = ReadRegion (reader, nameTable);
			string compilationUnitFileName = ReadString (reader, nameTable);
			result.CompilationUnit = new CompilationUnit (compilationUnitFileName);
			
			result.Namespace = ReadString (reader, nameTable);
			result.ClassType = (ClassType)reader.ReadUInt32 ();
			result.BaseType = ReadReturnType (reader, nameTable, objectTable);
			
			// implemented interfaces
			long count = ReadUInt (reader, 5000);
			//			if (verbose) System.Console.WriteLine("impl. interfaces:" + count);
			while (count-- > 0) {
				result.AddInterfaceImplementation (ReadReturnType (reader, nameTable, objectTable));
			}
			
			// innerTypes
			//			if (verbose) System.Console.WriteLine("pos:" + reader.BaseStream.Position);
			count = ReadUInt (reader, 10000);
			//			if (verbose) System.Console.WriteLine("inner types:" + count);
			while (count-- > 0) {
				DomType innerType = ReadTypeInternal (reader, nameTable, objectTable);
				innerType.DeclaringType = result;
				result.Add (innerType);
			}
			
			// fields
			//			if (verbose) System.Console.WriteLine("pos:" + reader.BaseStream.Position);
			count = ReadUInt (reader, 10000);
			//			if (verbose) System.Console.WriteLine("fields:" + count);
			while (count-- > 0) {
				DomField field = ReadField (reader, nameTable, objectTable);
				field.DeclaringType = result;
				result.Add (field);
			}
			
			// methods
			//			if (verbose) System.Console.WriteLine("pos:" + reader.BaseStream.Position);
			count = ReadUInt (reader, 10000);
			//			if (verbose) System.Console.WriteLine("methods:" + count);
			while (count-- > 0) {
				DomMethod method = ReadMethod (reader, nameTable, objectTable);
				method.DeclaringType = result;
				result.Add (method);
			}
			
			// properties
			//			if (verbose) System.Console.WriteLine("pos:" + reader.BaseStream.Position);
			count = ReadUInt (reader, 10000);
			//			if (verbose) System.Console.WriteLine("properties:" + count);
			while (count-- > 0) {
				DomProperty property = ReadProperty (reader, nameTable, objectTable);
				property.DeclaringType = result;
				result.Add (property);
			}
			
			// events
			//			if (verbose) System.Console.WriteLine("pos:" + reader.BaseStream.Position);
			count = ReadUInt (reader, 10000);
			//			if (verbose) System.Console.WriteLine("events:" + count);
			while (count-- > 0) {
				DomEvent evt = ReadEvent (reader, nameTable, objectTable);
				evt.DeclaringType = result;
				result.Add (evt);
			}
			
			// type parameters
			count = ReadUInt (reader, 500);
			while (count-- > 0) {
				TypeParameter tp = ReadTypeParameter (reader, nameTable, objectTable);
				result.AddTypeParameter (tp);
			}
			return result;
		}
 public void SetCompoundType(TypePKaDTO typePkaDTO, CompoundType newValue)
 {
     AddCommand(_parameterTask.SetCompoundType(typePkaDTO.CompoundTypeParameter.Parameter, newValue));
 }
Example #5
0
 public ConverterAccess(FunctionType parent, CompoundType type)
 {
     Parent = parent;
     Type = type;
 }
Example #6
0
 private CompoundSpec(CompoundType compoundType)
 {
     TypeID = (uint)_typeIDs.Count; _typeIDs.Add(TypeID, compoundType);
     Types  = compoundType.Types;
     Length = (uint)Types.Length;
 }
        private void addPkAParameters(Model.Compound compound, int index, double pkA, CompoundType compoundType)
        {
            var pkaParameter = DomainHelperForSpecs.ConstantParameterWithValue(pkA).WithName(CoreConstants.Parameters.ParameterPKa(index));

            pkaParameter.ValueOrigin.UpdateFrom(_pkaValueOrigin);
            A.CallTo(() => _valueOriginMapper.MapToSnapshot(pkaParameter.ValueOrigin)).Returns(_snapshotValueOrigin);
            compound.Add(pkaParameter);
            var compoundTypeParameter = DomainHelperForSpecs.ConstantParameterWithValue((int)compoundType).WithName(Constants.Parameters.ParameterCompoundType(index));

            compoundTypeParameter.ValueOrigin.UpdateFrom(_pkaValueOrigin);
            A.CallTo(() => _valueOriginMapper.MapToSnapshot(compoundTypeParameter.ValueOrigin)).Returns(_snapshotValueOrigin);
            compound.Add(compoundTypeParameter);
        }
 public RichCompound(CompoundType chemical) : base(chemical.ToString())
 {
 }
Example #9
0
 static Control CreateChildView(CompoundType target)
     => target == null ? null : _dummy;
Example #10
0
 internal void AddZeroReferred(CompoundType item)
 {
     zero_referred.Add(item);
 }