public static void SecondMethod(RunningTotal param) { DebugMgr.start(10, "ExMethodCall.SecondMethod"); param.IncrementValue(); DebugMgr.output(10, "During RunningTotal.value = " + param.GetValue()); DebugMgr.end(10); }
public RunningTotalDto(RunningTotal runningTotal) : base(runningTotal.Id) { Text = runningTotal.Text; Date = runningTotal.Date.ToShortDateString(); Delta = runningTotal.Delta; Value = runningTotal.Value; ParentId = runningTotal.ParentId; Name = runningTotal.Name; }
public RunningTotal Apply(RunningTotal runningTotal) { while (runningTotal.Count(_qualifyingItem) >= 1) { runningTotal = runningTotal.ApplyPrice(_qualifyingItem.Price, _qualifyingItem); } return(runningTotal); }
public async Task <IActionResult> Post([FromBody] double number) { var previousTotal = await _runningTotalRepository.GetPrevioudTotal(); var runningTotal = new RunningTotal(previousTotal, number); _runningTotalRepository.CreateRunningTotal(runningTotal); await _runningTotalRepository.SaveChangesAsync(); return(Ok()); }
public void RunningTotalTestSimple() { int[] input = { 1, 2, 3, 4, 5, 6 }; int[] output = RunningTotal.runTotal(input); int[] expected = { 1, 3, 6, 10, 15, 21 }; // run the following to ensure test fails when it should // int[] expected = { 5, 3, 6, 10, 15, 21 }; CollectionAssert.AreEqual(expected, output); }
static void Main(string[] args) { var runner = new RunningTotal("/amsterdam", false); runner.NewRealtor += runner_NewRealtor; runner.NumberOfObjects += runner_NumberOfObjects; runner.Start(); System.Console.WriteLine("Total number of realtors active in amsterdam: " + runner.Realtors.Count); var count = 1; foreach (var realtor in runner.Realtors.OrderByDescending (r => r.Value.NumberOfObjects).Select(r => r.Value).Take(10)) { System.Console.WriteLine("Rank " + count + " " + realtor.Name + " has " + realtor.NumberOfObjects); count++; } System.Console.ReadLine(); }
// Method selection public void select(int num) { switch (num) { case 1: basic display = new basic(); display.one(); display.two(); display.three(); break; case 2: summation res = new summation(); res.four(); res.five(); res.six(); break; case 3: MultiplicationTable multiply = new MultiplicationTable(); multiply.seven(); break; case 4: PrimeNumbers printPrime = new PrimeNumbers(); printPrime.eight(); break; case 5: MaxNum maxi = new MaxNum(); maxi.nine(); break; case 6: ReverseList rev = new ReverseList(); rev.ten(); break; case 7: ContainsElement con = new ContainsElement(); con.eleven(); break; case 8: ReturnItemsOddPos oddPos = new ReturnItemsOddPos(); oddPos.twelve(); break; case 9: RunningTotal runTotal = new RunningTotal(); runTotal.thirteen(); break; case 10: Palindrome pali = new Palindrome(); pali.fourteen(); break; case 11: SumFunct sumF = new SumFunct(); sumF.fifteenA(); sumF.fifteenB(); sumF.fifteenC(); break; case 12: Concatenation conca = new Concatenation(); conca.display(); conca.seventeen(); conca.nineteen(); break; default: Console.WriteLine("Choose a valid option"); break; } }
public void AddEggs(RunningTotal rt) { rt.AddItem(12); }
private void _timer_Elapsed(object sender, ElapsedEventArgs e) { RunningTotal += TimeSpan.FromSeconds(1); Device.BeginInvokeOnMainThread(() => runningTotalLabel.Text = RunningTotal.ToString(@"hh\:mm\:ss")); }
public RunningTotal CreateRunningTotal(RunningTotal runningTotal) { var dbSet = _dbContext.RunningTotal.Add(runningTotal); return(dbSet.Entity); }
public static int[] combinedFilter(int[] xs) { return(RunningTotal.adder(Modulo3Filter.modulo3s(xs))); }